/* ==========================================================================
   GiftPlanr - Custom Styles
   ========================================================================== */

/* ==========================================================================
   Base Layout & Components
   ========================================================================== */

.gradient-bg {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal.hidden {
    display: none;
}

.modal-content {
    background: white;
    padding: 2rem;
    border-radius: 12px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* ==========================================================================
   Modal Animations
   ========================================================================== */

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

#loadingModal .bg-white {
    animation: modalFadeIn 0.3s ease-out;
}

/* Ensure modal appears above everything */
#loadingModal {
    z-index: 9999;
}

/* Custom bounce animation for dots */
@keyframes customBounce {
    0%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-8px);
    }
}

#loadingModal .animate-bounce {
    animation: customBounce 1.4s infinite;
}

/* ==========================================================================
   People/Dashboard Accordion Styling
   ========================================================================== */

.people-accordion-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.people-accordion-item:nth-child(even) .people-accordion-header {
    background-color: #f8f9fa;
}

.people-accordion-item:nth-child(odd) .people-accordion-header {
    background-color: lightcyan;
}

.people-accordion-header {
    padding: 16px;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    transition: all 0.3s ease;
    font-weight: 500;
}

.people-accordion-header:hover {
    background-color: #e6f3ff !important;
}

.people-accordion-header.active {
    background-color: #e6f3ff !important;
    border-color: #0066c0;
    color: #0066c0;
}

.people-accordion-header:nth-child(even).active {
    background-color: #e3f2fd !important;
}

.people-accordion-header:nth-child(odd).active {
    background-color: #e6f3ff !important;
}

.people-accordion-content {
    display: none;
    padding: 0;
    background-color: white;
    border-top: 1px solid #ddd;
}

.people-accordion-content.active {
    display: block;
}

.person-summary {
    font-size: 0.9rem;
    color: #666;
}

.occasion-badge {
    background-color: #f1f5f9;
    color: #475569;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
}

.inactive-badge {
    background-color: #fee2e2;
    color: #dc2626;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
}

.btn-group button {
    margin-right: 4px;
}

.btn-group button:last-child {
    margin-right: 0;
}

.table-responsive {
    overflow-x: auto;
}

/* ==========================================================================
   Form & Button Styling
   ========================================================================== */

.terms-content {
    max-height: 400px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1rem;
    background: #f9fafb;
}

.hidden {
    display: none !important;
}

/* ==========================================================================
   Loading & Animation States
   ========================================================================== */

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ==========================================================================
   Marketing Components
   ========================================================================== */

.marketing-feature {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 1rem;
    background-color: #eff6ff;
    border-radius: 0.5rem;
    border: 1px solid #bfdbfe;
}

.marketing-feature-icon {
    font-size: 1.5rem;
    color: #2563eb;
    flex-shrink: 0;
}

.marketing-feature-content h4 {
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 0.25rem;
}

.marketing-feature-content p {
    font-size: 0.875rem;
    color: #4b5563;
}

.hero-gradient {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.cta-button {
    background: linear-gradient(to right, #22c55e, #16a34a);
    color: white;
    padding: 1rem 2rem;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1.125rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.cta-button:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    transform: scale(1.05);
}

.feature-card {
    background-color: white;
    border-radius: 0.75rem;
    padding: 1.5rem;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    border: 1px solid #f3f4f6;
    transition: all 0.3s ease;
}

.feature-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* ==========================================================================
   Notifications
   ========================================================================== */

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    z-index: 1100;
    font-weight: 500;
    transform: translateX(100%);
    animation: slideIn 0.3s ease forwards;
}

@keyframes slideIn {
    to { transform: translateX(0); }
}

@keyframes slideOut {
    to { transform: translateX(100%); }
}

.notification.success { background: #10b981; }
.notification.error { background: #ef4444; }
.notification.info { background: #3b82f6; }

/* ==========================================================================
   Hero Section
   ========================================================================== */

.hero-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    padding: 40px;
    margin-bottom: 32px;
    text-align: center;
}

/* ==========================================================================
   Form Elements & Error States
   ========================================================================== */

.form-error {
    border-color: #ef4444 !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1) !important;
}

.error-message {
    color: #ef4444;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin-top: -10px;
    margin-left: -10px;
    border: 2px solid #ffffff;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ==========================================================================
   Mobile Responsive Optimizations
   ========================================================================== */

@media (max-width: 768px) {
    /* Ensure buttons are touch-friendly */
    button[onclick*="findGifts"] {
        font-size: 16px !important;
        min-height: 44px !important;
        touch-action: manipulation;
        -webkit-tap-highlight-color: rgba(0,0,0,0.1);
    }

    /* Make form fields mobile-friendly */
    #age, #gender, #budget, #interests, #occasion, #relationship {
        font-size: 16px !important; /* Prevent iOS zoom */
        min-height: 44px;
        -webkit-appearance: none;
        border-radius: 8px;
    }

    /* Ensure recommendation grid works on mobile */
    #recommendationsGrid {
        display: grid !important;
        grid-template-columns: 1fr !important;
        gap: 1rem;
        padding: 0;
    }

    /* Make recommendation cards touch-friendly */
    #recommendationsGrid > div {
        touch-action: manipulation;
    }

    /* Improve button spacing in cards */
    #recommendationsGrid button,
    #recommendationsGrid a {
        min-height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
    }
}

/* Tablet improvements */
@media (min-width: 769px) and (max-width: 1024px) {
    #recommendationsGrid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Desktop - keep existing grid behavior */
@media (min-width: 1025px) {
    #recommendationsGrid {
        grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)) !important;
    }
}

/* ==========================================================================
   Navigation Tabs Container — overflow fix for 3D hover effects
   ========================================================================== */

.flex.flex-nowrap.gap-2.mb-8.justify-center.overflow-x-auto,
div[class*="flex"][class*="flex-nowrap"][class*="gap-2"][class*="mb-8"][class*="justify-center"][class*="overflow-x-auto"] {
    padding: 0px 10px 0px 10px !important;
    margin-top: 0px !important;
    overflow-y: visible !important;
    overflow-x: auto !important;
    min-height: 100px !important;
}

.max-w-7xl .flex.flex-nowrap {
    padding: 12px 15px 8px 15px !important;
    margin-top: 12px !important;
    margin-bottom: 15px !important;
    min-height: 145px !important;
    overflow-y: visible !important;
    position: relative !important;
}

.max-w-7xl.mx-auto.p-4 {
    padding-top: 2rem !important;
    overflow: visible !important;
}
