/**
 * Suggestion Forms Styles
 */

/* Modal Styles */
.kk-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.kk-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
}

.kk-modal__content {
    position: relative;
    background: white;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    max-width: 600px;
    width: 100%;
    max-height: 90vh;
    overflow: hidden;
    animation: modalSlideIn 0.3s ease-out;
}

.kk-modal__header {
    display: flex;
    justify-content: flex-end;
    padding: 1rem 1.5rem 0;
}

.kk-modal__close {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #6b7280;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
    line-height: 1;
}

.kk-modal__close:hover {
    background: #f3f4f6;
    color: #374151;
}

.kk-modal__body {
    padding: 0 1.5rem 1.5rem;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Form Styles */
.kk-suggestion-form {
    font-family: 'Cairo', -apple-system, BlinkMacSystemFont, sans-serif;
}

.kk-suggestion-form__header {
    margin-bottom: 2rem;
    text-align: center;
}

.kk-suggestion-form__header h3 {
    color: #1e40af;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem;
}

.kk-suggestion-form__description {
    color: #6b7280;
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.kk-suggestion-form__fields {
    margin-bottom: 2rem;
}

.kk-field-group {
    margin-bottom: 1.5rem;
}

.kk-field-group label {
    display: block;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

.kk-field-required label::after {
    content: ' *';
    color: #dc2626;
}

.kk-field-group input,
.kk-field-group textarea,
.kk-field-group select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
    background: white;
    font-family: inherit;
}

.kk-field-group input:focus,
.kk-field-group textarea:focus,
.kk-field-group select:focus {
    outline: none;
    border-color: #1e40af;
    box-shadow: 0 0 0 3px rgba(30, 64, 175, 0.1);
}

.kk-field-group textarea {
    resize: vertical;
    min-height: 80px;
}

.kk-field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

@media (max-width: 640px) {
    .kk-field-row {
        grid-template-columns: 1fr;
    }
}

/* Button Styles */
.kk-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    line-height: 1;
}

.kk-button--primary {
    background: linear-gradient(135deg, #1e40af 0%, #3b82f6 100%);
    color: white;
}

.kk-button--primary:hover {
    background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(30, 64, 175, 0.3);
}

.kk-button--primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.kk-button--secondary {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.kk-button--secondary:hover {
    background: #e5e7eb;
    border-color: #9ca3af;
}

.kk-suggestion-form__footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

@media (max-width: 480px) {
    .kk-suggestion-form__footer {
        flex-direction: column-reverse;
    }
    
    .kk-suggestion-form__footer .kk-button {
        width: 100%;
    }
}

/* Suggestion Trigger Button */
.kk-suggestion-trigger {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.kk-suggestion-trigger:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.kk-suggestion-trigger::before {
    content: '✏️';
    font-size: 1rem;
}

/* Validation Styles */
.kk-field-error input,
.kk-field-error textarea,
.kk-field-error select {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.kk-field-error .kk-field-error {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.kk-field-error .kk-field-error::before {
    content: '⚠️';
    font-size: 0.875rem;
}

/* Character Counter */
.kk-character-counter {
    font-size: 0.75rem;
    color: #6b7280;
    text-align: right;
    margin-top: 0.25rem;
}

.kk-character-counter--warning {
    color: #dc2626;
    font-weight: 500;
}

/* Messages */
.kk-suggestion-form__messages {
    margin-top: 1rem;
}

.kk-message {
    padding: 0.75rem 1rem;
    border-radius: 8px;
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.kk-message--success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.kk-message--success::before {
    content: '✅';
    font-size: 1rem;
}

.kk-message--error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.kk-message--error::before {
    content: '❌';
    font-size: 1rem;
}

/* Permission Messages */
.kk-suggestion-login-required,
.kk-suggestion-no-permission,
.kk-suggestion-limit-reached {
    background: #fef3c7;
    color: #92400e;
    padding: 1rem;
    border-radius: 8px;
    border: 1px solid #fcd34d;
    font-size: 0.875rem;
    text-align: center;
}

.kk-suggestion-login-required a {
    color: #1e40af;
    text-decoration: underline;
}

.kk-suggestion-login-required a:hover {
    color: #1d4ed8;
}

/* Loading States */
.kk-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    backdrop-filter: blur(2px);
}

.kk-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #1e40af;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Checkbox Styles */
.kk-field-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
    accent-color: #1e40af;
}

.kk-field-group label:has(input[type="checkbox"]) {
    display: flex;
    align-items: center;
    font-weight: normal;
    cursor: pointer;
}

/* Select Styles */
.kk-field-group select {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

/* RTL Support */
[dir="rtl"] .kk-modal__header {
    justify-content: flex-start;
}

[dir="rtl"] .kk-field-group select {
    background-position: left 0.5rem center;
    padding-right: 0.75rem;
    padding-left: 2.5rem;
}

[dir="rtl"] .kk-character-counter {
    text-align: left;
}

[dir="rtl"] .kk-suggestion-form__footer {
    justify-content: flex-start;
}

[dir="rtl"] .kk-field-group input[type="checkbox"] {
    margin-right: 0;
    margin-left: 0.5rem;
}

/* Mobile Optimizations */
@media (max-width: 640px) {
    .kk-modal {
        padding: 0.5rem;
    }
    
    .kk-modal__content {
        border-radius: 8px;
        max-height: 95vh;
    }
    
    .kk-modal__body {
        padding: 0 1rem 1rem;
    }
    
    .kk-suggestion-form__header h3 {
        font-size: 1.25rem;
    }
    
    .kk-field-group input,
    .kk-field-group textarea,
    .kk-field-group select {
        font-size: 16px; /* Prevents zoom on iOS */
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .kk-modal__content {
        border: 2px solid #000;
    }
    
    .kk-field-group input,
    .kk-field-group textarea,
    .kk-field-group select {
        border: 2px solid #000;
    }
    
    .kk-button--primary {
        background: #000;
        border: 2px solid #000;
    }
    
    .kk-button--secondary {
        background: #fff;
        border: 2px solid #000;
        color: #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .kk-modal__content {
        animation: none;
    }
    
    .kk-button,
    .kk-field-group input,
    .kk-field-group textarea,
    .kk-field-group select {
        transition: none;
    }
    
    .kk-spinner {
        animation: none;
        border: 4px solid #1e40af;
    }
}

