/**
 * Feedback Forms Collector - Frontend Styles
 */

/* Сообщения */
.ffc-message {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    z-index: 999999;
    max-width: 400px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    display: none;
    animation: slideInRight 0.3s ease-out;
}

.ffc-message.ffc-success {
    background: #28a745;
    border-left: 4px solid #1e7e34;
}

.ffc-message.ffc-error {
    background: #dc3545;
    border-left: 4px solid #c82333;
}

.ffc-message.ffc-info {
    background: #17a2b8;
    border-left: 4px solid #138496;
}

.ffc-message.ffc-warning {
    background: #ffc107;
    border-left: 4px solid #e0a800;
    color: #212529;
}

/* Анимации для сообщений */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.ffc-message.fade-out {
    animation: slideOutRight 0.3s ease-in forwards;
}

/* Стили для форм */
.ffc-form {
    /* Базовые стили для форм, использующих плагин */
}

.ffc-form input[type="text"],
.ffc-form input[type="email"],
.ffc-form input[type="tel"],
.ffc-form input[type="url"],
.ffc-form textarea,
.ffc-form select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.ffc-form input:focus,
.ffc-form textarea:focus,
.ffc-form select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.ffc-form input[type="checkbox"],
.ffc-form input[type="radio"] {
    width: auto;
    margin-right: 8px;
}



.ffc-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.ffc-form button[type="submit"],
.ffc-form input[type="submit"] {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.ffc-form button[type="submit"]:hover,
.ffc-form input[type="submit"]:hover {
    background: #005a87;
}

.ffc-form button[type="submit"]:disabled,
.ffc-form input[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Заблокированная форма */
.ffc-form.ffc-spam-blocked {
    opacity: 0.7;
    pointer-events: none;
}

.ffc-form.ffc-spam-blocked button[type="submit"],
.ffc-form.ffc-spam-blocked input[type="submit"] {
    background: #dc3545;
    color: #fff;
    cursor: not-allowed;
}

.ffc-form.ffc-spam-blocked button[type="submit"]:hover,
.ffc-form.ffc-spam-blocked input[type="submit"]:hover {
    background: #c82333;
}

/* Состояния загрузки */
.ffc-form.loading {
    opacity: 0.7;
    pointer-events: none;
}

.ffc-form.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #0073aa;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Валидация полей */
.ffc-form input.error,
.ffc-form textarea.error,
.ffc-form select.error {
    border-color: #dc3545;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.2);
}

.ffc-form .error-message {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

/* Согласие на обработку данных */
.ffc-form .consent-field {
    margin: 15px 0;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #0073aa;
}

.ffc-form .consent-field label {
    margin-bottom: 0;
    font-size: 14px;
    line-height: 1.4;
}

/* Адаптивность */
@media (max-width: 768px) {
    .ffc-message {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .ffc-form input[type="text"],
    .ffc-form input[type="email"],
    .ffc-form input[type="tel"],
    .ffc-form input[type="url"],
    .ffc-form textarea,
    .ffc-form select {
        font-size: 16px; /* Предотвращает зум на iOS */
    }
}

/* Темная тема */
@media (prefers-color-scheme: dark) {
    .ffc-message {
        background: #333;
        color: #fff;
    }
    
    .ffc-message.ffc-success {
        background: #28a745;
    }
    
    .ffc-message.ffc-error {
        background: #dc3545;
    }
    
    .ffc-message.ffc-info {
        background: #17a2b8;
    }
    
    .ffc-message.ffc-warning {
        background: #ffc107;
        color: #212529;
    }
}

/* Утилиты */
.ffc-hidden {
    display: none !important;
}

.ffc-visible {
    display: block !important;
}

.ffc-text-center {
    text-align: center;
}

.ffc-text-left {
    text-align: left;
}

.ffc-text-right {
    text-align: right;
}

/* Стили для кастомных форм */
[data-ffc="true"] {
    /* Стили для форм с атрибутом data-ffc="true" */
}

[data-ffc="true"] input[type="text"],
[data-ffc="true"] input[type="email"],
[data-ffc="true"] input[type="tel"],
[data-ffc="true"] input[type="url"],
[data-ffc="true"] textarea,
[data-ffc="true"] select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

[data-ffc="true"] input:focus,
[data-ffc="true"] textarea:focus,
[data-ffc="true"] select:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

[data-ffc="true"] button[type="submit"],
[data-ffc="true"] input[type="submit"] {
    background: #0073aa;
    color: #fff;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

[data-ffc="true"] button[type="submit"]:hover,
[data-ffc="true"] input[type="submit"]:hover {
    background: #005a87;
}

[data-ffc="true"] button[type="submit"]:disabled,
[data-ffc="true"] input[type="submit"]:disabled {
    background: #ccc;
    cursor: not-allowed;
}
