/* ============================================
   MedScholar Custom CSS
   Additional styles and overrides
   ============================================ */

/* Page transitions */
.site {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.site.loaded {
    opacity: 1;
}

/* Custom selection color */
::selection {
    background: rgba(200, 164, 90, 0.3);
    color: #fff;
}

::-moz-selection {
    background: rgba(200, 164, 90, 0.3);
    color: #fff;
}

/* Glassmorphism refinement */
.service-card,
.sidebar-widget,
.contact-form-wrapper,
.contact-info-card,
.faq-item,
.congress-info-card {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

/* Service card icon animations */
.service-card:hover .service-icon .icon-text {
    color: var(--primary);
}

/* Congress item animation on load */
.congress-item {
    animation: fadeInRight 0.4s ease forwards;
    opacity: 0;
}

.congress-item:nth-child(1) { animation-delay: 0.05s; }
.congress-item:nth-child(2) { animation-delay: 0.1s; }
.congress-item:nth-child(3) { animation-delay: 0.15s; }
.congress-item:nth-child(4) { animation-delay: 0.2s; }
.congress-item:nth-child(5) { animation-delay: 0.25s; }
.congress-item:nth-child(6) { animation-delay: 0.3s; }
.congress-item:nth-child(7) { animation-delay: 0.35s; }
.congress-item:nth-child(8) { animation-delay: 0.4s; }
.congress-item:nth-child(9) { animation-delay: 0.45s; }
.congress-item:nth-child(10) { animation-delay: 0.5s; }

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

/* Hero badge animation */
.hero-badge {
    animation: fadeInUp 0.8s ease forwards;
}

.hero-title {
    animation: fadeInUp 0.8s ease 0.2s forwards;
}

.hero-subtitle {
    animation: fadeInUp 0.8s ease 0.4s forwards;
}

.hero-buttons {
    animation: fadeInUp 0.8s ease 0.6s forwards;
}

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

/* Contact form focus ring animation */
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    animation: focusRing 0.3s ease;
}

@keyframes focusRing {
    0% {
        box-shadow: 0 0 0 0 rgba(200, 164, 90, 0.3);
    }
    100% {
        box-shadow: 0 0 0 3px rgba(200, 164, 90, 0.15);
    }
}

/* Button ripple effect */
.btn-primary,
.btn-secondary,
.form-submit {
    position: relative;
    overflow: hidden;
}

.btn-primary::after,
.btn-secondary::after,
.form-submit::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn-primary:active::after,
.btn-secondary:active::after,
.form-submit:active::after {
    width: 300px;
    height: 300px;
}

/* Sidebar widget body custom scrollbar for Firefox */
.sidebar-widget-body {
    scrollbar-width: thin;
    scrollbar-color: var(--accent-dark) transparent;
}

/* FAQ answer transition fix */
.faq-answer {
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Input placeholder styling */
.form-group input::placeholder,
.form-group textarea::placeholder {
    color: rgba(160, 160, 176, 0.5);
    font-size: 0.88rem;
}

/* Custom select arrow */
.form-group select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='%23c8a45a'%3E%3Cpath d='M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 16px center;
    padding-left: 40px;
    color: #2d2d3a; /* Darker text for better visibility */
    font-weight: 500;
}

/* Subject select options - ensure dark text */
.form-group select option {
    color: #2d2d3a;
    background-color: #ffffff;
    padding: 8px;
}

/* Navigation divider and external links */
.nav-divider {
    display: inline-block;
    width: 1px;
    height: 24px;
    background: rgba(200, 164, 90, 0.3);
    margin: 0 12px;
    vertical-align: middle;
}

.nav-external {
    position: relative;
    font-size: 0.88rem;
    opacity: 0.9;
    transition: all 0.3s ease;
}

.nav-external:hover {
    opacity: 1;
    color: var(--accent);
}

.nav-external::after {
    content: '↗';
    font-size: 0.7rem;
    margin-right: 4px;
    opacity: 0.6;
}

/* Responsive adjustments for congress layout on small screens */
@media (max-width: 768px) {
    .congress-layout {
        gap: 24px;
    }

    .congress-features {
        gap: 12px;
    }

    .hero-section {
        padding: 100px 20px 60px;
    }
}

@media (max-width: 480px) {
    .hero-badge {
        font-size: 0.75rem;
        padding: 6px 16px;
    }

    .section-label {
        font-size: 0.72rem;
    }

    .section-label::before,
    .section-label::after {
        width: 20px;
    }
}

/* Print styles */
@media print {
    .site-header,
    .site-footer,
    .back-to-top,
    .particles,
    .site-background,
    .loading-screen,
    .mobile-overlay {
        display: none !important;
    }

    body {
        background: #fff;
        color: #000;
    }

    .section {
        padding: 30px 0;
    }

    .service-card,
    .faq-item,
    .contact-info-card {
        break-inside: avoid;
        background: #fff;
        border: 1px solid #ddd;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}

/* Focus visible for keyboard navigation */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

/* WordPress admin bar offset */
body.admin-bar .site-header {
    top: 32px;
}

@media (max-width: 782px) {
    body.admin-bar .site-header {
        top: 46px;
    }
}
