/* Modern Tennis Reservation System Design */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css");

:root {
    /* Color Palette */
    --primary-color: #1e3a8a;
    /* Deep Navy */
    --secondary-color: #3b82f6;
    /* Bright Blue */
    --accent-color: #f59e0b;
    /* Amber/Gold */
    --bg-color: #f8fafc;
    /* Very Light Blue/Gray */
    --surface-color: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --border-color: #e2e8f0;

    /* Spacing */
    --bs-body-bg: var(--bg-color);
    /* Bootstrap Override */
}

body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    color: var(--text-primary);
    background-color: var(--bg-color);
    line-height: 1.6;
    letter-spacing: -0.02em;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 1rem;
}

/* Navbar */
.navbar {
    background-color: var(--surface-color) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    padding: 1rem 0;
}

.navbar-brand {
    font-weight: 800;
    color: var(--primary-color) !important;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    color: var(--text-secondary) !important;
    font-weight: 600;
    padding: 0.5rem 1rem;
    transition: color 0.2s;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: var(--secondary-color) !important;
}

/* Buttons */
.btn {
    font-weight: 600;
    border-radius: 8px;
    padding: 0.6rem 1.2rem;
    transition: all 0.2s;
}

.btn-primary {
    background-color: var(--secondary-color);
    border-color: var(--secondary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

/* Cards */
.card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.card-header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    font-weight: 700;
    padding: 1rem 1.5rem;
}

/* Slot Styling */
.court-slot {
    border-radius: 8px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    border: 1px solid transparent;
}

.slot-OPEN {
    background-color: #dcfce7;
    color: #15803d;
    border-color: #bbf7d0;
}

.slot-OPEN:hover {
    background-color: #bbf7d0;
}

.slot-RESERVED {
    background-color: #fee2e2;
    color: #b91c1c;
    border-color: #fecaca;
    cursor: not-allowed;
    opacity: 0.8;
}

.slot-CLOSED {
    background-color: #f1f5f9;
    color: #94a3b8;
    border-color: #e2e8f0;
    cursor: not-allowed;
}

/* Hero Section Utilities */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 5rem 0;
    margin-bottom: 3rem;
}

.hero-section h1 {
    color: white;
}

.hero-section .lead {
    color: rgba(255, 255, 255, 0.9);
}

/* Footer */
footer {
    background-color: var(--primary-color) !important;
    color: rgba(255, 255, 255, 0.8);
    padding: 3rem 0;
}

.table th {
    background-color: #f1f5f9;
    font-weight: 600;
}

/* Landing Page Specifics */
.feature-box {
    padding: 2.5rem;
    border-radius: 16px;
    background: var(--surface-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    height: 100%;
    border: 1px solid var(--border-color);
}

.feature-icon {
    font-size: 3rem;
    color: var(--secondary-color);
    margin-bottom: 1.5rem;
    background: #eff6ff;
    width: 80px;
    height: 80px;
    line-height: 80px;
    border-radius: 50%;
    margin-left: auto;
    margin-right: auto;
}

.btn-cta {
    padding: 1rem 3rem;
    font-size: 1.25rem;
    border-radius: 50px;
    font-weight: 700;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    background: white;
    color: var(--primary-color);
    border: 2px solid white;
}

.btn-cta:hover {
    background: transparent;
    color: white;
    border-color: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.2);
}

/* ======================================================
   MOBILE RESPONSIVE OPTIMIZATIONS
   ====================================================== */

/* ── 1. iOS Safari: prevent input auto-zoom (triggered when font < 16px) ── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="number"],
input[type="tel"],
select,
textarea {
    font-size: max(16px, 1rem) !important;
}

/* ── 2. Responsive Typography ── */
@media (max-width: 767.98px) {
    .display-3 { font-size: 1.9rem !important; line-height: 1.2; }
    .display-4 { font-size: 1.65rem !important; line-height: 1.2; }
    .display-5 { font-size: 1.4rem !important; line-height: 1.25; }
    .lead      { font-size: 0.95rem !important; }
    h2         { font-size: 1.35rem; }
    h3         { font-size: 1.15rem; }
}

/* ── 3. Navbar – Mobile Collapsed State ── */
@media (max-width: 991.98px) {
    .navbar-collapse .navbar-nav .nav-link {
        padding: 0.45rem 0;
        border-bottom: 1px solid #f1f5f9;
    }
    .navbar-collapse .navbar-nav .nav-item:last-child .nav-link {
        border-bottom: none;
    }
    .navbar-auth {
        margin-left: 0 !important;
        padding-top: 0.5rem;
        border-top: 2px solid #f1f5f9;
        width: 100%;
    }
}

/* ── 4. Hero Sections ── */
@media (max-width: 767.98px) {
    /* index.html main hero */
    .hero-section {
        padding: 3rem 0 2.5rem;
    }
    .btn-cta {
        padding: 0.75rem 1.75rem !important;
        font-size: 1rem !important;
    }

    /* site-hero (notice / community / inquiry …) */
    .site-hero .container {
        padding-top: 1.75rem !important;
        padding-bottom: 1.75rem !important;
    }

    /* mypage hero */
    .mypage-hero .container {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
    .mypage-hero h1.display-5 { font-size: 1.25rem !important; }
    .mypage-hero .d-flex.flex-wrap.gap-3 { gap: 0.4rem !important; }
    .hero-stat       { padding: 0.35rem 0.6rem; }
    .hero-stat-value { font-size: 1.1rem; }
    .hero-stat-label { font-size: 0.7rem; }

    /* reservation hero */
    .reservation-hero .container {
        padding-top: 1.5rem !important;
        padding-bottom: 1.5rem !important;
    }
}

/* ── 5. Index Feature Boxes ── */
@media (max-width: 767.98px) {
    .feature-box            { padding: 1.5rem 1rem; }
    .feature-icon           { width: 60px; height: 60px; line-height: 60px; font-size: 2rem; margin-bottom: 0.75rem; }
}

/* ── 6. Table: Responsive Column Hiding ── */

/* Notice table (1=번호, 2=제목, 3=작성자, 4=작성일, 5=조회수)
   Mobile: show 제목(2) + 작성일(4) only */
@media (max-width: 575.98px) {
    .notice-table th:nth-child(1), .notice-table td:nth-child(1),
    .notice-table th:nth-child(3), .notice-table td:nth-child(3),
    .notice-table th:nth-child(5), .notice-table td:nth-child(5) { display: none; }
}

/* Community table (1=번호, 2=제목, 3=작성자, 4=날짜, 5=조회수)
   Mobile: show 제목(2) + 작성자(3) only */
@media (max-width: 575.98px) {
    .community-table th:nth-child(1), .community-table td:nth-child(1),
    .community-table th:nth-child(4), .community-table td:nth-child(4),
    .community-table th:nth-child(5), .community-table td:nth-child(5) { display: none; }
}

/* Reservation table (1=날짜, 2=시간, 3=코트, 4=금액, 5=상태, 6=비고, 7=관리)
   Mobile: show 날짜(1) + 상태(5) + 관리(7) */
@media (max-width: 575.98px) {
    .reservation-table th:nth-child(2), .reservation-table td:nth-child(2),
    .reservation-table th:nth-child(3), .reservation-table td:nth-child(3),
    .reservation-table th:nth-child(4), .reservation-table td:nth-child(4),
    .reservation-table th:nth-child(6), .reservation-table td:nth-child(6) { display: none; }
}

/* Inquiry table (1=제목, 2=상태, 3=등록일, 4=관리)
   XS: hide 등록일(3) */
@media (max-width: 400px) {
    .inquiry-table th:nth-child(3), .inquiry-table td:nth-child(3) { display: none; }
}

/* ── 7. Card Padding Reduction ── */
@media (max-width: 767.98px) {
    .card-body.p-4  { padding: 1rem !important; }
    .card-body.p-md-5 { padding: 1rem !important; }
    .mypage-card-body { padding: 1rem !important; }
}

/* ── 8. Modals ── */
@media (max-width: 575.98px) {
    .modal-dialog:not(.modal-fullscreen) {
        margin: 0.5rem;
        max-width: calc(100vw - 1rem);
    }
    .modal-body   { padding: 1rem; }
    .modal-header { padding: 0.75rem 1rem; }
    .modal-footer { padding: 0.75rem 1rem; }
}

/* ── 9. MyPage Tabs – Horizontal Scroll on XS ── */
@media (max-width: 575.98px) {
    .mypage-tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 0 !important;
        padding-bottom: 4px;
    }
    .mypage-tabs::-webkit-scrollbar { height: 3px; }
    .mypage-tabs .nav-link {
        white-space: nowrap;
        font-size: 0.8rem;
        padding: 0.45rem 0.7rem;
    }
}

/* ── 10. Notice Search Bar ── */
@media (max-width: 575.98px) {
    .notice-search-group { max-width: 50% !important; }
    .notice-search-group .form-control { font-size: 14px !important; }
}

/* ── 11. Info Cards (reservation page, 2×2 grid) ── */
@media (max-width: 575.98px) {
    .info-card { padding: 1rem !important; }
    .info-icon { font-size: 1.5rem; }
    .info-card .fw-bold { font-size: 0.85rem; }
    .info-card .text-muted.small { font-size: 0.75rem !important; }
}

/* ── 12. Pagination ── */
@media (max-width: 575.98px) {
    .pagination .page-link { padding: 0.35rem 0.55rem; font-size: 0.85rem; }
}

/* ── 13. Footer ── */
@media (max-width: 767.98px) {
    footer { padding: 1.5rem 0 !important; font-size: 0.85rem; }
}

/* ── 14. Container Side Padding on very small screens ── */
@media (max-width: 374.98px) {
    .container { padding-left: 0.75rem; padding-right: 0.75rem; }
}

/* ── 15. Verify notice banner tweaks ── */
@media (max-width: 575.98px) {
    .vn-header { flex-direction: column; }
    .vn-submit-grid { grid-template-columns: 1fr !important; }
    .vn-footer { flex-direction: column; gap: 0.5rem; }
}

/* ── 16. Post detail comment input ── */
@media (max-width: 575.98px) {
    #commentsSection .d-flex.gap-2 { flex-direction: column; }
    #commentsSection #btnAddComment { width: 100%; }
}
