/* ========================================
   GENERAL STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding-top: 80px;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    z-index: -1;
}

/* ========================================
   NAVIGATION BAR
   ======================================== */

.navbar {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    transition: all 0.3s ease;
}

.logo-img {
    height: 50px;
    width: auto;
    transition: transform 0.3s ease;
}

.logo-img:hover {
    transform: scale(1.05);
}

.navbar-text {
    color: #666;
    font-size: 0.9rem;
    font-weight: 500;
}

/* ========================================
   HERO SECTION
   ======================================== */

.hero-section {
    background: transparent;
    padding: 3rem 0 2rem;
    text-align: center;
}

.hero-title {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

.hero-subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    font-weight: 300;
    max-width: 600px;
    margin: 0 auto;
}

/* ========================================
   MAIN CONTENT
   ======================================== */

.main-content {
    padding: 2rem 0 4rem;
}

.feedback-card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    padding: 2rem;
    margin: 0 auto;
    max-width: 900px;
    animation: slideUp 0.6s ease;
}

/* ========================================
   FORM SECTIONS
   ======================================== */

.form-section {
    margin-bottom: 2.5rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 15px;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.5s ease;
}

.form-section.animate-in {
    opacity: 1;
    transform: translateY(0);
}

.section-title {
    color: #333;
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #667eea;
    display: inline-block;
}

/* ========================================
   FORM CONTROLS
   ======================================== */

.form-control {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-floating > label {
    color: #666;
    font-size: 0.9rem;
}

.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label {
    color: #667eea;
}

/* ========================================
   RATING SECTION - ENHANCED WITH ANIMATIONS
   ======================================== */

.rating-item {
    margin-bottom: 2.5rem;
    padding: 2rem;
    background: linear-gradient(135deg, rgba(255,255,255,1) 0%, rgba(249,250,251,1) 100%);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.rating-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s ease;
}

.rating-item:hover::before {
    left: 100%;
}

.rating-item:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 20px 60px rgba(102, 126, 234, 0.15);
}

.rating-label {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 1.5rem;
    font-size: 1.05rem;
    letter-spacing: 0.3px;
}

.question-number {
    display: inline-block;
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    width: 35px;
    height: 35px;
    line-height: 35px;
    text-align: center;
    border-radius: 50%;
    margin-right: 12px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
    50% {
        box-shadow: 0 4px 25px rgba(102, 126, 234, 0.5);
    }
    100% {
        box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    }
}

.rating-container {
    position: relative;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border-radius: 15px;
    margin-top: 1rem;
}

.rating-labels {
    display: flex;
    justify-content: space-between;
    margin-bottom: 2rem;
    font-size: 0.9rem;
    font-weight: 500;
}

.rating-min {
    color: #e74c3c;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: slideInLeft 0.6s ease;
}

.rating-max {
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 5px;
    animation: slideInRight 0.6s ease;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Enhanced Custom Range Slider */
.slider-wrapper {
    position: relative;
    margin: 2rem 0;
}

.slider-track {
    position: absolute;
    width: 100%;
    height: 12px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
    top: 50%;
    transform: translateY(-50%);
}

.slider-fill {
    position: absolute;
    height: 100%;
    background: linear-gradient(90deg, #e74c3c 0%, #f39c12 50%, #27ae60 100%);
    border-radius: 10px;
    width: 50%;
    transition: width 0.3s ease;
}

.custom-range {
    position: relative;
    width: 100%;
    height: 12px;
    background: transparent;
    border-radius: 10px;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    z-index: 2;
    cursor: pointer;
}

.custom-range::-webkit-slider-track {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, 
        #e74c3c 0%, 
        #ec7063 10%, 
        #f39c12 30%, 
        #f4d03f 50%, 
        #52c234 70%, 
        #27ae60 100%);
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
    animation: shimmer 3s linear infinite;
    background-size: 200% 100%;
}

@keyframes shimmer {
    0% {
        background-position: -200% center;
    }
    100% {
        background-position: 200% center;
    }
}

.custom-range::-moz-range-track {
    width: 100%;
    height: 12px;
    background: linear-gradient(90deg, 
        #e74c3c 0%, 
        #ec7063 10%, 
        #f39c12 30%, 
        #f4d03f 50%, 
        #52c234 70%, 
        #27ae60 100%);
    border-radius: 10px;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.custom-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 30px;
    height: 30px;
    background: white;
    border: 4px solid #667eea;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4),
                0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    animation: thumbPulse 2s infinite;
}

@keyframes thumbPulse {
    0% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4),
                    0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        box-shadow: 0 0 0 10px rgba(102, 126, 234, 0),
                    0 4px 15px rgba(0, 0, 0, 0.2);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(102, 126, 234, 0),
                    0 4px 15px rgba(0, 0, 0, 0.2);
    }
}

.custom-range::-webkit-slider-thumb:hover {
    transform: scale(1.3);
    border-color: #764ba2;
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1),
                0 6px 20px rgba(102, 126, 234, 0.4);
    cursor: grabbing;
}

.custom-range::-webkit-slider-thumb:active {
    transform: scale(1.1);
    box-shadow: 0 0 0 12px rgba(102, 126, 234, 0.2),
                0 6px 20px rgba(102, 126, 234, 0.4);
}

.custom-range::-moz-range-thumb {
    width: 30px;
    height: 30px;
    background: white;
    border: 4px solid #667eea;
    border-radius: 50%;
    cursor: grab;
    box-shadow: 0 0 0 0 rgba(102, 126, 234, 0.4),
                0 4px 15px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.custom-range::-moz-range-thumb:hover {
    transform: scale(1.3);
    border-color: #764ba2;
    box-shadow: 0 0 0 8px rgba(102, 126, 234, 0.1),
                0 6px 20px rgba(102, 126, 234, 0.4);
}

/* Enhanced Range Value Display */
.range-value {
    position: absolute;
    top: -50px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 8px 16px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 1.2rem;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.4);
    transition: all 0.3s ease;
    animation: bounceIn 0.5s ease;
}

.range-value::after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 8px solid transparent;
    border-right: 8px solid transparent;
    border-top: 8px solid #764ba2;
}

@keyframes bounceIn {
    0% {
        opacity: 0;
        transform: translateX(-50%) scale(0.3);
    }
    50% {
        transform: translateX(-50%) scale(1.05);
    }
    70% {
        transform: translateX(-50%) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateX(-50%) scale(1);
    }
}

.range-value.poor {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    animation: shake 0.5s ease;
}

.range-value.poor::after {
    border-top-color: #c0392b;
}

@keyframes shake {
    0%, 100% { transform: translateX(-50%) rotate(0deg); }
    25% { transform: translateX(-55%) rotate(-5deg); }
    75% { transform: translateX(-45%) rotate(5deg); }
}

.range-value.average {
    background: linear-gradient(135deg, #f39c12, #d68910);
}

.range-value.average::after {
    border-top-color: #d68910;
}

.range-value.good {
    background: linear-gradient(135deg, #27ae60, #229954);
    animation: bounce 0.5s ease;
}

.range-value.good::after {
    border-top-color: #229954;
}

@keyframes bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-10px); }
}

/* Emoji Feedback Display */
.emoji-feedback {
    position: absolute;
    top: -85px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 2.5rem;
    animation: emojiPop 0.5s ease;
    transition: all 0.3s ease;
}

@keyframes emojiPop {
    0% {
        transform: translateX(-50%) scale(0) rotate(0deg);
    }
    50% {
        transform: translateX(-50%) scale(1.2) rotate(10deg);
    }
    100% {
        transform: translateX(-50%) scale(1) rotate(0deg);
    }
}

/* Range Marks with Animation */
.range-marks {
    display: flex;
    justify-content: space-between;
    margin-top: 15px;
    padding: 0 5px;
    position: relative;
}

.range-marks span {
    font-size: 0.75rem;
    color: #95a5a6;
    font-weight: 600;
    position: relative;
    cursor: pointer;
    transition: all 0.3s ease;
    padding: 5px 8px;
    border-radius: 5px;
}

.range-marks span:hover {
    color: #667eea;
    background: rgba(102, 126, 234, 0.1);
    transform: translateY(-3px);
}

.range-marks span.active {
    color: #667eea;
    font-weight: 700;
    transform: scale(1.2);
}

/* Particle Effects for Good Ratings */
.particles {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 10px;
    height: 10px;
    background: linear-gradient(135deg, #667eea, #764ba2);
    border-radius: 50%;
    animation: particleFloat 3s ease-out infinite;
}

@keyframes particleFloat {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0);
    }
    20% {
        opacity: 1;
        transform: translateY(-20px) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(-100px) scale(0.5);
    }
}

/* ========================================
   BUTTONS
   ======================================== */

.btn-submit {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border: none;
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    margin-right: 1rem;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
    color: white;
}

.btn-reset {
    background: white;
    color: #667eea;
    border: 2px solid #667eea;
    padding: 12px 40px;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 50px;
    transition: all 0.3s ease;
}

.btn-reset:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
}

/* ========================================
   FOOTER
   ======================================== */

.footer {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    padding: 2rem 0;
    margin-top: 3rem;
}

.footer p {
    margin: 0;
    font-size: 0.9rem;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.8s ease;
}

.animate-slide-up {
    animation: slideUp 0.8s ease 0.2s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* ========================================
   MOBILE-SPECIFIC IMPROVEMENTS
   ======================================== */

/* Prevent zoom on input focus (iOS) */
@media screen and (max-width: 768px) {
    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px !important;
    }
    
    /* Prevent automatic focus and scrolling on mobile */
    input:focus,
    textarea:focus,
    select:focus {
        outline: none !important;
        box-shadow: none !important;
    }
    
    /* Prevent auto-scroll to focused elements */
    .form-control:focus {
        transform: none !important;
        transition: none !important;
    }
    
    /* Disable autofocus behavior on mobile */
    input[autofocus],
    textarea[autofocus] {
        -webkit-user-select: none;
        -moz-user-select: none;
        -ms-user-select: none;
        user-select: none;
    }
    
    /* Improve rating slider interaction on mobile */
    .custom-range {
        -webkit-tap-highlight-color: transparent;
        touch-action: manipulation;
    }
    
    .custom-range:focus {
        outline: none !important;
        box-shadow: none !important;
    }
    
    /* Prevent form elements from stealing focus */
    .form-floating input:focus,
    .form-floating textarea:focus {
        outline: none !important;
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25) !important;
    }
    
    /* Disable smooth scrolling on mobile for better performance */
    html {
        scroll-behavior: auto !important;
    }
    
    /* Prevent rating container from causing scroll issues */
    .rating-container {
        position: relative;
        overflow: visible;
        z-index: 1;
    }
    
    /* Ensure rating sliders don't interfere with form focus */
    .rating-item {
        position: relative;
        z-index: 2;
    }
    
    .custom-range {
        position: relative;
        z-index: 3;
    }
}

/* Better touch targets for mobile */
@media (max-width: 768px) {
    .btn {
        min-height: 44px; /* Apple's recommended minimum touch target */
        min-width: 44px;
    }
    
    .form-control {
        min-height: 44px;
    }
    
    .custom-range {
        min-height: 44px;
    }
    
    /* Improve form validation display on mobile */
    .invalid-feedback {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }
    
    .valid-feedback {
        font-size: 0.8rem;
        margin-top: 0.25rem;
    }
}

/* Enhanced mobile navigation */
@media (max-width: 768px) {
    .navbar-collapse {
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        border-radius: 10px;
        margin-top: 1rem;
        padding: 1rem;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-toggler {
        border: none;
        padding: 0.5rem;
    }
    
    .navbar-toggler:focus {
        box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
    }
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

/* Tablet View */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1rem;
        padding: 0 1rem;
    }
    
    .feedback-card {
        padding: 1.5rem;
        margin: 0 1rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1.1rem;
    }
    
    .rating-item {
        padding: 1rem;
    }
    
    .btn-submit,
    .btn-reset {
        padding: 10px 30px;
        font-size: 0.95rem;
        margin-bottom: 0.5rem;
        width: 100%;
    }
    
    .navbar-text {
        text-align: center;
        margin-top: 0.5rem;
    }
    
    /* Improve form controls on mobile */
    .form-control {
        font-size: 16px; /* Prevents zoom on iOS */
        padding: 0.75rem 1rem;
    }
    
    .form-floating > .form-control {
        padding-top: 1.625rem;
        padding-bottom: 0.625rem;
    }
}

/* Mobile View */
@media (max-width: 576px) {
    body {
        padding-top: 70px;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .hero-title {
        font-size: 1.5rem;
    }
    
    .hero-title i {
        display: block;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
    }
    
    .feedback-card {
        border-radius: 15px;
        padding: 1rem;
        margin: 0 0.5rem;
    }
    
    .form-section {
        margin-bottom: 1.5rem;
        border-radius: 10px;
        padding: 1rem;
    }
    
    .section-title {
        font-size: 1rem;
        margin-bottom: 1rem;
    }
    
    .rating-label {
        font-size: 0.9rem;
    }
    
    .question-number {
        width: 25px;
        height: 25px;
        line-height: 25px;
        font-size: 0.9rem;
    }
    
    /* Enhanced mobile range slider */
    .custom-range {
        height: 8px;
        margin: 1rem 0;
    }
    
    .custom-range::-webkit-slider-thumb {
        width: 24px;
        height: 24px;
        border: 3px solid #667eea;
    }
    
    .custom-range::-moz-range-thumb {
        width: 24px;
        height: 24px;
        border: 3px solid #667eea;
    }
    
    .range-value {
        font-size: 1rem;
        padding: 6px 12px;
        top: -45px;
    }
    
    .range-marks {
        margin-top: 20px;
        font-size: 0.7rem;
    }
    
    .range-marks span {
        padding: 3px 6px;
    }
    
    /* Improve button spacing on mobile */
    .btn-submit,
    .btn-reset {
        padding: 12px 20px;
        font-size: 0.9rem;
        margin-bottom: 0.75rem;
        width: 100%;
    }
    
    .footer {
        padding: 1.5rem 0;
        text-align: center;
    }
    
    .footer .col-md-6:last-child {
        margin-top: 0.5rem;
    }
    
    /* Better form layout on mobile */
    .row.g-3 {
        margin: 0;
    }
    
    .col-md-6,
    .col-md-4,
    .col-md-12 {
        padding: 0 0.5rem;
        margin-bottom: 1rem;
    }
}

/* Extra Small Mobile View */
@media (max-width: 380px) {
    .hero-title {
        font-size: 1.3rem;
    }
    
    .hero-subtitle {
        font-size: 0.85rem;
    }
    
    .feedback-card {
        padding: 0.75rem;
        margin: 0 0.25rem;
    }
    
    .form-section {
        padding: 0.75rem;
    }
    
    .rating-labels {
        font-size: 0.7rem;
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
    
    .rating-min,
    .rating-max {
        justify-content: center;
    }
    
    .btn-submit,
    .btn-reset {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .range-value {
        font-size: 0.9rem;
        padding: 4px 8px;
    }
    
    .emoji-feedback {
        font-size: 2rem;
        top: -70px;
    }
}

/* Print Styles */
@media print {
    body {
        background: white;
    }
    
    .navbar,
    .footer {
        display: none;
    }
    
    .hero-section {
        background: white;
        color: black;
    }
    
    .hero-title,
    .hero-subtitle {
        color: black;
        text-shadow: none;
    }
    
    .feedback-card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
