/* Index Page Specific Styles - Modern Blue Palette */

/* Hero Section */
.hero-section {
    background: var(--gradient-hero);
    position: relative;
    overflow: hidden;
    padding: 60px 0 80px; /* Reduced top padding since body now has padding-top */
    text-align: center;
    min-height: calc(100vh - 76px); /* Full height minus navbar */
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="gift-pattern" x="0" y="0" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23gift-pattern)"/></svg>') repeat;
    z-index: 1;
    animation: float 20s ease-in-out infinite;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.form-card {
    background: transparent; /* Remove the light blue background */
    border-radius: 25px;
    padding: 3rem;
    backdrop-filter: blur(15px);
    box-shadow: 0 20px 60px rgba(17, 24, 39, 0.1);
    position: relative;
    z-index: 1; /* Ensure proper stacking context */
}

.form-header {
    margin-bottom: 2rem;
}

.form-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

/* Form Controls */
.form-control, .form-select {
    border-radius: 15px;
    border: 2px solid var(--border-color);
    padding: 15px 20px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: var(--background-white);
    color: var(--text-primary);
}

.form-control:focus, .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(0, 171, 228, 0.25);
    background: var(--background-white);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.form-label {
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.8rem;
    font-size: 1.1rem;
}

/* Generate Button */
.generate-btn {
    background: var(--gradient-primary);
    border: none;
    border-radius: 50px;
    padding: 18px 40px;
    font-size: 1.1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    color: white;
    width: 100%;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.generate-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 0.5s;
}

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

.generate-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 30px rgba(0, 140, 195, 0.4);
}

/* Form Help Text */
.form-help-text {
    background: var(--background-light);
    border-radius: 10px;
    padding: 1.5rem;
    border-left: 3px solid var(--primary-color);
    border: 1px solid var(--border-color);
}

.form-help-text small {
    line-height: 1.6;
    color: var(--text-primary);
    font-weight: 500;
}

/* Feature Cards */
.feature-card {
    background: var(--background-light);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    backdrop-filter: blur(15px);
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    text-align: center;
    height: 100%;
}

.feature-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(17, 24, 39, 0.1);
}

.feature-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
}

.feature-title {
    color: var(--text-primary);
    margin-bottom: 1rem;
    font-weight: 600;
    font-size: 1.3rem;
}

.feature-description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Search Features Grid */
.search-features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-top: 3rem;
}

.search-feature-badge {
    background: var(--background-light);
    border-radius: 15px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
}

.search-feature-badge:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(17, 24, 39, 0.1);
}

.search-feature-badge i {
    font-size: 2rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
}

.search-feature-badge span {
    font-weight: 600;
    color: var(--text-primary);
}

/* Search Badges */
.search-badges {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 2rem;
}

.search-badge {
    background: var(--background-light);
    padding: 0.8rem 1.5rem;
    border-radius: 25px;
    font-weight: 500;
    color: var(--text-primary);
    box-shadow: 0 5px 15px rgba(17, 24, 39, 0.1);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.search-badge:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(17, 24, 39, 0.15);
}

/* Gift Icon */
.gift-icon {
    font-size: 4rem;
    background: var(--gradient-secondary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 25px;
    box-shadow: 0 25px 50px rgba(17, 24, 39, 0.1);
    backdrop-filter: blur(20px);
    background: var(--background-light);
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 35px 60px rgba(17, 24, 39, 0.15);
}

.card-header {
    background: var(--gradient-primary);
    color: white;
    padding: 2rem;
    text-align: center;
    border: none;
}

.card-header h2 {
    font-size: 2rem;
    font-weight: 600;
    margin: 0;
}

.card-header .subtitle {
    font-size: 1rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.card-body {
    padding: 3rem;
}

/* Features Section */
.features-section {
    padding: 80px 0;
    background: var(--background-light);
    backdrop-filter: blur(10px);
}

.form-group {
    margin-bottom: 2rem;
}

/* Loading States */
.loading-spinner {
    display: none;
}

.loading .loading-spinner {
    display: inline-block;
}

.loading .btn-text {
    display: none;
}

/* Animations */
@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-10px) rotate(2deg); }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-10px); }
    60% { transform: translateY(-5px); }
}

/* Responsive Design */
@media (max-width: 768px) {
    /* Reduce excessive padding for better space utilization */
    .hero-section {
        padding: 40px 0 40px; /* Reduced since body now has padding-top */
        min-height: calc(100vh - 66px); /* Full height minus mobile navbar */
    }
    
    .form-card {
        padding: 1rem; /* Reduced further for mobile */
        margin: 0; /* Remove margins to use full width */
        border-radius: 10px; /* Smaller radius */
        background: rgba(255, 255, 255, 0.95); /* Subtle white background for mobile readability */
        backdrop-filter: blur(10px);
    }
    
    .hero-section .display-3 {
        font-size: 2.2rem; /* Slightly smaller */
        margin-bottom: 1rem; /* Reduced spacing */
        line-height: 1.2; /* Better line height for mobile */
    }
    
    .hero-title {
        font-size: 2.2rem;
        margin-bottom: 1rem;
        line-height: 1.2;
        margin-top: 1rem; /* Additional top margin for better spacing */
    }
    
    .hero-subtitle {
        font-size: 1.05rem;
        margin-bottom: 2rem; /* Reduced from 3rem */
        line-height: 1.4;
    }
    
    .card-body {
        padding: 1.5rem 1rem; /* Reduced padding */
    }
    
    .card-header {
        padding: 1rem;
    }
    
    .retailers-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 1rem;
    }
    
    /* Better progress bar visibility on mobile */
    #progress-container {
        background: rgba(255, 255, 255, 0.95);
        border-radius: 12px;
        padding: 1rem;
        margin-top: 1rem !important;
        box-shadow: 0 4px 15px rgba(0, 171, 228, 0.15);
        border: 2px solid var(--primary-color);
    }
    
    .progress {
        height: 16px !important; /* Larger on mobile */
        border-radius: 12px !important;
        box-shadow: 0 3px 8px rgba(0,0,0,0.15) !important;
    }
    
    .progress-bar {
        border-radius: 12px !important;
        font-weight: 600;
        font-size: 0.75rem;
        line-height: 16px;
    }
    
    #progress-status {
        font-size: 1rem !important; /* Larger text */
        font-weight: 600;
    }
    
    .progress-main {
        font-size: 1.1rem !important;
        margin-bottom: 0.5rem !important;
    }
    
    .progress-tip {
        font-size: 0.9rem !important;
    }
    
    /* More conspicuous generate button */
    .generate-btn {
        font-size: 1.1rem !important;
        padding: 0.875rem 2rem !important;
        border-radius: 25px !important;
        box-shadow: 0 6px 20px rgba(0, 171, 228, 0.3) !important;
        border: 3px solid var(--primary-hover) !important;
    }
    
    .generate-btn:hover {
        transform: translateY(-3px) !important;
        box-shadow: 0 8px 25px rgba(0, 171, 228, 0.4) !important;
    }
}

/* Form Check Icons */
.form-check-icon {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.2rem;
    z-index: 10;
    opacity: 0;
    transition: all 0.3s ease;
}

.form-check-icon.show {
    opacity: 1;
    animation: checkmarkBounce 0.5s ease-out;
}

.field-checkmark {
    opacity: 0;
    transition: all 0.3s ease;
}

.field-checkmark.show {
    opacity: 1;
    animation: checkmarkBounce 0.5s ease-out;
}

@keyframes checkmarkBounce {
    0% {
        transform: translateY(-50%) scale(0);
    }
    60% {
        transform: translateY(-50%) scale(1.2);
    }
    100% {
        transform: translateY(-50%) scale(1);
    }
}

/* Enhanced Progress Indicator Styles */
#progress-container {
    margin-top: 1.5rem !important;
    padding: 0.75rem;
    background: linear-gradient(135deg, rgba(0, 171, 228, 0.15), rgba(0, 140, 195, 0.1));
    border-radius: 20px;
    border: 3px solid rgba(0, 171, 228, 0.4);
    box-shadow: 0 15px 40px rgba(0, 171, 228, 0.3), 0 0 20px rgba(0, 171, 228, 0.2);
    animation: progressContainerPulse 2s ease-in-out infinite;
    position: relative;
}

/* Force progress container visibility when needed */
#progress-container.d-block {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Ensure progress container overrides Bootstrap's d-none */
#progress-container:not(.d-none) {
    display: block !important;
}

#progress-container::before {
    content: '';
    position: absolute;
    top: -3px;
    left: -3px;
    right: -3px;
    bottom: -3px;
    background: linear-gradient(45deg, #00ABE4, #008CC3, #00ABE4);
    border-radius: 23px;
    z-index: -1;
    animation: progressGlow 3s linear infinite;
}

@keyframes progressContainerPulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 15px 40px rgba(0, 171, 228, 0.3), 0 0 20px rgba(0, 171, 228, 0.2);
    }
    50% {
        transform: scale(1.02);
        box-shadow: 0 20px 50px rgba(0, 171, 228, 0.4), 0 0 30px rgba(0, 171, 228, 0.3);
    }
}

@keyframes progressGlow {
    0% {
        background: linear-gradient(45deg, #00ABE4, #008CC3, #00ABE4);
    }
    33% {
        background: linear-gradient(45deg, #008CC3, #0066FF, #008CC3);
    }
    66% {
        background: linear-gradient(45deg, #0066FF, #00ABE4, #0066FF);
    }
    100% {
        background: linear-gradient(45deg, #00ABE4, #008CC3, #00ABE4);
    }
}

.progress-wrapper {
    background: rgba(255, 255, 255, 0.98);
    padding: 2rem;
    border-radius: 16px;
    border: 1px solid rgba(0, 171, 228, 0.3);
    box-shadow: 0 12px 35px rgba(0, 171, 228, 0.25);
    animation: slideInUp 0.5s ease-out;
    backdrop-filter: blur(15px);
    position: relative;
    overflow: hidden;
}

.progress-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(0, 171, 228, 0.1), transparent);
    animation: progressShine 3s infinite;
}

.progress {
    background-color: rgba(0, 171, 228, 0.1);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    background: linear-gradient(45deg, #00ABE4, #008CC3) !important;
    transition: width 0.8s ease-in-out;
    position: relative;
    overflow: hidden;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    background: linear-gradient(
        45deg,
        transparent 35%,
        rgba(255, 255, 255, 0.3) 50%,
        transparent 65%
    );
    animation: shimmer 2s infinite;
}

#progress-status {
    font-weight: 500;
    color: #374151 !important;
    position: relative;
    z-index: 2;
}

#progress-status .progress-main {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

#progress-status .progress-tip {
    color: #6B7280 !important;
    font-style: italic;
    font-weight: 400;
}

#progress-status i {
    color: #00ABE4;
    margin-right: 0.5rem;
    animation: pulse 2s infinite;
}

#motivational-message {
    font-weight: 500;
    animation: fadeInOut 4s infinite;
    position: relative;
    z-index: 2;
}

#time-remaining {
    font-weight: 600;
    color: #00ABE4;
    font-family: 'Monaco', 'Menlo', monospace;
}

/* Loading state form styling */
.gift-form.loading {
    opacity: 0.7;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.generate-btn:disabled {
    opacity: 0.8;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

.generate-btn:not(:disabled) {
    transition: all 0.3s ease;
}

/* Progress animations */
@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shimmer {
    0% {
        transform: translateX(-100%);
    }
    100% {
        transform: translateX(100%);
    }
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.7;
    }
}

@keyframes progressShine {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

@keyframes fadeInOut {
    0%, 100% {
        opacity: 0.8;
    }
    50% {
        opacity: 1;
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Prevent form interaction during loading */
.gift-form.loading input,
.gift-form.loading select,
.gift-form.loading textarea {
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.gift-form.loading .form-control:focus,
.gift-form.loading .form-select:focus {
    border-color: var(--border-color);
    box-shadow: none;
}

/* Enhanced button loading state */
.generate-btn:disabled {
    cursor: not-allowed !important;
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 171, 228, 0.2) !important;
    background: linear-gradient(135deg, #6B7280, #9CA3AF) !important;
    pointer-events: none !important;
    opacity: 0.8;
}

.generate-btn:disabled:hover {
    transform: none !important;
    box-shadow: 0 4px 12px rgba(0, 171, 228, 0.2) !important;
}

.generate-btn:disabled .btn-loading {
    color: white;
}

/* Prevent any interactions when form is loading */
.gift-form.loading {
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.gift-form.loading * {
    pointer-events: none !important;
}

/* Progress completion state */
.progress-complete {
    background: linear-gradient(135deg, #10B981, #059669) !important;
    animation: completePulse 0.5s ease-out;
}

@keyframes completePulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        transform: scale(1);
    }
}

/* Archetype Selection Cards */
.archetype-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2; /* Ensure grid is above any backdrop filters */
}

.archetype-card {
    background: var(--background-light);
    border: 2px solid var(--border-color);
    border-radius: 20px;
    padding: 1.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    z-index: 2; /* Ensure cards are above form background */
    pointer-events: auto; /* Ensure clicks work */
}

.archetype-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0, 171, 228, 0.2);
    border-color: var(--primary-color);
}

.archetype-card.selected {
    border-color: var(--primary-color);
    background: linear-gradient(135deg, rgba(0, 171, 228, 0.1), rgba(0, 140, 195, 0.05));
    box-shadow: 0 10px 30px rgba(0, 171, 228, 0.3);
}

.archetype-card.selected::before {
    content: '✓';
    position: absolute;
    top: 10px;
    right: 15px;
    background: var(--primary-color);
    color: white;
    width: 25px;
    height: 25px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 14px;
}

.archetype-icon {
    font-size: 3rem;
    margin-bottom: 0.5rem;
    display: block;
    line-height: 1;
}

.archetype-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.archetype-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

/* Responsive archetype grid */
@media (max-width: 768px) {
    .archetype-grid {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }
    
    .archetype-card {
        padding: 1.25rem;
    }
    
    .archetype-icon {
        font-size: 2.5rem;
    }
    
    .archetype-title {
        font-size: 1rem;
    }
    
    .archetype-description {
        font-size: 0.85rem;
    }
}

@media (min-width: 768px) and (max-width: 1024px) {
    .archetype-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .archetype-card {
        padding: 1.3rem;
    }
}

/* Accessibility improvements for progress */
@media (prefers-reduced-motion: reduce) {
    .progress-wrapper,
    #progress-status,
    #motivational-message,
    .progress-bar {
        animation: none !important;
    }
    
    .progress-wrapper::before {
        display: none;
    }
    
    .archetype-card:hover {
        transform: none;
    }
}
