/* ===================================
   Global Styles & CSS Variables
   =================================== */

:root {
    /* Color Palette */
    --primary-color: #667eea;
    --primary-dark: #5568d3;
    --primary-light: #7c8ff0;

    --secondary-color: #764ba2;

    --success-color: #10b981;
    --success-light: #d1fae5;

    --text-primary: #1f2937;
    --text-secondary: #6b7280;
    --text-light: #9ca3af;

    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --bg-card: #ffffff;

    --border-color: #e5e7eb;
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px 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);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-success: linear-gradient(135deg, #10b981 0%, #059669 100%);
    --gradient-bg: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);

    /* Typography */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 0.75rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.75rem;
    --radius-lg: 1rem;
    --radius-xl: 1.5rem;
    --radius-full: 9999px;

    /* Transitions */
    --transition-fast: 150ms ease-in-out;
    --transition-base: 300ms ease-in-out;
    --transition-slow: 500ms ease-in-out;
}

/* ===================================
   Reset & Base Styles
   =================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family);
    background: var(--gradient-bg);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    position: relative;
    overflow-x: hidden;
}

/* ===================================
   Background Decorations
   =================================== */

.background-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.decoration-circle {
    position: absolute;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(102, 126, 234, 0.1) 0%, rgba(118, 75, 162, 0.1) 100%);
    animation: float 20s infinite ease-in-out;
}

.circle-1 {
    width: 400px;
    height: 400px;
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.circle-2 {
    width: 300px;
    height: 300px;
    bottom: -50px;
    left: -50px;
    animation-delay: 5s;
}

.circle-3 {
    width: 250px;
    height: 250px;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 10s;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    33% {
        transform: translateY(-30px) rotate(120deg);
    }

    66% {
        transform: translateY(30px) rotate(240deg);
    }
}

/* ===================================
   Container & Card Styles
   =================================== */

.container-wrapper {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.feedback-card {
    background: var(--bg-card);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    padding: var(--spacing-2xl);
    position: relative;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: all var(--transition-slow);
    pointer-events: none;
    backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.95);
}

.feedback-card.active {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* ===================================
   Card Header
   =================================== */

.card-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.logo-container {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-lg);
}

.logo-icon {
    width: 80px;
    height: 80px;
    background: var(--gradient-primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

.logo-icon svg {
    width: 40px;
    height: 40px;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
    }

    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
    }
}

.card-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.card-subtitle {
    font-size: 1rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* ===================================
   Question Section
   =================================== */

.question-section {
    margin-bottom: var(--spacing-2xl);
}

.question-text {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    text-align: center;
    line-height: 1.5;
}

/* ===================================
   Star Rating System
   =================================== */

.star-rating-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
    margin-bottom: var(--spacing-2xl);
}

.star-rating {
    display: flex;
    gap: var(--spacing-sm);
    direction: ltr;
    padding: var(--spacing-lg);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
}

.rating-input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.star-label {
    cursor: pointer;
    transition: all var(--transition-base);
    display: inline-block;
}

.star-icon {
    width: 56px;
    height: 56px;
    color: #d1d5db;
    transition: all var(--transition-base);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Hover effect - highlight current and previous stars */
.star-label:hover .star-icon,
.star-label:hover~.star-label .star-icon {
    color: #fbbf24;
    transform: scale(1.1);
}

/* Selected state */
.rating-input:checked+.star-label .star-icon {
    color: #f59e0b;
    transform: scale(1.15);
    animation: starPop 0.3s ease-out;
}

/* Fill previous stars when one is selected */
.rating-input:checked+.star-label~.star-label .star-icon {
    color: #f59e0b;
}

/* Reverse order for proper star filling (1-5 from left to right) */
.star-rating {
    display: flex;
    flex-direction: row-reverse;
    justify-content: center;
}

/* Override hover for reversed layout */
.star-label:hover .star-icon,
.star-label:hover~.star-label .star-icon {
    color: #fbbf24;
}

/* Active/Selected stars in reversed layout */
.rating-input:checked+.star-label .star-icon,
.rating-input:checked+.star-label~.star-label .star-icon {
    color: #f59e0b;
}

@keyframes starPop {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.3) rotate(-10deg);
    }

    100% {
        transform: scale(1.15) rotate(0deg);
    }
}

.rating-text-display {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-secondary);
    min-height: 28px;
    text-align: center;
    transition: all var(--transition-base);
}

.rating-text-display.active {
    color: var(--primary-color);
    transform: scale(1.05);
}

/* ===================================
   Comment Section
   =================================== */

.comment-section {
    margin-bottom: var(--spacing-2xl);
}

.comment-label {
    display: flex;
    align-items: center;
    gap: var(--spacing-xs);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
}

.comment-textarea {
    width: 100%;
    padding: var(--spacing-md);
    border: 2px solid var(--border-color);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: 0.937rem;
    color: var(--text-primary);
    resize: vertical;
    transition: all var(--transition-base);
    background: var(--bg-secondary);
}

.comment-textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-card);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.comment-textarea::placeholder {
    color: var(--text-light);
}

/* ===================================
   Submit Button
   =================================== */

.submit-btn {
    width: 100%;
    padding: var(--spacing-md) var(--spacing-xl);
    background: var(--gradient-primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-base);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left var(--transition-slow);
}

.submit-btn:hover::before {
    left: 100%;
}

.submit-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.submit-btn:active:not(:disabled) {
    transform: translateY(0);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-icon {
    width: 20px;
    height: 20px;
    transition: transform var(--transition-base);
}

.submit-btn:hover:not(:disabled) .btn-icon {
    transform: translateX(4px);
}

/* ===================================
   Thank You Screen
   =================================== */

.thank-you-card {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
}

.thank-you-content {
    text-align: center;
}

.success-icon-wrapper {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-xl);
}

.success-icon {
    width: 120px;
    height: 120px;
    background: var(--gradient-success);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    box-shadow: 0 12px 24px rgba(16, 185, 129, 0.3);
    animation: scaleIn 0.5s ease-out;
}

.success-icon svg {
    width: 64px;
    height: 64px;
    stroke-width: 2.5;
}

@keyframes scaleIn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    50% {
        transform: scale(1.1) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.thank-you-title {
    font-size: 2.5rem;
    font-weight: 800;
    background: var(--gradient-success);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

.thank-you-message {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--spacing-2xl);
}

.rating-summary {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-lg) var(--spacing-2xl);
    background: var(--bg-secondary);
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-2xl);
    box-shadow: var(--shadow-md);
}

.summary-stars {
    display: flex;
    gap: 8px;
    margin-bottom: var(--spacing-sm);
}

.summary-star {
    width: 48px;
    height: 48px;
    color: #d1d5db;
    transition: all var(--transition-base);
}

.summary-star.filled {
    color: #f59e0b;
    animation: starFillIn 0.3s ease-out backwards;
}

@keyframes starFillIn {
    0% {
        transform: scale(0) rotate(-180deg);
        opacity: 0;
    }

    70% {
        transform: scale(1.2) rotate(10deg);
    }

    100% {
        transform: scale(1) rotate(0deg);
        opacity: 1;
    }
}

.summary-text {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--primary-color);
}

.thank-you-actions {
    margin-bottom: var(--spacing-2xl);
}

.new-feedback-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    background: white;
    color: var(--primary-color);
    font-size: 0.937rem;
    font-weight: 600;
    border: 2px solid var(--primary-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    transition: all var(--transition-base);
}

.new-feedback-btn:hover {
    background: var(--primary-color);
    color: white;
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

/* ===================================
   Footer Decoration
   =================================== */

.footer-decoration {
    margin-top: var(--spacing-2xl);
}

.decoration-dots {
    display: flex;
    justify-content: center;
    gap: var(--spacing-sm);
}

.decoration-dots span {
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    opacity: 0.3;
    animation: dotPulse 1.5s infinite ease-in-out;
}

.decoration-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.decoration-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes dotPulse {

    0%,
    100% {
        opacity: 0.3;
        transform: scale(1);
    }

    50% {
        opacity: 1;
        transform: scale(1.3);
    }
}

/* ===================================
   Responsive Design
   =================================== */

@media (max-width: 640px) {
    .feedback-card {
        padding: var(--spacing-xl);
    }

    .logo-icon {
        width: 60px;
        height: 60px;
    }

    .logo-icon svg {
        width: 30px;
        height: 30px;
    }

    .card-title {
        font-size: 1.5rem;
    }

    .question-text {
        font-size: 1.125rem;
    }

    .rating-grid {
        grid-template-columns: repeat(auto-fit, minmax(80px, 1fr));
        gap: var(--spacing-md);
    }

    .emoji {
        font-size: 2rem;
    }

    .emoji-container {
        width: 50px;
        height: 50px;
    }

    .success-icon {
        width: 90px;
        height: 90px;
    }

    .success-icon svg {
        width: 48px;
        height: 48px;
    }

    .thank-you-title {
        font-size: 2rem;
    }
}