@charset "UTF-8";

/* KSMS Premium Board Theme */
:root {
    --ksms-navy: #00397f;
    --ksms-blue-light: #f0f7ff;
    --ksms-text-dark: #1d1d1f;
    --ksms-gray: #666;
    --ksms-border: #eee;
}

/* 1. Typography */
/* 1. Typography & Container Style */
/* 1. Typography & Container Style */
#aplosboard.board-wrapper {
    font-family: 'Pretendard', sans-serif !important;
    color: var(--ksms-text-dark);
    
    /* Layout Design Inheritance (Card Style) */
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05); /* Soft Shadow */
    margin-top: 0px !important; /* Set to 0 per user request for premium header look */
    padding: 0px 30px 30px 30px; /* Zero top padding to align header to top */
    border: 1px solid rgba(0,0,0,0.02);
    overflow: hidden; /* Contain the glassmorphic header and background glow */
    position: relative; /* Ensure z-index works */
    display: block; /* Ensure margin applies */
}

/* Mobile Optimizations */
@media (max-width: 768px) {
    #aplosboard.board-wrapper {
        margin: 15px 0px 0px 0px !important; /* Creates float effect like PC but flush on sides */
        padding-left: 0px !important; /* Remove inner padding to align with header globally */
        padding-right: 0px !important;
        padding-top: 0px !important; /* Seamless connection to header */
        padding-bottom: 20px !important;
        border-radius: 20px !important; /* PC-like rounded corners */
        box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important;
        border: 1px solid rgba(0,0,0,0.02) !important;
    }
    
    /* Document Read View Padding (Prevents text from touching edges) */
    .absc.article {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* --- [NEW] Sci-Fi Board Header Design (Reactive Plexus Canvas) --- */
.ksms-premium-header.sci-fi {
    position: relative;
    width: calc(100% + 60px); 
    margin-left: -30px; 
    margin-top: 5px; /* 5px margin on PC */
    margin-bottom: 25px;
    padding: 25px 35px; /* balanced */
    background: #05070a; /* Darker tech space */
    border-bottom: 1px solid hsla(var(--scifi-hue, 210), 80%, 60%, 0.2);
    overflow: hidden; /* strictly confines the canvas inside the header */
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
}

#ksmsAreaCanvas {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    z-index: 0;
    pointer-events: auto; /* Allow mouse interaction */
}

.header-inner {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    pointer-events: none; /* Pass mouse events to Canvas */
}
.header-inner > * { pointer-events: auto; }

.header-left {
    display: flex;
    flex-direction: column;
}

.scifi-metrics {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 8px;
}
.pulse-dot {
    width: 6px; height: 6px;
    background: hsl(var(--scifi-hue, 210), 80%, 60%);
    border-radius: 50%;
    box-shadow: 0 0 8px hsl(var(--scifi-hue, 210), 80%, 60%);
    animation: pulseScan 1.5s infinite alternate;
}
@keyframes pulseScan {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.5); opacity: 0.2; }
}

.metrics-text {
    font-size: 10px;
    font-family: 'Space Grotesk', sans-serif;
    color: rgba(255,255,255,0.4);
    letter-spacing: 2px;
}
.metrics-text span {
    color: hsl(var(--scifi-hue, 210), 80%, 60%);
    font-weight: 700;
}

.main-title {
    font-family: 'Krona One', sans-serif;
    font-size: 26px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.1;
    letter-spacing: -1px;
    text-shadow: 0 0 15px rgba(255,255,255,0.1);
}

.header-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    text-align: right;
}

.stat-box {
    background: rgba(255,255,255, 0.03);
    border: 1px solid hsla(var(--scifi-hue, 210), 80%, 60%, 0.2);
    padding: 8px 15px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-label {
    font-size: 10px;
    font-weight: 800;
    color: hsl(var(--scifi-hue, 210), 80%, 60%);
    letter-spacing: 2px;
}

.stat-value {
    font-family: 'Krona One', sans-serif;
    font-size: 18px;
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255,255,255,0.3);
}

/* Custom Text Load/Scramble Animation */
.scramble-text {
    display: inline-block;
    animation: scrambleFadeIn 0.5s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

@keyframes scrambleFadeIn {
    0% {
        opacity: 0;
        filter: blur(10px);
        transform: translateX(-10px);
        color: hsl(var(--scifi-hue, 210), 80%, 60%);
    }
    100% {
        opacity: 1;
        filter: blur(0);
        transform: translateX(0);
        color: #ffffff;
    }
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .ksms-premium-header.sci-fi {
        width: 100%;
        margin-left: 0px;
        margin-top: 0; /* No top margin on mobile */
        padding: 20px 15px;
        border-radius: 0;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }
    .header-inner { flex-direction: column; align-items: flex-start; gap: 15px; }
    .main-title { font-size: 20px; }
    .header-right { align-self: flex-start; }
}



/* 2. Point Colors (Overrides) */
.ab-btn-point, .ab-point-color, i.read {
    color: var(--ksms-navy) !important;
}

/* Backgrounds */
.absc.pgnt .pagination-num.this, 
.ab-point-bgcolor, 
ul.lv-1 li:not(.on) ~ div .ui-slider-range, 
ul.lv-1 .ui-state-active {
    background-color: var(--ksms-navy) !important;
}

/* Borders */
.ab-point-bacolor, ul.lv-1 .ui-state-active {
    border-color: var(--ksms-navy) !important;
}

/* 3. Table Header Style */
.absc.list .ab-table thead th {
    background-color: #f9fbfd;
    border-top: 2px solid var(--ksms-navy);
    border-bottom: 1px solid var(--ksms-border);
    color: var(--ksms-navy);
    font-weight: 700;
    padding: 15px 10px;
}

/* 4. Table Body Style */
.absc.list .ab-table tbody tr {
    border-bottom: 1px solid var(--ksms-border);
}
.absc.list .ab-table tbody tr:hover {
    background-color: var(--ksms-blue-light);
}

/* 5. Buttons */
.board-wrapper .ab-btn {
    border-radius: 4px;
    font-weight: 500;
    transition: all 0.2s;
}

/* Write Button (Primary) */
.ab-btn-point {
    background-color: var(--ksms-navy) !important;
    color: #fff !important;
    border: 1px solid var(--ksms-navy) !important;
}
.ab-btn-point:hover {
    background-color: #002a5c !important;
    border-color: #002a5c !important;
}

/* 6. Pagination */
.absc.pgnt .pagination-num {
    border-radius: 4px;
    color: var(--ksms-gray);
}
.absc.pgnt .pagination-num.this {
    background-color: var(--ksms-navy);
    color: #fff;
    font-weight: bold;
}

/* 7. Search Bar */
.board-wrapper input[type=text]:focus {
    border-color: var(--ksms-navy);
    box-shadow: 0 0 0 2px rgba(0, 57, 127, 0.1);
}

/* 8. Category Tabs (if used) */
.absc.category .lv-1 .lv-1-item.on a {
    color: var(--ksms-navy);
    border-bottom: 2px solid var(--ksms-navy);
}

/* 9. Mobile Table Optimization (Card Style) */
@media (max-width: 768px) {
    /* Hide Table Header */
    .absc.list .ab-table thead { display: none; }

    /* --- Mobile Card Layout (Force Override) --- */
    
    /* 1. Reset Table Structure */
    #aplosboard .absc.list .ab-table,
    #aplosboard .absc.list .ab-table tbody,
    #aplosboard .absc.list .ab-table tr,
    #aplosboard .absc.list .ab-table td {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    /* 2. Hide Header */
    #aplosboard .absc.list .ab-table thead {
        display: none !important;
    }

    /* 3. Card Container (Row) */
    #aplosboard .absc.list .ab-table tbody tr {
        background: #fff !important;
        margin-bottom: 12px !important;
        padding: 15px !important;
        border-radius: 12px !important;
        box-shadow: 0 2px 8px rgba(0,0,0,0.08) !important;
        border: 1px solid #eef0f2 !important;
        position: relative !important;
    }

    /* 4. Cell Styles */
    #aplosboard .absc.list .ab-table td {
        padding: 2px 0 !important;
        border: none !important;
        text-align: left !important;
        white-space: normal !important; /* Fix horizontal scroll */
    }

    /* 5. Title Styling */
    #aplosboard .absc.list .ab-table td.title {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #333 !important;
        margin-bottom: 8px !important;
        line-height: 1.4 !important;
        padding-top: 0 !important;
    }
    #aplosboard .absc.list .ab-table td.title a {
        color: #1a1a1a !important;
    }
    
    /* 6. Meta Data (Date, Author, etc.) */
    #aplosboard .absc.list .ab-table td:not(.title) {
        font-size: 13px !important;
        color: #888 !important;
        display: inline-block !important; /* Allow side-by-side if width allows, but we set width 100% above... let's override width for meta */
        width: auto !important;
        margin-right: 10px !important;
    }
    
    /* Hide some columns if needed (optional) */
    /* .absc.list .ab-table td.m_no { display: none !important; } */

    /* Notice Specifics */
    #aplosboard .absc.list .ab-table tr.notice {
        background-color: #f8fbff !important;
        border-color: #cce5ff !important;
    }
}
/* --- Schedule Calendar Widget --- */
.ksms-calendar-wrapper {
    margin-bottom: 30px;
    background: #fff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.02);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-header h2 {
    font-size: 24px;
    font-weight: 700;
    color: var(--ksms-navy);
    margin: 0;
    font-family: 'Krona One', sans-serif;
    letter-spacing: -0.5px;
}

.cal-btn {
    background: none;
    border: 1px solid #eee;
    width: 40px; height: 40px;
    border-radius: 12px;
    cursor: pointer;
    color: #555;
    transition: all 0.2s;
    display: flex; justify-content: center; align-items: center;
}

.cal-btn:hover {
    background: var(--ksms-navy);
    color: #fff;
    border-color: var(--ksms-navy);
}

.cal-btn.today-btn {
    width: auto;
    padding: 0 15px;
    font-size: 14px;
    font-weight: 600;
}

/* Calendar Grid */
.calendar-body {
    width: 100%;
}

.weekdays {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    text-align: center;
    margin-bottom: 10px;
}

.weekdays div {
    font-size: 13px;
    font-weight: 700;
    color: #888;
    padding: 10px 0;
}

.weekdays div:first-child { color: #e74c3c; } /* Sunday Red */
.weekdays div:last-child { color: #3498db; }  /* Saturday Blue */

.days {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
}

.day {
    padding: 10px;
    height: 80px; /* PC Height */
    border-radius: 12px;
    background: #fdfdfd;
    border: 1px solid #f5f5f5;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    display: flex;
    justify-content: flex-start;
    align-items: flex-start;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.day:hover {
    background: #f0f7ff;
    border-color: #dbeafe;
    color: var(--ksms-navy);
}

.day.prev-date, .day.next-date {
    opacity: 0.3;
    background: #fafafa;
}

/* Holiday & Sunday Styles */
.day.sunday, .day.holiday {
    color: #e74c3c !important;
}

.day.holiday {
    background: #fff5f5;
    border-color: #ffebeb;
}

.day.today {
    background: var(--ksms-navy);
    color: #fff !important;
    border-color: var(--ksms-navy);
    font-weight: 700;
    box-shadow: 0 4px 10px rgba(0, 57, 127, 0.2);
    z-index: 10;
}

.day .num {
    position: relative;
    z-index: 1;
}

.holiday-name {
    position: absolute;
    bottom: 5px;
    left: 5px;
    width: calc(100% - 10px);
    font-size: 11px;
    color: #e74c3c;
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 600;
    line-height: 1.2;
}

.day.today .holiday-name {
    color: #ffcccc; /* Lighter red on dark blue background */
}

/* Response (Mobile) */
@media (max-width: 768px) {
    .ksms-calendar-wrapper { padding: 20px; }
    .calendar-header h2 { font-size: 20px; }
    .day {
        height: 65px; /* Increased height to accommodate wrapped holiday names */
        justify-content: center;
        align-items: center;
        font-size: 14px;
        border-radius: 8px; /* Changed from 50% circle to rounded square for better fit */
        border: none;
        background: transparent;
        flex-direction: column; /* Stack num and name */
        gap: 0;
    }
    .days { gap: 2px; }
    .day:hover { background: #f0f7ff; }
    
    .day.holiday { background: transparent; } /* Remove bg on mobile for cleaner look */
    .day.today { border-radius: 50%; }
    
    .holiday-name {
        position: static; /* Stack below number */
        font-size: 9px;
        width: 100%;
        max-width: 95%;
        text-align: center;
        margin-top: -2px;
        letter-spacing: -0.4px;
        white-space: normal;
        word-break: keep-all;
        line-height: 1.1;
        display: block;
    }
    
    .cal-btn { width: 36px; height: 36px; }
    .cal-btn.today-btn { padding: 0 12px; font-size: 12px; }
}

/* --- [NEW] Board List Column Adjustments --- */
/* Prevent "Author (글쓴이)" and "Date (날짜)" from wrapping to the next line */
.absc.list .ab-table td.author,
.absc.list .ab-table th.author,
.absc.list .ab-table td.date,
.absc.list .ab-table th.date {
    white-space: nowrap !important;
    word-break: keep-all !important;
}

/* --- [NEW] Mobile Write Button Adjustments --- */
@media (max-width: 768px) {
    .absc.tool .fr .ab-btn-write {
        margin-right: 15px; /* Move the button slightly to the left */
    }
}
