@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
:root {
/* Fonts */
--font-primary: "Montserrat", sans-serif;

/* Base Colors */
--color-bg: #f4f7f6;
--color-text-main: #222222;
--color-text-muted: #444444;
--color-text-light: #999999;

--color-white: #ffffff;

/* Brand & State Colors */
--color-primary: #124b65;
--color-primary-rgb: 18, 75, 101;
--color-secondary: #00b4d8;
--color-secondary-rgb: 0, 180, 216;
--color-light: #e7f1ff;
--color-light-rgb: 231, 241, 255;

--color-success: #28a745;
--color-success-hover: #218838;
--color-success-bg: #d4edda;
--color-success-text: #155724;
--color-success-border: #c3e6cb;

--color-danger: #dc3545;
--color-danger-hover: #bd2130;
--color-danger-bg: #f8d7da;
--color-danger-text: #721c24;
--color-danger-border: #f5c6cb;

/* Structural & Border Colors */
--color-border: #008687;
--color-border-rgb: 0, 134, 135;
--color-border-light: #dddddd;
--color-border-subtle: #eeeeee;
--color-tab-bg: #f1f1f1;
--color-box-bg: #f8f9fa;


}

body {
    position: relative;
    font-family: var(--font-primary);
    background: var(--color-bg);
    margin: 0px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-primary);
    font-weight: 600;
}

/* Hero Section Custom Styles */
.university-hero {
    position: relative;
    background-image: url(assets/hero-bg.png);
    background-size: cover;
    background-repeat: no-repeat;
    background-position: center;
    color: #ffffff;
    padding: 80px 20px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.university-hero::before {
    content: '';
    position: absolute;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary) 100%);
    opacity: 0.85;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
}

.hero-container {
    position: relative;
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
    text-align: center;
}

.hero-brand {
    display: flex;
    align-items: center;
    gap: 20px;
}

.hero-logo {
    width: 70px;
    height: 70px;
    object-fit: contain;
}
.hero-titles h1 {
    font-size: 30px;
    margin: 0 0 5px 0;
    font-weight: 700;
    letter-spacing: 0.5px;
}
.hero-titles p {
    font-size: 16px;
    margin: 0;
    color: rgba(255, 255, 255, 0.75);
}
.hero-badge {
    background: rgba(255, 255, 255, 0.15);
    padding: 8px 15px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 500;
    border: 1px solid rgba(255, 255, 255, 0.3);
}
@media (max-width: 768px) {
    .hero-container {
        flex-direction: column;
        text-align: center;
    }
    .hero-brand {
        flex-direction: column;
    }
}

/* --- GLOBAL HEADER STYLES --- */
.site-header {
    background-color: #ffffff;
    border-bottom: 1px solid #e2e8f0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 12px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.logo-icon {
    font-size: 24px;
    color: var(--color-primary, #0066cc);
}

.brand-title {
    font-size: 20px;
    font-weight: 700;
    color: #1e293b;
    letter-spacing: -0.5px;
}

.header-nav {
    display: flex;
    gap: 15px;
}

.nav-item {
    text-decoration: none;
    color: #64748b;
    font-weight: 500;
    font-size: 14px;
    padding: 8px 14px;
    border-radius: 6px;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 6px;
}

.nav-item:hover {
    color: var(--color-primary, #0066cc);
    background-color: #f1f5f9;
}

.nav-item.active {
    color: var(--color-primary, #0066cc);
    background-color: #e0f2fe;
    font-weight: 600;
}

/* --- MAIN WRAPPER ADJUSTMENT --- */
.main-wrapper {
    min-height: calc(100vh - 140px);
    padding: 20px 10px;
}

/* --- GLOBAL FOOTER STYLES --- */
.site-footer {
    background-color: #113c52;
    color: var(--color-white);
    padding: 30px 20px;
    margin-top: 40px;
    font-size: 14px;
}

.site-footer strong {
    font-weight: 600;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.footer-left p {
    margin: 3px 0;
}

.footer-subtext {
    font-size: 12px;
    color: var(--color-light);
}

.footer-right {
    display: flex;
    gap: 15px;
    color: var(--color-light);
}

.footer-right a {
    color: #ffffff;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-right a:hover {
    color: var(--color-secondary);
}

/* Responsive navigation for mobile screens */
@media (max-width: 768px) {
    .header-container, .footer-container {
        flex-direction: column;
        gap: 12px;
        text-align: center;
    }
    
    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
}

.card {
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    margin: 0 auto;
}

.section-title {
    background-color: rgba(var(--color-primary-rgb), 0.2);
    color: var(--color-text-main);
    text-align: center;
    text-transform: uppercase;
    padding: 10px 10px;
    font-size: 20px;
    margin-top: 0px;
}

/* Main Tabs */
.tabs,
.sub-tabs {
    display: flex;
    margin-bottom: 20px;
    border-bottom: 2px solid var(--color-secondary);
    gap: 10px;
}

.tabs .tab-btn,
.sub-tabs .sub-tab-btn {
    min-width: 120px;
    flex: 1;
    color: var(--color-text-main);
    background: rgba(var(--color-secondary-rgb), 0.08);
    border: none;
    border-radius: 0px;
    padding: 10px;
    font-family: var(--font-primary);
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-radius: 6px 6px 0px 0px;
    transition: background 0.3s, color 0.3s;
}

/* .tabs .tab-btn:first-child,
.sub-tabs .sub-tab-btn:first-child {
    border-radius: 4px 0px 0px 4px;
}

.tabs .tab-btn:last-child,
.sub-tabs .sub-tab-btn:last-child {
    border-radius: 0px 4px 4px 0px;
} */

.tabs .tab-btn.active ,
.tabs .tab-btn:hover {
    background: var(--color-secondary);
    color: var(--color-white);
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

/* Sub-Menu Buttons for PDF Tools */
.sub-tabs {
    border-bottom: 2px solid rgba(var(--color-secondary-rgb), 0.1);
}

.sub-tabs .sub-tab-btn {    
    font-size: 13px;
}

.sub-tabs .sub-tab-btn.active ,
.sub-tabs .sub-tab-btn:hover {
    background-color: rgba(var(--color-secondary-rgb), 0.15);
    color: var(--color-secondary);
}

.sub-tab-content {
    display: none;
}
.sub-tab-content.active {
    display: block;
}

/* Form Styles */
.form-group {
    margin-bottom: 15px;
}
label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--color-label);
    font-size: 14px;
}
input[type="number"], input[type="file"], select, input[type="text"], input[type="date"] {
    width: 100%;
    padding: 8px;
    box-sizing: border-box;
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-family: var(--font-primary);
}

input[type="range"] {
  accent-color: var(--color-primary); /* Changes the slider accent to main color */
}

.row {
    display: flex;
    gap: 10px;
}
.row .form-group {
    flex: 1;
}

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}
.checkbox-group input {
    width: auto;
}
.checkbox-group label {
    margin-bottom: 0;
    font-weight: normal;
    cursor: pointer;
}

button[type="button"], button[type="submit"] {
    background: var(--color-secondary);
    color: white;
    border: none;
    padding: 10px 15px;
    width: 100%;
    border-radius: 4px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    font-family: var(--font-primary);
}
button[type="button"]:hover, button[type="submit"]:hover {
    background: var(--color-secondary);
}

/* Containers & Grids */
.img-container {
    max-height: 350px;
    min-height: 150px;
    width: 100%;
    background-color: #f8f9fa;
    overflow: hidden;
    margin-top: 10px;
    border: 1px dashed var(--color-border);
    border-radius: 4px;
    display: none;
}

.img-container img {
    max-width: 100%;
    display: block;
}

img {
    max-width: 100%;
}

.pdf-grid, #pdfMergeGrid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 12px;
    max-height: 300px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border: 1px dashed var(--color-border);
    border-radius: 4px;
    margin: 10px 0px;
}
.pdf-page-card, .pdf-merge-card {
    border: 1px solid rgba(var(--color-border-rgb), 0);
    border-radius: 6px;
    padding: 6px;
    text-align: center;
    background: var(--color-light);
    cursor: pointer;
    transition: 0.2s;
    position: relative;
    overflow: hidden;
}
.pdf-page-card.selected, .pdf-merge-card.selected {
    border-color: var(--color-primary);
    background: var(--color-light);
}
.pdf-merge-card {
    cursor: grab;
}
.pdf-merge-card:active {
    cursor: grabbing;
}
.pdf-merge-card.dragging {
    opacity: 0.4;
    background: var(--color-light);
    border-color: var(--color-primary);
}
.pdf-page-card canvas, .pdf-merge-card canvas {
    max-width: 100%;
    height: auto;
    border-radius: 3px;
    border: 1px solid #eee;
}
.pdf-page-card span, .pdf-merge-card .file-title {
    font-size: 11px;
    font-weight: 400;
    color: var(--color-text-main);
    margin-top: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    display: block;
}

.pdf-merge-card .file-serial {
    position: absolute;
    top: 4px;
    left: 4px;
    background: var(--color-text-main);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px;
    transition: background 0.2s;
}

.pdf-merge-card .remove-card-btn {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--color-danger);
    color: var(--color-white);
    border: none;
    border-radius: 50%;
    width: 26px;
    height: 26px;
    font-size: 20px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0px;
    transition: background 0.2s;
}

.pdf-merge-card .remove-card-btn:hover {
    background: var(--color-danger-hover);
}

/* Alerts & Results */
.alert-error {
    background: var(--color-error-bg);
    color: var(--color-error-text);
    padding: 10px;
    border-radius: 4px;
    margin-top: 15px;
    border: 1px solid var(--color-error-border);
    font-size: 14px;
}
.result-box {
    background: var(--color-success-bg);
    color: var(--color-success-text);
    padding: 15px;
    border-radius: 4px;
    margin-top: 15px;
    border: 1px solid var(--color-success-border);
    text-align: center;
}
.btn-download {
    display: inline-block;
    background: var(--color-success);
    color: white;
    padding: 8px 15px;
    text-decoration: none;
    border-radius: 4px;
    margin-top: 10px;
    font-weight: 600;
}
.btn-download:hover {
    background: var(--color-success-hover);
}

button.btn-reset {
    background: #6c757d;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-family: var(--font-primary);
}
button.btn-reset:hover {
    background: #5a6268;
}

/* Calculator */
.calcGeneralBox {
    margin: 0 auto;
    background: var(--color-white);
    padding: 15px;
    border: 2px solid var(--color-primary);
    border-radius: 10px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.calcDisplay {
    height: 50px;
    background: var(--color-primary);
    color: #fff;
    text-align: right;
    font-size: 24px;
    padding: 10px;
    border: none;
    border-radius: 6px;
    margin-bottom: 10px;
}

#calcLiveResult {
    color: #00d4ff;
    min-height: 20px;
    font-size: 16px;
    font-weight: 500;
    overflow-x: auto;
}

input#calcNumber {
    font-size: 24px;
    padding: 10px 0px;
    border: none;
    outline: none;
}

.calcAgeInner {
    display: flex;
    align-items: center;
    gap: 20px;
}

.calcAgeInner .form-group {
    flex: 1;
}

.calcGeneralBox button {
    font-size: 20px;
}

/* --- ADVERTISING SPACES --- */
.ad-container {
    display: flex;
    justify-content: center;
    margin: 15px 0;
}
.ad-box {
    background: #e2e8f0;
    border: 1px dashed #cbd5e1;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    border-radius: 4px;
}
.ad-728x90 { width: 728px; height: 90px; }
.ad-160x600 { width: 160px; height: 600px; }

/* Page Body Flex Layout */
.page-body-container {
    display: flex;
    max-width: 1200px;
    margin: 0 auto;
    gap: 15px;
    justify-content: center;
}

.main-wrapper {
    flex: 1;
    max-width: 800px;
}

.ad-sidebar {
    display: block;
}

/* --- HEADER AUTH BUTTONS --- */
.header-auth {
    display: flex;
    align-items: center;
    gap: 10px;
}

.btn-auth-login {
    background: var(--color-primary);
    color: white;
    border: none;
    padding: 8px 14px;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    text-decoration: none;
}
.btn-auth-logout {
    background: #dc3545;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}
.user-welcome {
    font-size: 13px;
    color: #334155;
    font-weight: bold;
}

/* --- AUTH MODAL --- */
.modal-backdrop {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-card {
    background: white;
    padding: 25px;
    border-radius: 8px;
    width: 320px;
    position: relative;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}
.modal-close {
    position: absolute;
    top: 10px; right: 12px;
    border: none; background: transparent;
    font-size: 20px; cursor: pointer; color: #888;
}

/* Responsive Ads Hiding on Small Screens */
@media (max-width: 1024px) {
    .ad-sidebar { display: none; }
    .ad-728x90 { width: 100%; max-width: 728px; }
}