/* Mobile LCP & CLS Optimizations for Tour Package Detail Page */

/* Critical Mobile Optimizations */
@media (max-width: 768px) {
    /* LCP Optimizations */
    
    /* 1. Hero Section - Critical Above-the-fold */
    .hero-section {
        min-height: 250px; /* Prevent layout shift */
        padding: 40px 0;
        background: linear-gradient(135deg, #2563eb 0%, #7c3aed 100%);
        color: white;
        text-align: center;
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .hero-title {
        font-size: 1.8rem; /* Smaller for mobile */
        font-weight: 700;
        margin-bottom: 15px;
        line-height: 1.2;
        color: white; /* Ensure white text */
        text-shadow: 0 2px 4px rgba(0,0,0,0.3); /* Add shadow for better contrast */
    }
    
    .hero-subtitle {
        font-size: 1rem;
        opacity: 0.95; /* Increased opacity for better visibility */
        margin-bottom: 20px;
        line-height: 1.4;
        color: white; /* Ensure white text */
        text-shadow: 0 1px 2px rgba(0,0,0,0.2); /* Add subtle shadow */
    }
    
    .hero-meta {
        flex-direction: column;
        gap: 12px;
        font-size: 0.9rem;
    }
    
    .hero-meta-item {
        justify-content: center;
        color: white; /* Ensure white text */
        text-shadow: 0 1px 2px rgba(0,0,0,0.2); /* Add subtle shadow */
    }
    
    .hero-meta-item i {
        color: #fbbf24; /* Golden yellow for better contrast */
        margin-right: 8px;
    }
    
    .hero-meta-item span {
        color: white; /* Ensure white text */
        font-weight: 500; /* Slightly bolder for better readability */
    }
    
    /* 2. Package Image - Fixed Aspect Ratio */
    .package-image {
        aspect-ratio: 16/9; /* Fixed aspect ratio */
        height: auto;
        overflow: hidden;
        position: relative;
    }
    
    .package-image img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        display: block; /* Remove inline spacing */
    }
    
    /* 3. Package Overview - Mobile Layout */
    .package-overview {
        margin: 20px 0;
        border-radius: 12px;
    }
    
    .overview-header {
        padding: 20px;
        text-align: center;
    }
    
    .overview-title {
        font-size: 1.5rem;
        margin-bottom: 10px;
        color: #1f2937; /* Dark text for better readability */
    }
    
    .overview-subtitle {
        font-size: 0.9rem;
        margin-bottom: 20px;
        color: #6b7280; /* Medium gray for subtitle */
    }
    
    .overview-grid {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 20px 20px;
    }
    
    .overview-card {
        padding: 15px;
        border-radius: 8px;
        background: white;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    }
    
    .overview-card h4 {
        font-size: 1rem;
        margin-bottom: 8px;
        color: #1f2937; /* Dark text */
    }
    
    .overview-card h4 i {
        color: #2563eb; /* Blue icon */
        margin-right: 8px;
    }
    
    .overview-card p {
        font-size: 0.9rem;
        line-height: 1.4;
        color: #6b7280; /* Medium gray text */
    }
    
    /* 4. Price Section - Mobile Optimized */
    .price-section {
        padding: 20px;
        text-align: center;
        background: linear-gradient(135deg, #10b981 0%, #059669 100%);
        color: white;
    }
    
    .price-original {
        font-size: 1.2rem;
        margin-bottom: 5px;
        color: rgba(255,255,255,0.8); /* Slightly transparent white */
        text-decoration: line-through;
    }
    
    .price-current {
        font-size: 2.5rem;
        margin-bottom: 5px;
        color: white;
        font-weight: 800;
        text-shadow: 0 2px 4px rgba(0,0,0,0.2);
    }
    
    .price-per-person {
        font-size: 1rem;
        color: rgba(255,255,255,0.9);
    }
    
    /* 5. Main Content - Single Column Layout */
    .main-content {
        margin-top: 20px;
    }
    
    .content-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    /* 6. Package Details - Mobile Spacing */
    .package-details {
        padding: 0;
    }
    
    .detail-section {
        background: white;
        border-radius: 12px;
        padding: 20px;
        margin-bottom: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .detail-section h3 {
        font-size: 1.3rem;
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        gap: 10px;
        color: #1f2937; /* Dark text */
    }
    
    .detail-section h3 i {
        color: #2563eb;
    }
    
    /* 7. Itinerary Timeline - Mobile Layout */
    .itinerary-timeline {
        gap: 20px;
    }
    
    .timeline-item {
        flex-direction: column;
        gap: 15px;
    }
    
    .timeline-marker {
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: #2563eb;
        color: white;
        display: flex;
        align-items: center;
        justify-content: center;
        font-weight: 600;
        margin: 0 auto;
        box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    }
    
    .timeline-content {
        text-align: center;
    }
    
    .timeline-content h4 {
        font-size: 1.1rem;
        margin-bottom: 8px;
        color: #1f2937; /* Dark text */
    }
    
    .timeline-content p {
        font-size: 0.9rem;
        line-height: 1.5;
        color: #6b7280; /* Medium gray text */
    }
    
    /* 8. Inclusions/Exclusions - Mobile Grid */
    .inclusions-grid,
    .exclusions-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .inclusion-item,
    .exclusion-item {
        padding: 12px;
        border-radius: 8px;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.9rem;
        background: #f9fafb; /* Light background */
    }
    
    .inclusion-item i {
        color: #10b981; /* Green for inclusions */
    }
    
    .inclusion-item span {
        color: #1f2937; /* Dark text */
    }
    
    .exclusion-item i {
        color: #ef4444; /* Red for exclusions */
    }
    
    .exclusion-item span {
        color: #1f2937; /* Dark text */
    }
    
    /* 9. Booking Section - Mobile Layout */
    .booking-section {
        position: static;
        margin-top: 20px;
    }
    
    .booking-form {
        background: white;
        border-radius: 12px;
        padding: 15px; /* Reduced from 20px */
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .booking-header {
        text-align: center;
        margin-bottom: 15px; /* Reduced from 20px */
    }
    
    .booking-header h3 {
        font-size: 1.2rem; /* Reduced from 1.3rem */
        margin-bottom: 5px; /* Reduced from 8px */
        color: #1f2937; /* Dark text */
    }
    
    .booking-header p {
        font-size: 0.85rem; /* Reduced from 0.9rem */
        color: #6b7280; /* Medium gray */
        margin-bottom: 0;
    }
    
    /* 10. Form Elements - Mobile Optimized */
    .form-group {
        margin-bottom: 10px; /* Reduced from 12px */
    }
    
    .form-group label {
        font-size: 0.85rem; /* Reduced from 0.9rem */
        font-weight: 600;
        margin-bottom: 3px; /* Reduced from 5px */
        display: block;
        color: #1f2937; /* Dark text */
    }
    
    .form-control {
        width: 100%;
        padding: 10px; /* Reduced from 12px */
        border: 1px solid #d1d5db;
        border-radius: 8px;
        font-size: 0.9rem;
        color: #1f2937; /* Dark text */
        background: white;
    }
    
    .form-control:focus {
        border-color: #2563eb;
        box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
        outline: none;
    }
    
    /* Compact form layout */
    .form-row {
        grid-template-columns: 1fr;
        gap: 8px; /* Reduced from 10px */
    }
    
    /* Adults and Children in one row */
    .form-row-compact {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
        margin-bottom: 10px;
    }
    
    .form-row-compact .form-group {
        margin-bottom: 0;
    }
    
    /* Compact input with label inline */
    .form-group-compact {
        margin-bottom: 8px; /* Reduced spacing */
    }
    
    .form-group-compact label {
        font-size: 0.8rem;
        font-weight: 600;
        margin-bottom: 2px;
        color: #1f2937;
    }
    
    .form-group-compact .form-control {
        padding: 8px 10px; /* Slightly reduced padding */
        font-size: 0.85rem;
    }
    
    /* Special requests textarea */
    .form-group textarea.form-control {
        min-height: 80px; /* Reduced from default */
        resize: vertical;
    }
    
    .btn-book {
        width: 100%;
        padding: 12px; /* Reduced from 15px */
        font-size: 0.95rem; /* Reduced from 1rem */
        font-weight: 600;
        border-radius: 8px;
        margin-top: 15px; /* Reduced from 20px */
        background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
        color: white;
        border: none;
        box-shadow: 0 4px 8px rgba(37, 99, 235, 0.3);
    }
    
    .btn-book:hover {
        background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
        transform: translateY(-1px);
        box-shadow: 0 6px 12px rgba(37, 99, 235, 0.4);
    }
    
    /* 11. Contact Info - Mobile Layout */
    .contact-info {
        margin-top: 20px;
        background: white;
        border-radius: 12px;
        padding: 20px;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    .contact-header {
        font-size: 1.1rem;
        font-weight: 600;
        margin-bottom: 15px;
        display: flex;
        align-items: center;
        gap: 10px;
        color: #1f2937; /* Dark text */
    }
    
    .contact-item {
        padding: 10px 0;
        display: flex;
        align-items: center;
        gap: 10px;
        font-size: 0.9rem;
    }
    
    .contact-item i {
        color: #2563eb; /* Blue icon */
    }
    
    .contact-item span,
    .contact-item a {
        color: #1f2937; /* Dark text */
        text-decoration: none;
    }
    
    .contact-item a:hover {
        color: #2563eb;
    }
    
    /* 12. Related Packages - Mobile Grid */
    .related-packages {
        padding: 40px 0;
        background: #f9fafb; /* Light background */
    }
    
    .related-packages h2 {
        font-size: 1.5rem;
        margin-bottom: 30px;
        color: #1f2937; /* Dark text */
    }
    
    .related-packages .card {
        margin-bottom: 20px;
        background: white;
    }
    
    .related-packages .card-img-top {
        height: 180px;
    }
    
    .related-packages .card-body {
        padding: 15px;
    }
    
    .related-packages .card-title {
        font-size: 1rem;
        margin-bottom: 8px;
        color: #1f2937; /* Dark text */
    }
    
    .related-packages .card-title a {
        font-size: 1rem;
        color: #1f2937; /* Dark text */
        text-decoration: none;
    }
    
    .related-packages .card-title a:hover {
        color: #2563eb;
    }
}

/* Additional Mobile Optimizations */
@media (max-width: 480px) {
    .hero-title {
        font-size: 1.5rem;
        color: white;
        text-shadow: 0 2px 4px rgba(0,0,0,0.4);
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        color: white;
        text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    }
    
    .hero-meta {
        font-size: 0.8rem;
    }
    
    .hero-meta-item {
        color: white;
        text-shadow: 0 1px 2px rgba(0,0,0,0.3);
    }
    
    .package-image {
        aspect-ratio: 4/3;
    }
    
    .overview-title {
        font-size: 1.3rem;
        color: #1f2937;
    }
    
    .price-current {
        font-size: 2rem;
        color: white;
    }
    
    .detail-section h3 {
        font-size: 1.2rem;
        color: #1f2937;
    }
    
    .timeline-content h4 {
        font-size: 1rem;
        color: #1f2937;
    }
    
    .booking-header h3 {
        font-size: 1.2rem;
        color: #1f2937;
    }
    
    .form-control {
        padding: 10px;
        font-size: 0.85rem;
        color: #1f2937;
    }
    
    .btn-book {
        padding: 12px;
        font-size: 0.9rem;
        color: white;
    }
}

/* Loading States - Prevent CLS */
.loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Touch Optimizations */
@media (hover: none) and (pointer: coarse) {
    .btn-book,
    .form-control,
    .inclusion-item,
    .exclusion-item {
        min-height: 44px; /* Minimum touch target */
    }
    
    .timeline-marker {
        min-width: 44px;
        min-height: 44px;
    }
}

/* Mobile App-Style Package Enquiry Form */

/* App-Style Form Container */
.booking-form {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    padding: 0;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    overflow: hidden;
    position: relative;
}

.booking-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4);
    background-size: 400% 100%;
    animation: rainbow 3s ease-in-out infinite;
}

@keyframes rainbow {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* App-Style Header */
.booking-header {
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
    padding: 25px 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255,255,255,0.2);
    position: relative;
}

.booking-header h3 {
    font-size: 1.4rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #2d3748;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.booking-header p {
    font-size: 0.9rem;
    color: #718096;
    margin-bottom: 0;
    font-weight: 500;
}

/* App-Style Form Body */
.booking-body {
    padding: 25px 20px;
    background: white;
}

/* App-Style Form Groups */
.form-group-compact {
    margin-bottom: 20px;
    position: relative;
}

.form-group-compact label {
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 8px;
    display: block;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* App-Style Input Fields */
.form-group-compact .form-control {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 15px;
    font-size: 1rem;
    color: #2d3748;
    background: #f8fafc;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 500;
}

.form-group-compact .form-control:focus {
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
    outline: none;
    transform: translateY(-2px);
}

.form-group-compact .form-control::placeholder {
    color: #a0aec0;
    font-weight: 400;
}

/* App-Style Row Layouts */
.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.form-row-compact {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 20px;
}

/* App-Style Textarea */
.form-group-compact textarea.form-control {
    min-height: 100px;
    resize: vertical;
    font-family: inherit;
    line-height: 1.5;
}

/* App-Style Submit Button */
.btn-book {
    width: 100%;
    padding: 18px 24px;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 15px;
    margin-top: 25px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.3);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-book::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.btn-book:hover::before {
    left: 100%;
}

.btn-book:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(102, 126, 234, 0.4);
}

.btn-book:active {
    transform: translateY(-1px);
}

/* App-Style Loading State */
.btn-book.loading {
    background: linear-gradient(135deg, #a0aec0, #718096);
    pointer-events: none;
}

.btn-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* App-Style Contact Info */
.contact-info {
    margin-top: 25px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 15px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid rgba(102, 126, 234, 0.1);
}

.contact-header {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.contact-header i {
    color: #667eea;
    font-size: 1.2rem;
}

.contact-item {
    padding: 12px 0;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
}

.contact-item:last-child {
    border-bottom: none;
}

.contact-item i {
    color: #667eea;
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.contact-item span,
.contact-item a {
    color: #4a5568;
    text-decoration: none;
    font-weight: 500;
}

.contact-item a:hover {
    color: #667eea;
}

/* App-Style Form Validation */
.form-control.is-invalid {
    border-color: #e53e3e;
    background: #fed7d7;
    box-shadow: 0 0 0 4px rgba(229, 62, 62, 0.1);
}

.invalid-feedback {
    color: #e53e3e;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.invalid-feedback::before {
    content: '⚠️';
    font-size: 0.8rem;
}

/* App-Style Success Animation */
.form-group-compact .form-control:valid {
    border-color: #48bb78;
    background: #f0fff4;
}

/* App-Style Floating Labels (Optional Enhancement) */
.form-group-compact.floating-label {
    position: relative;
}

.form-group-compact.floating-label label {
    position: absolute;
    top: 16px;
    left: 20px;
    font-size: 1rem;
    color: #a0aec0;
    transition: all 0.3s ease;
    pointer-events: none;
    background: white;
    padding: 0 5px;
}

.form-group-compact.floating-label .form-control:focus + label,
.form-group-compact.floating-label .form-control:not(:placeholder-shown) + label {
    top: -8px;
    font-size: 0.75rem;
    color: #667eea;
    font-weight: 700;
}

/* App-Style Input Icons */
.form-group-compact {
    position: relative;
}

.form-group-compact .input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #a0aec0;
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-group-compact .form-control:focus + .input-icon {
    color: #667eea;
}

/* App-Style Progress Indicator */
.form-progress {
    display: flex;
    justify-content: space-between;
    margin-bottom: 25px;
    padding: 0 10px;
}

.progress-step {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #e2e8f0;
    transition: all 0.3s ease;
}

.progress-step.active {
    background: #667eea;
    transform: scale(1.2);
}

.progress-step.completed {
    background: #48bb78;
}

/* Responsive Adjustments */
@media (max-width: 480px) {
    .booking-form {
        border-radius: 15px;
        margin: 0 10px;
    }
    
    .booking-header {
        padding: 20px 15px;
    }
    
    .booking-body {
        padding: 20px 15px;
    }
    
    .form-group-compact .form-control {
        padding: 14px 16px;
        font-size: 0.95rem;
    }
    
    .btn-book {
        padding: 16px 20px;
        font-size: 1rem;
    }
    
    .form-row-compact {
        grid-template-columns: 1fr;
        gap: 15px;
    }
}

/* App-Style Micro-interactions */
.form-group-compact .form-control:hover {
    border-color: #cbd5e0;
    background: #f7fafc;
}

.form-group-compact .form-control:focus {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* App-Style Focus States */
.form-group-compact:focus-within label {
    color: #667eea;
    transform: translateY(-2px);
}

/* App-Style Error States */
.form-group-compact.error .form-control {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* Floating Label Input Design (Similar to Image) */

/* Floating Label Container */
.form-group-floating {
    position: relative;
    margin-bottom: 15px;
}

/* Floating Label */
.form-group-floating label {
    position: absolute;
    top: 12px;
    left: 16px;
    font-size: 1rem;
    color: #60a5fa; /* Light blue color */
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    background: white;
    padding: 0 8px;
    border-radius: 4px;
    z-index: 2;
}

/* Input Field */
.form-group-floating .form-control {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e7ff; /* Light blue border */
    border-radius: 12px;
    font-size: 1rem;
    color: #1e293b;
    background: white;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(96, 165, 250, 0.1);
}

/* Focus State */
.form-group-floating .form-control:focus {
    outline: none;
    border-color: #60a5fa;
    box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1);
    transform: translateY(-2px);
}

/* Floating Label Animation */
.form-group-floating .form-control:focus + label,
.form-group-floating .form-control:not(:placeholder-shown) + label {
    top: -8px;
    font-size: 0.85rem;
    color: #3b82f6; /* Darker blue when focused */
    font-weight: 600;
    background: white;
    box-shadow: 0 2px 4px rgba(96, 165, 250, 0.1);
}

/* Placeholder */
.form-group-floating .form-control::placeholder {
    color: transparent;
    transition: color 0.3s ease;
}

.form-group-floating .form-control:focus::placeholder {
    color: #94a3b8;
}

/* Hover State */
.form-group-floating .form-control:hover {
    border-color: #93c5fd;
    box-shadow: 0 4px 8px rgba(96, 165, 250, 0.15);
}

/* Error State */
.form-group-floating .form-control.is-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-group-floating .form-control.is-invalid + label {
    color: #ef4444;
}

/* Success State */
.form-group-floating .form-control.is-valid {
    border-color: #10b981;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.form-group-floating .form-control.is-valid + label {
    color: #10b981;
}

/* Textarea Specific Styles */
.form-group-floating textarea.form-control {
    min-height: 120px;
    resize: vertical;
    line-height: 1.5;
}

.form-group-floating textarea.form-control + label {
    top: 16px;
}

.form-group-floating textarea.form-control:focus + label,
.form-group-floating textarea.form-control:not(:placeholder-shown) + label {
    top: -8px;
}

/* Input Icons with Floating Labels */
.form-group-floating .input-icon {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: #60a5fa;
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.3s ease;
    z-index: 3;
}

.form-group-floating .form-control:focus + label + .input-icon,
.form-group-floating .form-control:focus ~ .input-icon {
    color: #3b82f6;
}

/* Textarea Icon Positioning */
.form-group-floating textarea.form-control ~ .input-icon {
    top: 16px;
    transform: none;
}

/* Row Layouts with Floating Labels */
.form-row-floating {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-bottom: 15px;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .form-row-floating {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .form-group-floating .form-control {
        padding: 10px 14px;
        font-size: 0.95rem;
    }
    
    .form-group-floating label {
        font-size: 0.95rem;
        top: 10px;
        left: 14px;
    }
    
    .form-group-floating .form-control:focus + label,
    .form-group-floating .form-control:not(:placeholder-shown) + label {
        font-size: 0.8rem;
        top: -6px;
    }
}

@media (max-width: 480px) {
    .form-group-floating .form-control {
        padding: 8px 12px;
        font-size: 0.9rem;
    }
    
    .form-group-floating label {
        font-size: 0.9rem;
        top: 8px;
        left: 12px;
    }
    
    .form-group-floating .form-control:focus + label,
    .form-group-floating .form-control:not(:placeholder-shown) + label {
        font-size: 0.75rem;
        top: -5px;
    }
}

/* Animation Enhancements */
.form-group-floating .form-control:focus {
    animation: inputFocus 0.3s ease;
}

@keyframes inputFocus {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Label Animation */
.form-group-floating label {
    transform-origin: left center;
}

.form-group-floating .form-control:focus + label,
.form-group-floating .form-control:not(:placeholder-shown) + label {
    transform: scale(0.9) translateY(-2px);
}

/* Micro-interactions */
.form-group-floating .form-control:hover + label {
    color: #3b82f6;
}

/* Focus Ring Animation */
.form-group-floating .form-control:focus {
    animation: focusRing 0.3s ease;
}

@keyframes focusRing {
    0% { box-shadow: 0 0 0 0 rgba(96, 165, 250, 0.1); }
    100% { box-shadow: 0 0 0 4px rgba(96, 165, 250, 0.1); }
}
