﻿/* ============================================================
   LAYOUT.CSS – Global styles for Booking System
   Uses CSS variables set by ViewBag via :root in _Layout.cshtml
   ============================================================ */

/* ----- Base – force full height ----- */
html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}

body {
    display: flex;
    flex-direction: column;
    background: var(--page-bg);
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-weight: 400;
    line-height: 1.6;
}

/* ----- Main content – grows to fill space, never overflows ----- */
.content-wrapper-custom {
    flex: 1 0 auto;
    background: var(--page-bg);
    padding: 1.5rem 2rem;
    min-height: 0;
    box-sizing: border-box;
}

/* ----- Header (two‑row grid) – unchanged ----- */
.custom-header {
    background: var(--header-bg);
    padding: 0.4rem 1.2rem 0.15rem;
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    gap: 0.1rem 0.6rem;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 1000;
    flex-shrink: 0;
}

.header-logo-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    justify-self: center;
    min-width: 75px;
    min-height: 75px;
}

.header-logo {
    max-height: 80px;
    max-width: 80px;
    height: auto;
    width: auto;
    border-radius: 8px;
    transition: transform 0.2s;
}

    .header-logo:hover {
        transform: scale(1.05);
    }

.header-right {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    gap: 0.1rem;
}

/* ----- Heading ----- */
.header-heading {
    color: var(--heading-color);
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: 0.8px;
    line-height: 1.2;
    margin: 0;
    display: inline-block;
    position: relative;
    padding-bottom: 0.4rem;
}

    .header-heading::after {
        content: '';
        position: absolute;
        left: 0;
        bottom: 0;
        width: 100%;
        height: 2.5px;
        border-radius: 3px;
        background: linear-gradient(90deg, rgba(166, 90, 58, 0.2), var(--heading-color), rgba(166, 90, 58, 0.2));
    }

/* ----- Navigation - FIXED: tighter spacing ----- */
.header-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.05rem 0.2rem;
    padding: 0.15rem 0;
    justify-content: flex-end;
}

    .header-nav a {
        color: var(--nav-text);
        text-decoration: none;
        padding: 0.2rem 0.5rem;
        border-radius: 30px;
        font-size: 1rem;
        font-weight: 500;
        transition: all 0.2s;
        display: inline-flex;
        align-items: center;
        gap: 0.2rem;
        white-space: nowrap;
        line-height: 1.3;
    }

        .header-nav a i {
            font-size: 1rem;
            width: 1.2rem;
            text-align: center;
        }

        .header-nav a:hover {
            background: var(--nav-hover);
            color: #FAF6EF;
            transform: translateY(-1px);
            box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
        }

        .header-nav a.active {
            background: var(--nav-hover);
            color: #FAF6EF;
        }

    /* ----- Social Elements ----- */
    .header-nav .social-divider {
        color: rgba(255, 255, 255, 0.2);
        margin: 0 0.05rem;
        font-size: 0.9rem;
        user-select: none;
        pointer-events: none;
    }

    .header-nav .social-link {
        padding: 0.05rem 0.2rem;
        font-size: 1.1rem;
        background: transparent;
        border-radius: 50%;
        color: var(--nav-text);
        transition: all 0.2s;
    }

        .header-nav .social-link:hover {
            background: var(--nav-hover);
            color: #FAF6EF;
            transform: scale(1.1);
        }

/* ----- Global Links ----- */
a {
    color: var(--link-color);
    text-decoration: none;
}

    a:hover {
        color: var(--heading-color);
        text-decoration: underline;
    }

/* ----- Buttons ----- */
.btn-primary {
    background: var(--accent-color) !important;
    border-color: var(--accent-color) !important;
}

    .btn-primary:hover {
        filter: brightness(0.85);
    }

/* ----- Badges ----- */
.badge-paid {
    background: var(--accent-color);
    color: #FAF6EF;
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    display: inline-block;
}

.badge-unpaid {
    background: var(--heading-color);
    color: #FAF6EF;
    padding: 0.25rem 0.75rem;
    border-radius: 30px;
    display: inline-block;
}

/* ----- Footer – stays at bottom, never shrinks ----- */
.footer {
    flex-shrink: 0;
    background: var(--header-bg);
    color: var(--nav-text);
    padding: 1rem 0;
    border-top: 3px solid var(--accent-color);
    margin-top: 0;
}

.footer-link {
    color: var(--nav-text);
    text-decoration: none;
    transition: color 0.2s;
}

    .footer-link:hover {
        color: var(--accent-color);
        text-decoration: none;
    }

.footer-divider {
    color: rgba(255, 255, 255, 0.3);
    margin: 0 0.6rem;
}

/* ----- Modal ----- */
.modal-body {
    max-height: 70vh;
    overflow-y: auto;
}

/* ----- Document Content ----- */
.document-content {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.8;
    padding: 0.5rem 0;
}

    .document-content p {
        margin-bottom: 1rem;
    }

    .document-content h1,
    .document-content h2,
    .document-content h3 {
        color: var(--heading-color, #1A3B5A);
        margin-top: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .document-content ul,
    .document-content ol {
        padding-left: 2rem;
        margin-bottom: 1rem;
    }

/* ----- Utility ----- */
.text-center {
    text-align: center;
}

.text-start {
    text-align: left;
}

.text-end {
    text-align: right;
}

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-flex {
    display: flex !important;
}

.align-items-center {
    align-items: center;
}

.justify-content-between {
    justify-content: space-between;
}

.justify-content-end {
    justify-content: flex-end;
}

.justify-content-center {
    justify-content: center;
}

.flex-wrap {
    flex-wrap: wrap;
}

.gap-1 {
    gap: 0.25rem;
}

.gap-2 {
    gap: 0.5rem;
}

.gap-3 {
    gap: 1rem;
}

.mt-1 {
    margin-top: 0.25rem;
}

.mt-2 {
    margin-top: 0.5rem;
}

.mt-3 {
    margin-top: 1rem;
}

.mb-1 {
    margin-bottom: 0.25rem;
}

.mb-2 {
    margin-bottom: 0.5rem;
}

.mb-3 {
    margin-bottom: 1rem;
}

.p-1 {
    padding: 0.25rem;
}

.p-2 {
    padding: 0.5rem;
}

.p-3 {
    padding: 1rem;
}

/* ----- Responsive ----- */
@media (max-width: 768px) {
    .custom-header {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        padding: 0.5rem 0.8rem;
        gap: 0.2rem;
    }

    .header-logo-wrapper {
        grid-row: 1 / 2;
        grid-column: 1 / 2;
        justify-self: center;
        margin: 0 auto;
        width: 80px;
        height: 80px;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .header-logo {
        width: 80px;
        height: 80px;
        object-fit: contain;
        max-width: 100%;
        max-height: 100%;
        border-radius: 8px;
    }

    .header-right {
        grid-column: 1 / 2;
        grid-row: 2 / 4;
        align-items: center;
        text-align: center;
    }

    .header-heading {
        font-size: 1.6rem;
        white-space: normal;
        text-align: center;
    }

    .header-nav {
        justify-content: center;
        gap: 0.05rem 0.15rem;
        margin-top: 0.2rem;
    }

        .header-nav a {
            font-size: 0.85rem;
            padding: 0.15rem 0.4rem;
        }

            .header-nav a i {
                font-size: 0.85rem;
                width: 1rem;
            }

        .header-nav .social-link {
            font-size: 0.9rem;
            padding: 0.05rem 0.15rem;
        }

        .header-nav .social-divider {
            display: none;
        }

    .footer .row {
        text-align: center;
    }

    .footer .col-md-6 {
        margin-bottom: 0.5rem;
    }

    .content-wrapper-custom {
        padding: 1rem;
    }
}

/* ----- Theme‑coloured spinners ----- */
.modal .spinner-border,
.modal-footer .spinner-border,
.footer .spinner-border,
.modal .spinner-grow,
.modal-footer .spinner-grow,
.footer .spinner-grow {
    color: var(--accent-color, #3b5e4a) !important;
    border-right-color: rgba(255, 255, 255, 0.2) !important;
}

/* Custom CSS spinner (::after) in modals */
.calendar-card.loading::after,
.slots-panel.loading::after {
    border-top-color: var(--accent-color, #3b5e4a) !important;
}

/* PDF Viewer Modal */
#pdfViewerModal .modal-dialog {
    max-width: 95% !important;
    margin: 1.75rem auto;
}

#pdfViewerModal .modal-content {
    height: 90vh !important;
    border-radius: 12px;
    overflow: hidden;
}

#pdfViewerModal .modal-body {
    padding: 0 !important;
    height: calc(100% - 60px) !important;
}

#pdfViewerModal iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    #pdfViewerModal .modal-dialog {
        max-width: 100% !important;
        margin: 0;
    }

    #pdfViewerModal .modal-content {
        height: 100vh !important;
        border-radius: 0;
    }

    #pdfViewerModal .modal-body {
        height: calc(100% - 56px) !important;
    }
}

/* Button group styling */
.btn-group .btn {
    font-size: 0.85rem;
    padding: 0.375rem 0.75rem;
}

    .btn-group .btn i {
        margin-right: 0.3rem;
    }

/* Document preview area */
.document-preview {
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 1rem;
    background: #f8f9fa;
    text-align: center;
}

    .document-preview i {
        font-size: 64px;
        color: #e74c3c;
        margin-bottom: 0.5rem;
    }

    .document-preview .file-name {
        font-weight: 600;
        margin-bottom: 0.25rem;
    }

    .document-preview .file-meta {
        font-size: 0.85rem;
        color: #6c757d;
        margin-bottom: 0.75rem;
    }
