/* Root Variables */
:root {
    --primary-green: #0d6558;
    --secondary-green: #0a4d43;
    --accent-gold: #d4952f;
    --light-gold: #e5a944;
    --white: #ffffff;
    --light-gray: #f5f5f5;
    --text-dark: #2c3e50;
    --text-light: #ecf0f1;
    --shadow: rgba(0, 0, 0, 0.1);
    --shadow-dark: rgba(0, 0, 0, 0.2);
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--white);
    overflow-x: hidden;
}

/* Container */
.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    padding: 15px 0;
    box-shadow: 0 2px 10px var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-circle {
    width: 50px;
    height: 50px;
    /* background-color: var(--white); */
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.logo-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.header-text {
    text-align: left;
}

.institution-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--white);
    line-height: 1.2;
    letter-spacing: 0.5px;
}

.institution-location {
    font-size: 0.7rem;
    color: var(--text-light);
    margin-top: 2px;
    font-weight: 300;
}

/* Hero Section */
.hero {
    position: relative;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    background-image: 
        linear-gradient(rgba(13, 101, 88, 0.75), rgba(10, 77, 67, 0.75)),
        url('../images/masjid-bg.jpeg');
    background-size: 100% auto;
    background-position: center;
    background-attachment: fixed;
    padding: 40px 0;
    text-align: center;
    overflow: hidden;
    display: flex;
    align-items: center;
    min-height: 350px;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: 
        radial-gradient(circle at 20% 50%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 80% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* Hero Santri Image */
.hero-santri-image {
    position: absolute;
    left: 0;
    bottom: 0;
    top: auto;
    max-width: 45%;
    height: auto;
    z-index: 2;
    object-fit: cover;
    opacity: 0;
}

.hero-santri-image.animate {
    animation: slideInLeft 1s ease-out forwards;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

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

.hero-content {
    position: relative;
    z-index: 3;
    width: 100%;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 2px 2px 4px var(--shadow-dark);
    opacity: 0;
}

.hero-content.animate .hero-title {
    animation: fadeInUp 0.8s ease-out 0.4s forwards;
}

.academic-year {
    font-size: 1.1rem;
    color: var(--white);
    margin-bottom: 15px;
    font-weight: 400;
    opacity: 0;
}

.hero-content.animate .academic-year {
    animation: fadeInUp 0.8s ease-out 0.8s forwards;
}

.badge {
    display: inline-block;
    background-color: var(--accent-gold);
    color: var(--white);
    padding: 10px 25px;
    border-radius: 25px;
    font-size: 0.85rem;
    font-weight: 600;
    opacity: 0;
    margin-bottom: 30px;
    box-shadow: 0 4px 15px rgba(212, 149, 47, 0.3);
}

.hero-content.animate .badge {
    animation: fadeInUp 0.8s ease-out 1.2s forwards;
}

.cta-button {
    display: inline-block;
    background-color: var(--white);
    color: var(--primary-green);
    padding: 14px 40px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px var(--shadow);
    opacity: 0;
}

.hero-content.animate .cta-button {
    animation: fadeInUp 0.8s ease-out 1.6s forwards;
}

.cta-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px var(--shadow-dark);
    background-color: var(--accent-gold);
    color: var(--white);
}

/* Schedule Section */
.schedule-section {
    padding: 50px 0;
    background-color: var(--light-gray);
}

/* Fee Section - Same style as schedule section */
.fee-section {
    padding: 50px 0;
    background-color: var(--light-gray);
}

.fee-header {
    text-align: center;
    margin-bottom: 30px;
}

.fee-header h2 {
    font-size: 2rem;
    color: var(--text-dark);
    font-weight: 700;
    letter-spacing: 1px;
}

.schedule-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.fee-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.schedule-card,
.requirement-card,
.info-card,
.contact-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.fee-card {
    background: var(--white);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px var(--shadow);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
}

.schedule-card.fade-in,
.requirement-card.fade-in,
.info-card.fade-in,
.contact-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.fee-card.fade-in {
    opacity: 1;
    transform: translateY(0);
}

.schedule-card:hover,
.requirement-card:hover,
.info-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-dark);
}

.fee-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow-dark);
}

.card-header {
    background: linear-gradient(135deg, var(--accent-gold) 0%, var(--light-gold) 100%);
    padding: 15px 20px;
    text-align: center;
}

.card-header h3 {
    color: var(--white);
    font-size: 1.1rem;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.card-content {
    padding: 25px 20px;
}

.schedule-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background-color: var(--light-gray);
    border-radius: 10px;
    margin-bottom: 15px;
}

.fee-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 15px;
    background-color: var(--light-gray);
    border-radius: 10px;
    margin-bottom: 15px;
}

.schedule-item:last-child {
    margin-bottom: 0;
}

.fee-item:last-child {
    margin-bottom: 0;
}

.wave-label {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 600;
}

.fee-label {
    font-size: 0.85rem;
    color: var(--accent-gold);
    font-weight: 600;
}

.date {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 500;
}

.fee-amount {
    font-size: 0.95rem;
    color: var(--text-dark);
    font-weight: 500;
}

/* Requirements Section */
.requirements-section {
    padding: 50px 0;
    background-color: var(--white);
}

.requirements-grid,
.info-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.requirement-list,
.info-list {
    list-style: none;
    counter-reset: item;
}

.requirement-list > li,
.info-list > li {
    counter-increment: item;
    margin-bottom: 15px;
    padding-left: 35px;
    position: relative;
    line-height: 1.6;
}

.requirement-list > li::before,
.info-list > li::before {
    content: counter(item) ".";
    position: absolute;
    left: 0;
    top: 0;
    color: var(--accent-gold);
    font-weight: 600;
    font-size: 1rem;
}

.sub-list {
    list-style: none;
    margin-top: 10px;
    padding-left: 0;
}

.sub-list li {
    margin-bottom: 8px;
    color: var(--text-dark);
    font-size: 0.95rem;
}

.link {
    display: block;
    color: var(--primary-green);
    text-decoration: none;
    font-weight: 500;
    margin-top: 5px;
    transition: color 0.3s ease;
}

.link:hover {
    color: var(--accent-gold);
    text-decoration: underline;
}

/* Info Section */
.info-section {
    padding: 50px 0;
    background-color: var(--light-gray);
}

/* Contact Section */
.contact-section {
    padding: 50px 0;
    background-color: var(--white);
}

.contact-content {
    padding: 30px 20px;
    text-align: center;
}

.contact-number {
    display: inline-block;
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-green);
    text-decoration: none;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.contact-number:hover {
    color: var(--accent-gold);
}

.contact-name {
    font-size: 1rem;
    color: var(--text-dark);
    font-weight: 400;
}

/* CTA Section */
.cta-section {
    padding: 60px 0;
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--secondary-green) 100%);
    text-align: center;
}

.cta-content {
    max-width: 600px;
    margin: 0 auto;
}

.cta-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 15px;
    text-shadow: 2px 2px 4px var(--shadow-dark);
}

.cta-description {
    font-size: 1rem;
    color: var(--text-light);
    margin-bottom: 30px;
    line-height: 1.6;
}

.cta-button-large {
    display: inline-block;
    background-color: var(--accent-gold);
    color: var(--white);
    padding: 16px 50px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(212, 149, 47, 0.3);
}

.cta-button-large:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 25px rgba(212, 149, 47, 0.5);
    background-color: var(--light-gold);
}

/* Footer */
.footer {
    background-color: var(--secondary-green);
    padding: 40px 0 20px;
    color: var(--white);
}

.footer-content {
    text-align: center;
}

/* Footer layout: place social links and QR neatly */
.footer-top {
    display: flex;
    align-items: center;
    justify-content: flex-start; /* keep social block to the left */
    gap: 18px;
    margin-bottom: 18px;
}

/* ensure social links are left-aligned */
.footer-social {
    text-align: left;
}

/* vertically center content inside social and qr blocks */
.footer-social,
.footer-qr {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.footer-qr img {
    width: 100px;
    height: auto;
    display: block;
    border-radius: 10px;
    background: var(--white);
    padding: 8px;
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
}

/* On larger screens, separate social and QR with space-between */
@media (min-width: 768px) {
    .footer-top {
        justify-content: space-between;
        align-items: center;
        gap: 30px;
    }

    .footer-social {
        flex: 1 1 auto;
        text-align: left;
    }

    .footer-qr {
        flex: 0 0 auto;
        margin-left: 20px;
    }
}

@media (max-width: 480px) {
    .footer-qr img {
        width: 88px;
        padding: 6px;
    }

    .footer-top {
        flex-direction: column;
        gap: 12px;
        align-items: center; /* center vertically and horizontally on small screens */
    }

    /* on small screens keep social text left but center block vertically */
    .footer-social { text-align: left; }
}

.footer-social > p {
    font-size: 0.9rem;
    margin-bottom: 15px;
    font-weight: 500;
}

.social-links {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
}

.social-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: var(--white);
    text-decoration: none;
    transition: all 0.3s ease;
}

.social-link:hover {
    background-color: var(--accent-gold);
    transform: translateY(-3px);
}

.footer-handle {
    font-size: 0.85rem;
    color: var(--text-light);
}

.footer-copyright {
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-copyright p {
    font-size: 0.85rem;
    color: var(--text-light);
}

/* Mobile Styles - Extra Small */
@media (max-width: 599px) {
    .hero-santri-image {
        max-width: 50%;
    }

    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 15px;
    }

    .hero-subtitle {
        margin-top: 15px;
    }

    .academic-year {
        font-size: 0.9rem;
        margin-bottom: 10px;
    }

    .badge {
        font-size: 0.75rem;
        padding: 8px 20px;
    }

    .cta-button {
        padding: 12px 30px;
        font-size: 0.9rem;
    }
}

/* Tablet Styles */
@media (min-width: 600px) {
    .hero {
        min-height: 450px;
        padding: 50px 0;
    }

    .institution-location {
        font-size: 0.8rem;
    }

    .hero-title {
        font-size: 3rem;
    }

    .hero-santri-image {
        max-width: 55%;
    }

    .academic-year {
        font-size: 1.2rem;
    }

    .badge {
        font-size: 0.9rem;
    }

    .schedule-grid,
    .requirements-grid,
    .info-grid,
    .fee-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }

    .card-header h3 {
        font-size: 1.2rem;
    }

    .contact-number {
        font-size: 2rem;
    }
}

/* Desktop Styles */
@media (min-width: 1024px) {
    .container {
        padding: 0 40px;
    }

    .logo-circle {
        width: 55px;
        height: 55px;
    }

    .logo-icon {
        width: 35px;
        height: 35px;
    }

    .institution-name {
        font-size: 1.4rem;
    }

    .institution-location {
        font-size: 0.85rem;
    }

    .hero {
        padding: 80px 0;
    }

    .hero-title {
        font-size: 3.5rem;
    }

    .schedule-section,
    .requirements-section,
    .info-section,
    .contact-section {
        padding: 70px 0;
    }

    .cta-section {
        padding: 80px 0;
    }

    .cta-title {
        font-size: 2.5rem;
    }

    .schedule-grid {
        gap: 30px;
    }

    .requirements-grid,
    .info-grid {
        gap: 30px;
    }

    .card-content {
        padding: 30px 25px;
    }

    .schedule-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }

    .wave-label {
        font-size: 0.9rem;
    }

    .date {
        font-size: 1rem;
    }
}

/* Large Desktop */
@media (min-width: 1200px) {
    .hero-title {
        font-size: 4rem;
    }

    .schedule-grid,
    .requirements-grid,
    .info-grid {
        gap: 35px;
    }
}

/* Print Styles */
@media print {
    .header,
    .footer,
    .cta-section {
        display: none;
    }

    .schedule-card,
    .requirement-card,
    .info-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-green: #094d43;
        --accent-gold: #b8841f;
    }

    .card-header,
    .hero,
    .cta-section {
        border: 2px solid var(--text-dark);
    }
}

/* Login button animations (moved from Blade) */
.login-button {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 10px;
    border: 1px solid rgba(255,255,255,0.18);
    color: #ffffff;
    background: rgba(255,255,255,0.06);
    text-decoration: none;
    font-weight: 600;
    font-size: 16px;
    line-height: 1;
    transition: all .2s ease-in-out;
    will-change: transform, box-shadow, opacity;
    /* start hidden for entrance animation */
    opacity: 0;
    transform: translateY(8px);
    box-shadow: 0 6px 18px rgba(0,0,0,0.18);
    position: relative;
    overflow: hidden;
}

.login-button::after {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(120deg, rgba(255,255,255,0.06), rgba(255,255,255,0.18), rgba(255,255,255,0.06));
    transform: skewX(-20deg);
    transition: left .45s ease-in-out;
    pointer-events: none;
}

.login-button:hover::after {
    left: 125%;
}

.login-button:hover {
    background: rgba(255,255,255,0.12);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0,0,0,0.22);
}

/* Hero placement */
.hero-actions {
    margin-top: 16px;
    display: flex;
    justify-content: center;
}

/* Tablet */
@media (max-width: 1024px) {
    .login-button {
        padding: 9px 16px;
        font-size: 15px;
        border-radius: 9px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .hero-actions { width: 100%; }
    .login-button {
        display: block;
        width: 100%;
        max-width: 320px;
        margin: 8px auto 0;
        padding: 10px 14px;
        font-size: 14px;
        border-radius: 8px;
        animation: none; /* disable float on small screens */
    }
    .login-button::after { display: none; }
}

@keyframes float {
    0% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
    100% { transform: translateY(0); }
}

/* Entrance animation when hero-content adds .animate (on load) */
.hero-content.animate .login-button {
    /* appear after .cta-button (which starts at 1.6s for 0.8s) */
    animation: entrance 0.64s cubic-bezier(.22,.9,.26,1) 2.5s both,
               float 6s ease-in-out 3.2s infinite;
}

@keyframes entrance {
    0% { opacity: 0; transform: translateY(12px) scale(0.985); }
    60% { opacity: 1; transform: translateY(-4px) scale(1.02); }
    100% { opacity: 1; transform: translateY(0) scale(1); }
}
@media (prefers-reduced-motion: reduce) {
    * {
        animation: none !important;
        transition: none !important;
    }
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    :root {
        --primary-green: #094d43;
        --accent-gold: #b8841f;
    }

    .card-header,
    .hero,
    .cta-section {
        border: 2px solid var(--text-dark);
    }
}
