/* =========================================
   Newspaper Feedback Manager - Frontend CSS
   ========================================= */

/* Variables & Base Styles */
:root {
    --primary-color: #2563eb;
    --primary-dark: #1e40af;
    --success-color: #10b981;
    --error-color: #ef4444;
    --warning-color: #f59e0b;
    --text-dark: #1f2937;
    --text-light: #6b7280;
    --border-color: #e5e7eb;
    --bg-light: #f9fafb;
    --shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease;
}

* {
    box-sizing: border-box;
}

/* Wrapper */
.nfm-feedback-wrapper {
    width: 100%;
    max-width: 600px;
    margin: 40px auto;
    padding: 20px;
}

/* Container */
.nfm-feedback-container {
    background: #fff;
    border-radius: 12px;
    box-shadow: var(--shadow-lg);
    padding: 40px;
    animation: slideInUp 0.4s ease;
}

/* Header */
.nfm-feedback-header {
    text-align: center;
    margin-bottom: 35px;
}

.nfm-feedback-header h1 {
    font-size: 28px;
    color: var(--text-dark);
    margin: 0 0 10px 0;
    font-weight: 600;
}

.nfm-subtitle {
    font-size: 15px;
    color: var(--text-light);
    margin: 0;
}

/* Form Styles */
.nfm-feedback-form {
    display: flex;
    flex-direction: column;
}

.nfm-form-group {
    margin-bottom: 24px;
    animation: fadeIn 0.4s ease forwards;
}

.nfm-form-group:nth-child(2) { animation-delay: 0.05s; }
.nfm-form-group:nth-child(3) { animation-delay: 0.1s; }
.nfm-form-group:nth-child(4) { animation-delay: 0.15s; }
.nfm-form-group:nth-child(5) { animation-delay: 0.2s; }
.nfm-form-group:nth-child(6) { animation-delay: 0.25s; }

/* Labels */
.nfm-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.nfm-required {
    color: var(--error-color);
    margin-left: 3px;
}

/* Input Fields */
.nfm-input,
.nfm-textarea {
    width: 100%;
    padding: 12px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    color: var(--text-dark);
    transition: var(--transition);
    background: #fff;
}

.nfm-input:focus,
.nfm-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.nfm-input::placeholder,
.nfm-textarea::placeholder {
    color: #d1d5db;
}

.nfm-textarea {
    resize: vertical;
    min-height: 120px;
    line-height: 1.5;
}

/* Character Counter */
.nfm-char-count {
    display: block;
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

/* Rating System */
.nfm-rating-container {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nfm-stars-input {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nfm-stars-input input {
    display: none;
}

.nfm-star-label {
    font-size: 32px;
    color: #d1d5db;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.nfm-star-label:hover,
.nfm-star-label.nfm-star-active {
    color: #fbbf24;
    transform: scale(1.15);
}

.nfm-rating-text {
    font-size: 14px;
    color: var(--text-light);
}

#nfm-rating-value {
    font-weight: 600;
    color: var(--primary-color);
}

/* Form Actions */
.nfm-form-actions {
    margin-top: 30px;
}

/* Buttons */
.nfm-btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
}

.nfm-btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.nfm-btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.nfm-btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Loading Spinner */
.nfm-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Messages */
#nfm-feedback-result {
    margin-top: 20px;
}

/* Success Message */
.nfm-success-message {
    background: linear-gradient(135deg, #f0fdf4 0%, #e0f2fe 100%);
    border: 2px solid var(--success-color);
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    animation: slideInUp 0.4s ease;
    opacity: 0;
    transform: translateY(20px);
}

.nfm-success-message.nfm-show {
    opacity: 1;
    transform: translateY(0);
}

.nfm-success-icon {
    font-size: 48px;
    color: var(--success-color);
    margin-bottom: 15px;
    animation: scaleInSuccess 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.nfm-success-message h2 {
    color: var(--text-dark);
    font-size: 24px;
    margin: 0 0 10px 0;
}

.nfm-success-message p {
    color: var(--text-light);
    margin: 8px 0;
    font-size: 14px;
}

.nfm-success-note {
    font-style: italic;
    color: var(--success-color) !important;
    font-weight: 500;
}

/* Error Message */
.nfm-error-message {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid var(--error-color);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
}

.nfm-error-message .nfm-error-icon {
    font-size: 32px;
    color: var(--error-color);
    margin-bottom: 10px;
}

.nfm-error-message p {
    color: var(--text-dark);
    margin: 0;
    font-size: 14px;
}

/* Error Container (Invalid Link) */
.nfm-error-container {
    background: linear-gradient(135deg, #fef2f2 0%, #fee2e2 100%);
    border: 2px solid var(--error-color);
    border-radius: 12px;
    padding: 50px 30px;
    text-align: center;
}

.nfm-error-icon {
    font-size: 56px;
    margin-bottom: 20px;
}

.nfm-error-container h2 {
    color: var(--text-dark);
    font-size: 24px;
    margin: 0 0 15px 0;
}

.nfm-error-container p {
    color: var(--text-light);
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
}

/* Animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes scaleInSuccess {
    from {
        opacity: 0;
        transform: scale(0.3);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Responsive Design */
@media (max-width: 640px) {
    .nfm-feedback-wrapper {
        margin: 20px auto;
        padding: 15px;
    }

    .nfm-feedback-container {
        padding: 25px;
    }

    .nfm-feedback-header h1 {
        font-size: 22px;
    }

    .nfm-star-label {
        font-size: 28px;
    }

    .nfm-rating-container {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .nfm-btn {
        padding: 12px 20px;
        font-size: 14px;
    }

    .nfm-error-container,
    .nfm-success-message {
        padding: 25px 20px;
    }

    .nfm-error-icon,
    .nfm-success-icon {
        font-size: 40px;
    }
}
