/**
 * Maharashtra Gazette Name-Change Internal Management System
 * Stylesheet (Clean White/Blue Theme & Official Gazette Typography)
 */

:root {
    --primary-blue: #0d6efd;
    --primary-hover: #0b5ed7;
    --primary-dark: #084298;
    --primary-light: #cfe2ff;
    --navy-header: #1a365d;
    --bg-page: #f4f6f9;
    --card-border: #e2e8f0;
    --text-main: #212529;
    --text-muted: #6c757d;
    --border-gazette: #000000;
}

body {
    background-color: var(--bg-page);
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    color: var(--text-main);
    min-height: 100vh;
}

/* Navbar */
.navbar-custom {
    background-color: var(--navy-header);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}
.navbar-custom .navbar-brand {
    font-weight: 700;
    color: #ffffff !important;
    display: flex;
    align-items: center;
    gap: 10px;
}
.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 0.5rem 0.9rem;
    border-radius: 4px;
    transition: all 0.2s ease;
}
.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: #ffffff !important;
    background-color: rgba(255, 255, 255, 0.12);
}

/* Dashboard Cards */
.stat-card {
    border: 1px solid var(--card-border);
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.stat-card:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.08);
}
.stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

/* Table Styling */
.table-custom {
    background: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.table-custom thead th {
    background-color: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e2e8f0;
    padding: 12px 14px;
    white-space: nowrap;
}
.table-custom tbody td {
    padding: 12px 14px;
    vertical-align: middle;
    font-size: 0.92rem;
    border-bottom: 1px solid #f1f5f9;
}
.table-custom tbody tr:hover {
    background-color: #f8faff;
}

/* Badges */
.badge-reg {
    font-family: "Courier New", Courier, monospace;
    font-weight: 700;
    font-size: 0.9rem;
    background-color: #e0f2fe;
    color: #0369a1;
    border: 1px solid #bae6fd;
    padding: 4px 8px;
}
.badge-marathi {
    background-color: #fef3c7;
    color: #92400e;
    border: 1px solid #fde68a;
}
.badge-english {
    background-color: #e0e7ff;
    color: #3730a3;
    border: 1px solid #c7d2fe;
}

/* Buttons */
.btn-primary {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}
.btn-primary:hover {
    background-color: var(--primary-hover);
    border-color: var(--primary-hover);
}

/* Forms */
.form-card {
    background: #ffffff;
    border: 1px solid var(--card-border);
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}
.form-label {
    font-weight: 600;
    font-size: 0.9rem;
    color: #334155;
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

/* Live Gazette Preview Card inside Add/Edit form */
.gazette-card-preview {
    background-color: #ffffff;
    border: 2px solid #333333;
    padding: 16px;
    font-family: "Times New Roman", Times, "Noto Serif Devanagari", serif;
    color: #000000;
    line-height: 1.35;
}

/* ==========================================================
   OFFICIAL GAZETTE PUBLICATION STYLING (MATCHING 2.JPG)
   ========================================================== */

@import url('https://fonts.googleapis.com/css2?family=Noto+Serif+Devanagari:wght@400;600;700&display=swap');

.gazette-page-container {
    background: #525659;
    padding: 24px 0;
    min-height: 100vh;
}

.gazette-toolbar {
    background: #ffffff;
    border-radius: 6px;
    padding: 10px 18px;
    margin-bottom: 20px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Gazette A4 Paper Simulator */
.gazette-sheet {
    background: #ffffff;
    width: 210mm;
    min-height: 297mm;
    margin: 0 auto;
    padding: 14mm 14mm 16mm 14mm;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
    font-family: "Times New Roman", Times, "Noto Serif Devanagari", serif;
    color: #000000;
    position: relative;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Background image overlay mode using 2.jpg */
.gazette-sheet.with-bg-image {
    background-image: url('../images/2.jpg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-position: top center;
}

/* When 2.jpg background image is applied as watermark or reference */
.gazette-sheet.bg-watermark {
    position: relative;
}
.gazette-sheet.bg-watermark::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url('../images/2.jpg');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

/* Gazette Header */
.gazette-header {
    text-align: center;
    margin-bottom: 8px;
}
.gazette-header .title-main {
    font-size: 13.5pt;
    font-weight: 700;
    margin-bottom: 3px;
    letter-spacing: 0.2px;
}
.gazette-header .title-sub {
    font-size: 11pt;
    font-weight: 600;
    margin-bottom: 8px;
}
.gazette-double-divider {
    border: none;
    border-top: 1.5pt solid #000000;
    margin: 8px 0 10px 0;
}

/* Gazette Grid Layout */
.gazette-grid {
    display: flex;
    width: 100%;
    border-bottom: 1.5pt solid #000000;
    padding-bottom: 12px;
    flex-grow: 1;
}

/* Main Two Columns */
.gazette-main-col {
    width: 50%;
    box-sizing: border-box;
}
.gazette-main-col:first-child {
    padding-right: 14px;
    border-right: 1px solid #ffffff; /* faint or none as per 2.jpg */
}
.gazette-main-col:last-child {
    padding-left: 14px;
}

/* Column Header Row */
.gazette-col-header {
    display: flex;
    border-top: 1px solid #000000;
    border-bottom: 1.5pt solid #000000;
    padding: 6px 0;
    margin-bottom: 12px;
    font-size: 9.5pt;
    line-height: 1.25;
    text-align: center;
    font-weight: 600;
}
.gazette-col-header .sub-header-left {
    width: 44%;
    padding-right: 6px;
    text-align: center;
}
.gazette-col-header .sub-header-right {
    width: 56%;
    padding-left: 6px;
    text-align: center;
}

/* Individual Gazette Entry Row */
.gazette-entry-row {
    display: flex;
    margin-bottom: 16px;
    font-size: 10pt;
    line-height: 1.28;
    page-break-inside: avoid;
    break-inside: avoid;
}
.gazette-entry-left {
    width: 44%;
    padding-right: 8px;
    box-sizing: border-box;
}
.gazette-entry-right {
    width: 56%;
    padding-left: 8px;
    box-sizing: border-box;
}

.gazette-entry-left .old-name {
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}
.gazette-entry-left .reg-no {
    font-weight: 400;
    display: block;
}

.gazette-entry-right .new-name {
    font-weight: 700;
    display: block;
    margin-bottom: 2px;
}
.gazette-entry-right .new-address {
    font-weight: 400;
    display: block;
    white-space: pre-line;
    word-break: break-word;
}

/* Gazette Footer */
.gazette-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 10px;
    font-size: 10pt;
    margin-top: auto;
}
.gazette-footer .footer-left {
    font-weight: 600;
}
.gazette-footer .footer-page {
    font-weight: 600;
    text-align: center;
    flex-grow: 1;
    margin-right: 60px; /* center balance */
}

/* Print Specific Rules */
@media print {
    body {
        background: #ffffff !important;
        margin: 0 !important;
        padding: 0 !important;
    }
    .no-print, .gazette-toolbar, .navbar, .alert {
        display: none !important;
    }
    .gazette-page-container {
        background: transparent !important;
        padding: 0 !important;
    }
    .gazette-sheet {
        width: 100% !important;
        min-height: auto !important;
        margin: 0 !important;
        padding: 10mm 10mm 12mm 10mm !important;
        box-shadow: none !important;
        border: none !important;
        page-break-after: always;
    }
    .gazette-sheet:last-child {
        page-break-after: auto;
    }
    @page {
        size: A4 portrait;
        margin: 8mm 8mm 8mm 8mm;
    }
}
