/* Base Styles */
html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #f9fafb; /* bg-gray-50 */
    min-height: 100vh; /* Ensure body takes full viewport height */
    display: flex;
    flex-direction: column;
    margin: 0; /* Reset default margin */
}

/* Ensure main content is visible */
main {
    flex: 1; /* Allow main content to grow and fill space */
    display: block; /* Ensure main content is not hidden */
    position: relative; /* Prevent z-index overlap */
    z-index: 1; /* Ensure content is above any background layers */
}

/* Typography */
h1, h2, h3 {
    font-family: 'Playfair Display', serif;
    color: #1f2937; /* text-gray-900 */
}

p, a, span, li, label, input, button {
    font-family: 'Poppins', sans-serif;
    color: #374151; /* text-gray-700 */
}

/* Hero Section */
.hero-section {
    background: linear-gradient(rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.7)), linear-gradient(to right, #2563eb, #7c3aed);
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: #ffffff;
    position: relative;
    z-index: 1; /* Ensure hero is not overlapped */
    min-height: 300px; /* Prevent collapse */
    display: block; /* Ensure visibility */
}

@media (max-width: 640px) {
    .hero-section h1 {
        font-size: 2.25rem;
    }

    .hero-section p {
        font-size: 1rem;
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .hero-section h1 {
        font-size: 3rem;
    }

    .hero-section p {
        font-size: 1.125rem;
    }
}

/* Section Styles */
section {
    display: block; /* Ensure sections are visible */
    position: relative;
    z-index: 1;
    padding: 4rem 1rem; /* Consistent padding */
}

/* Card Styles */
.conference-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    background-color: #ffffff; /* Ensure cards have visible background */
    display: block;
}

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

.conference-card img {
    width: 100%;
    height: 12rem;
    object-fit: cover;
}

/* Form Styles */
form {
    max-width: 100%;
    width: 100%;
    display: block; /* Ensure form is visible */
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="date"],
input[type="number"],
input[type="file"] {
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    font-size: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    width: 100%;
    box-sizing: border-box;
    background-color: #ffffff; /* Ensure inputs are visible */
    color: #374151;
}

input:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

input[type="radio"] {
    accent-color: #2563eb;
    width: 1.25rem;
    height: 1.25rem;
    margin-right: 0.5rem;
}

input[type="radio"]:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

label {
    font-weight: 500;
    color: #374151;
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    display: block;
}

button[type="submit"] {
    transition: background-color 0.3s ease, transform 0.2s ease;
    padding: 0.75rem;
    font-size: 1rem;
    border-radius: 0.5rem;
    width: 100%;
    background-color: #2563eb; /* bg-blue-600 */
    color: #ffffff;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    background-color: #1e40af; /* bg-blue-700 */
}

button[type="submit"]:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Radio Button Groups */
.radio-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    font-size: 0.875rem;
}

/* Payment Section */
#paypal-button-container,
#card-element {
    min-height: 40px;
    width: 100%;
    background-color: #f3f4f6; /* bg-gray-50 */
}

#paypal-button-container:empty::before {
    content: "Loading PayPal...";
    display: block;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
}

#card-element {
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    padding: 0.75rem;
}

/* Notification Styles */
.bg-red-100 {
    background-color: #fee2e2;
    color: #991b1b;
    padding: 1rem;
    border-radius: 0.5rem;
    display: block;
}

.bg-green-100 {
    background-color: #d1fae5;
    color: #065f46;
    padding: 1rem;
    border-radius: 0.5rem;
    display: block;
}

.bg-yellow-100 {
    background-color: #fef9c3;
    color: #854d0e;
    padding: 1rem;
    border-radius: 0.5rem;
    display: block;
}

.bg-green-500 {
    background-color: #10b981;
    color: #ffffff;
    padding: 1rem;
    border-radius: 0.5rem;
    display: block;
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 50;
}

nav a {
    transition: color 0.3s ease;
}

nav a:hover {
    color: #2563eb;
}

nav a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Mobile Menu */
.mobile-menu {
    transition: max-height 0.3s ease-in-out, opacity 0.3s ease-in-out;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    z-index: 49; /* Below nav but above content */
}

.mobile-menu.active {
    max-height: 500px;
    opacity: 1;
}

.mobile-menu a {
    transition: background-color 0.3s ease, color 0.3s ease;
    padding: 0.75rem 1rem;
    display: block;
}

.mobile-menu a:hover {
    background-color: #f3f4f6;
    color: #2563eb;
}

/* Footer */
footer {
    z-index: 1; /* Ensure footer is not overlapped */
}

footer .grid {
    display: grid;
    gap: 3rem;
}

footer a {
    transition: color 0.3s ease;
}

footer a:hover {
    color: #ffffff;
}

footer a:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* Feather Icons */
[data-feather] {
    width: 1.25rem;
    height: 1.25rem;
    vertical-align: middle;
}

/* Accessibility Improvements */
a:focus, button:focus, input:focus {
    outline: 2px solid #2563eb;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .bg-blue-600 {
        background-color: #1e40af;
    }

    .bg-purple-600 {
        background-color: #6d28d9;
    }

    .text-gray-700 {
        color: #1f2937;
    }

    .text-gray-600 {
        color: #374151;
    }

    .bg-gray-50 {
        background-color: #ffffff;
    }

    .hero-section {
        background: #1e40af; /* Solid color fallback for high contrast */
    }
}

/* Reduced Motion Preference */
@media (prefers-reduced-motion: reduce) {
    .conference-card:hover {
        transform: none;
    }

    [data-aos] {
        transition: none !important;
        opacity: 1 !important; /* Ensure AOS elements are visible */
        transform: none !important;
    }

    .mobile-menu {
        transition: none;
    }

    button[type="submit"]:hover {
        transform: none;
    }
}

/* Responsive Form Layouts */
@media (max-width: 640px) {
    .grid.md\:grid-cols-2 {
        grid-template-columns: 1fr;
    }

    .radio-group {
        flex-direction: column;
        gap: 0.5rem;
    }

    .radio-group label {
        font-size: 0.875rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    input[type="file"] {
        font-size: 0.875rem;
        padding: 0.5rem;
    }

    button[type="submit"] {
        font-size: 0.875rem;
        padding: 0.5rem;
    }

    label {
        font-size: 0.75rem;
    }

    section {
        padding: 2rem 0.5rem; /* Reduced padding for mobile */
    }
}

@media (min-width: 641px) and (max-width: 768px) {
    .grid.md\:grid-cols-2 {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .radio-group {
        flex-direction: row;
        gap: 0.75rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    input[type="file"] {
        font-size: 0.875rem;
        padding: 0.75rem;
    }

    button[type="submit"] {
        font-size: 0.875rem;
        padding: 0.75rem;
    }

    section {
        padding: 3rem 1rem;
    }
}

@media (max-width: 768px) {
    footer .grid {
        grid-template-columns: 1fr;
    }

    #paypal-button-container,
    #card-element {
        width: 100%;
    }

    .grid.md\:grid-cols-2 {
        grid-template-columns: 1fr;
    }
}

@media (min-width: 769px) {
    .radio-group {
        gap: 1.5rem;
    }

    input[type="text"],
    input[type="email"],
    input[type="tel"],
    input[type="date"],
    input[type="number"],
    input[type="file"] {
        font-size: 1rem;
        padding: 0.75rem;
    }

    button[type="submit"] {
        font-size: 1rem;
        padding: 0.75rem;
    }
}

/* Touch Device Optimizations */
@media (hover: none) {
    button[type="submit"]:active {
        transform: scale(0.98);
    }

    input[type="radio"]:active {
        transform: scale(1.1);
    }
}