/* frontend-style.css - IMPROVED VERSION */

.ffm-frontend-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    animation: slideUp 0.8s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(40px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Language Switcher */
.ffm-lang-switcher {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-bottom: 20px;
}

.lang-btn {
    padding: 8px 16px;
    background: white;
    border: 2px solid #EB5D0B;
    border-radius: 20px;
    color: #EB5D0B;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.lang-btn:hover {
    background: #EB5D0B;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(235, 93, 11, 0.2);
}

.lang-btn.active {
    background: linear-gradient(135deg, #FF5635 0%, #EB5D0B 100%);
    color: white;
    border-color: #FF5635;
}

/* Header - IMPROVED with your colors */
.ffm-frontend-header {
    text-align: center;
    margin-bottom: 40px;
    padding: 40px 20px;
    background: rgba(228, 198, 172, 0.44); /* #E4C6AC70 */
    border-radius: 20px;
    color: #EB5D0B;
    box-shadow: 0 8px 24px rgba(235, 93, 11, 0.2);
    position: relative;
    overflow: hidden;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(235, 93, 11, 0.1);
}

/* Animated background pulse */
.ffm-frontend-header::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(235, 93, 11, 0.1) 0%, transparent 70%);
    animation: pulse 4s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 0.3; }
    50% { transform: scale(1.1); opacity: 0.6; }
}

.ffm-title {
    font-size: 32px;
    font-weight: 700;
    margin: 0 0 10px 0;
    color: #EB5D0B; /* Changed from white/black to orange */
    position: relative;
    z-index: 1;
    animation: fadeInDown 0.6s ease-out 0.2s both;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.ffm-subtitle {
    font-size: 18px;
    margin: 0;
    opacity: 0.95;
    font-weight: 300;
    color: #B84A0A; /* Darker orange for subtitle */
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out 0.4s both;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Progress Bar */
.ffm-progress-container {
    margin-bottom: 40px;
}

.ffm-progress-bar {
    height: 8px;
    background: rgba(235, 93, 11, 0.15);
    border-radius: 10px;
    overflow: hidden;
    margin-bottom: 10px;
}

.ffm-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #FF5635 0%, #EB5D0B 50%, #D65309 100%);
    border-radius: 10px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 10px rgba(255, 86, 53, 0.5);
    animation: shimmer 2s linear infinite;
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.ffm-progress-text {
    text-align: center;
    color: #EB5D0B;
    font-weight: 600;
    font-size: 14px;
}

/* Chapter Section - IMPROVED with your background color */
.ffm-chapter-section {
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.ffm-chapter-header {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    padding: 20px;
    background: rgba(228, 198, 172, 0.44); /* #E4C6AC70 */
    border-radius: 15px;
    border-left: 5px solid #FF5635;
    box-shadow: 0 4px 12px rgba(235, 93, 11, 0.15);
    transition: all 0.3s ease;
}

.ffm-chapter-header:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(235, 93, 11, 0.25);
    border-left-width: 7px;
}

.chapter-number {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #FF5635 0%, #EB5D0B 100%);
    color: white;
    border-radius: 50%;
    font-size: 24px;
    font-weight: 700;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(255, 86, 53, 0.3);
    animation: bounce 0.6s ease;
}

@keyframes bounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

.chapter-title {
    font-size: 24px;
    font-weight: 600;
    color: #EB5D0B;
    margin: 0;
}

/* Questions Container */
.ffm-questions-container {
    display: flex;
    flex-direction: column;
    gap: 25px;
    margin-bottom: 30px;
}

.ffm-question-box {
    background: rgba(228, 198, 172, 0.44); /* #E4C6AC70 rgba(228, 198, 172, 1) */
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 2px 8px rgba(235, 93, 11, 0.1);
    transition: all 0.4s ease;
    border: 2px solid transparent;
    border-left: 5px solid #EB5D0B;
    animation: scaleIn 0.5s ease-out backwards;
}

.ffm-question-box:nth-child(1) { animation-delay: 0.1s; }
.ffm-question-box:nth-child(2) { animation-delay: 0.2s; }
.ffm-question-box:nth-child(3) { animation-delay: 0.3s; }
.ffm-question-box:nth-child(4) { animation-delay: 0.4s; }

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.ffm-question-box:hover {
    border-color: rgba(235, 93, 11, 0.3);
    box-shadow: 0 6px 20px rgba(235, 93, 11, 0.2);
    transform: translateY(-4px);
    border-left-width: 7px;
}

.ffm-question-label {
    display: block;
    font-size: 18px;
    font-weight: 500;
    color: #333;
    margin-bottom: 20px;
    line-height: 1.5;
}

.question-number {
    display: inline-block;
    width: 28px;
    height: 28px;
    background: linear-gradient(135deg, #FF5635 0%, #EB5D0B 100%);
    color: white;
    border-radius: 50%;
    text-align: center;
    line-height: 28px;
    font-size: 14px;
    font-weight: 700;
    margin-right: 10px;
}

/* Text Input */
.ffm-text-input {
    width: 100%;
    padding: 15px;
    border: 2px solid #E4C6AC;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.7);
}

.ffm-text-input:focus {
    outline: none;
    border-color: #EB5D0B;
    background: white;
    box-shadow: 0 0 0 3px rgba(235, 93, 11, 0.1);
    transform: scale(1.01);
}

/* Emoji Group */
.ffm-emoji-group {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
}

.emoji-option {
    flex: 1;
    min-width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 15px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 12px;
    position: relative;
}

.emoji-option::before {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 12px;
    padding: 2px;
    background: linear-gradient(135deg, #EB5D0B, #FF5635);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.emoji-option:hover {
    background: rgba(235, 93, 11, 0.08);
    transform: translateY(-5px);
}

.emoji-option:hover::before {
    opacity: 0.5;
}

.emoji-icon {
    font-size: 32px;
    transition: transform 0.3s ease;
}

.emoji-option:hover .emoji-icon {
    transform: scale(1.2) rotate(5deg);
}

.emoji-label {
    font-size: 12px;
    font-weight: 500;
    color: #666;
    text-align: center;
}

.emoji-selector {
    width: 20px;
    height: 20px;
    border: 2px solid #E4C6AC;
    border-radius: 50%;
    transition: all 0.3s ease;
    position: relative;
}

.emoji-option.selected {
    background: rgba(235, 93, 11, 0.12);
}

.emoji-option.selected::before {
    opacity: 1;
}

.emoji-option.selected .emoji-selector {
    background: linear-gradient(135deg, #FF5635 0%, #EB5D0B 100%);
    border-color: #FF5635;
    box-shadow: 0 0 0 3px rgba(255, 86, 53, 0.2);
    animation: checkPop 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes checkPop {
    0% { transform: scale(0); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.emoji-option.selected .emoji-selector::after {
    content: '✓';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: white;
    font-size: 12px;
    font-weight: 700;
}

.emoji-option.selected .emoji-icon {
    transform: scale(1.25);
}

/* Rating Group */
.ffm-rating-group {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
}

.rating-box {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid #E4C6AC;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.rating-box:hover {
    border-color: #EB5D0B;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 8px rgba(235, 93, 11, 0.15);
}

.rating-box.selected {
    background: linear-gradient(135deg, #FF5635 0%, #EB5D0B 100%);
    color: white;
    border-color: #FF5635;
    animation: ratingBounce 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes ratingBounce {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.2); }
}

/* Stars Group */
.ffm-stars-group {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.star-box {
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.star-box:hover {
    transform: translateY(-5px) scale(1.15);
}

.star-icon {
    width: 100%;
    height: 100%;
    fill: #E4C6AC;
    stroke: #EB5D0B;
    stroke-width: 1.5;
    transition: all 0.3s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

.star-box:hover .star-icon {
    fill: rgba(235, 93, 11, 0.3);
}

.star-box.selected .star-icon {
    fill: #FF5635;
    stroke: #FF5635;
    filter: drop-shadow(0 2px 8px rgba(255, 86, 53, 0.5));
    animation: starGlow 0.5s ease;
}

@keyframes starGlow {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.15); }
}

/* Navigation Buttons */
.ffm-nav-buttons {
    display: flex;
    gap: 15px;
    justify-content: space-between;
    margin-top: 40px;
}

.ffm-btn {
    padding: 14px 32px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
    position: relative;
    overflow: hidden;
}

.ffm-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.ffm-btn:hover::before {
    width: 300px;
    height: 300px;
}

.ffm-btn-prev {
    background: white;
    color: #EB5D0B;
    border: 2px solid #EB5D0B;
}

.ffm-btn-prev:hover {
    background: #EB5D0B;
    color: white;
    transform: translateX(-5px);
    box-shadow: 0 4px 12px rgba(235, 93, 11, 0.3);
}

.ffm-btn-next,
.ffm-btn-submit {
    background: linear-gradient(135deg, #FF5635 0%, #EB5D0B 100%);
    color: white;
    margin-left: auto;
    box-shadow: 0 4px 12px rgba(255, 86, 53, 0.3);
}

.ffm-btn-next:hover,
.ffm-btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 86, 53, 0.4);
}

/* Success Message */
.ffm-success-message {
    text-align: center;
    padding: 60px 30px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    animation: successPop 0.8s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

@keyframes successPop {
    0% {
        opacity: 0;
        transform: scale(0.5) rotate(-10deg);
    }
    50% {
        transform: scale(1.05) rotate(2deg);
    }
    100% {
        opacity: 1;
        transform: scale(1) rotate(0);
    }
}

.success-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 20px;
    background: linear-gradient(135deg, #FF5635 0%, #EB5D0B 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    font-weight: 700;
    box-shadow: 0 8px 24px rgba(255, 86, 53, 0.3);
    animation: iconBounce 1s ease infinite;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.ffm-success-message h2 {
    color: #EB5D0B;
    font-size: 28px;
    margin-bottom: 15px;
}

.ffm-success-message p {
    color: #666;
    font-size: 18px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .ffm-frontend-container {
        padding: 15px;
    }

    .ffm-title {
        font-size: 24px;
    }

    .ffm-subtitle {
        font-size: 16px;
    }

    .ffm-frontend-header {
        padding: 30px 15px;
        margin-bottom: 30px;
    }

    .chapter-title {
        font-size: 20px;
    }

    .ffm-question-label {
        font-size: 16px;
    }

    .emoji-option {
        min-width: 80px;
        padding: 12px 8px;
    }

    .emoji-icon {
        font-size: 28px;
    }

    .emoji-label {
        font-size: 11px;
    }

    .rating-box {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .star-box {
        width: 36px;
        height: 36px;
    }

    .ffm-btn {
        padding: 12px 24px;
        font-size: 14px;
    }

    .ffm-nav-buttons {
        flex-direction: column;
    }

    .ffm-btn-next,
    .ffm-btn-submit {
        margin-left: 0;
    }
}

@media (max-width: 480px) {
    .ffm-emoji-group {
        gap: 10px;
    }

    .emoji-option {
        min-width: 70px;
    }

    .emoji-icon {
        font-size: 24px;
    }

    .rating-box {
        width: 32px;
        height: 32px;
        font-size: 13px;
        gap: 6px;
    }

    .star-box {
        width: 32px;
        height: 32px;
        gap: 8px;
    }
}