/* Google Fonts & Web Fonts */
@import url("https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.8/dist/web/static/pretendard.css");

:root {
    /* Sophisticated Crayon Palette (Modern Primary Colors) */
    /* 유치하지 않은, 깊이감 있는 4원색 */
    --color-red: #E05252;
    /* Warm Matte Red */
    --color-yellow: #F5C345;
    /* Deep Honey Yellow */
    --color-blue: #4B89DC;
    /* Calm Cobalt Blue */
    --color-green: #48B47E;
    /* Natural Green */

    --color-paper: #FFFEF8;
    /* Warm Paper Texture Background */
    --color-ink: #2D3436;
    /* Dark Charcoal Text */
    --color-ink-light: #636E72;

    /* Crayon Texture Borders (Organic Radius) */
    --crayon-border: 3px solid var(--color-ink);
    --radius-blob-1: 60% 40% 30% 70% / 60% 30% 70% 40%;
    --radius-blob-2: 30% 70% 70% 30% / 30% 30% 70% 70%;
    --radius-sketchy: 255px 15px 225px 15px / 15px 225px 15px 255px;
}

/* Global Styles */
body {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    color: var(--color-ink);
    background-color: var(--color-paper);
    line-height: 1.7;
    overflow-x: hidden;
    /* 아주 미세한 종이 노이즈 효과 (Optional) */
    background-image: linear-gradient(var(--color-paper), var(--color-paper));
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: 'Pretendard', sans-serif;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: var(--color-ink);
}

/* Color Utilities */
.text-red {
    color: var(--color-red) !important;
}

.text-yellow {
    color: var(--color-yellow) !important;
}

.text-blue {
    color: var(--color-blue) !important;
}

.text-green {
    color: var(--color-green) !important;
}

.text-ink {
    color: var(--color-ink) !important;
}

.bg-red-soft {
    background-color: rgba(224, 82, 82, 0.1);
}

.bg-yellow-soft {
    background-color: rgba(245, 195, 69, 0.1);
}

.bg-blue-soft {
    background-color: rgba(75, 137, 220, 0.1);
}

.bg-green-soft {
    background-color: rgba(72, 180, 126, 0.1);
}

.bg-light-mesh {
    background-color: #f8f9fa;
    background-image: linear-gradient(rgba(45, 52, 54, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(45, 52, 54, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* Crayon Scribble Underline Effect */
.crayon-underline {
    position: relative;
    display: inline-block;
    z-index: 1;
}

.crayon-underline::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: -5%;
    width: 0%;
    /* Start with 0 width */
    height: 12px;
    background-color: var(--u-color, var(--color-yellow));
    z-index: -1;
    opacity: 0.6;
    border-radius: 20px 5px 25px 5px;
    transform: rotate(-1deg);
    transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1);
    /* Scribble ease */
}

.crayon-underline.active::after {
    width: 110%;
    /* End state */
}

.u-red {
    --u-color: var(--color-red);
}

.u-blue {
    --u-color: var(--color-blue);
}

.u-green {
    --u-color: var(--color-green);
}

/* Navigation */
.navbar {
    padding: 20px 0;
    transition: all 0.3s ease;
    background: transparent;
}

.navbar.scrolled {
    background: rgba(255, 254, 248, 0.95) !important;
    border-bottom: 2px dashed rgba(45, 52, 54, 0.1);
    padding: 15px 0;
}

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

.nav-link {
    font-weight: 700;
    color: var(--color-ink-light) !important;
    margin-left: 20px;
    font-size: 1rem;
    transition: color 0.2s;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-ink) !important;
    position: relative;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: var(--color-red);
    border-radius: 100% 0% 100% 0% / 0% 100% 0% 100%;
}

/* Hero Section */
#home {
    position: relative;
    padding-top: 80px;
}

/* Sketchy Box (Crayon Border Card) */
.sketchy-card {
    background: white;
    padding: 2rem;
    border: 3px solid var(--color-ink);
    border-radius: var(--radius-sketchy);
    /* 손으로 그린 듯한 삐뚤빼뚤 보더 */
    box-shadow: 8px 8px 0px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.2s ease;
    height: 100%;
}

.sketchy-card:hover {
    transform: translate(-3px, -3px) rotate(0.5deg);
    box-shadow: 12px 12px 0px rgba(0, 0, 0, 0.15);
}

/* Color Accents for Cards */
.border-red {
    border-color: var(--color-red);
}

.border-blue {
    border-color: var(--color-blue);
}

.border-yellow {
    border-color: var(--color-yellow);
}

.border-green {
    border-color: var(--color-green);
}

.shadow-red:hover {
    box-shadow: 10px 10px 0px var(--color-red);
    border-color: var(--color-ink);
}

.shadow-blue:hover {
    box-shadow: 10px 10px 0px var(--color-blue);
    border-color: var(--color-ink);
}

.shadow-yellow:hover {
    box-shadow: 10px 10px 0px var(--color-yellow);
    border-color: var(--color-ink);
}

.shadow-green:hover {
    box-shadow: 10px 10px 0px var(--color-green);
    border-color: var(--color-ink);
}

/* Specialist Drawing Frame */
.drawing-frame {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    background-color: white;
    border: 3px solid var(--color-ink);
    border-radius: 50% 50% 50% 50% / 60% 40% 60% 40%;
    /* Slightly organic circle */
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.drawing-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    /* Smooth slower zoom */
}

.drawing-frame::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.03);
    pointer-events: none;
    z-index: 2;
    /* Rough Texture Overlay */
}

/* Container Hover Scripts */
.col-md-4:hover .drawing-frame {
    transform: rotate(2deg);
    /* Morph & Rotate wrapper */
    border-radius: 40% 60% 30% 70% / 50% 30% 70% 50%;
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.1);
}

.col-md-4:hover .drawing-frame img {
    transform: scale(1.15);
    /* Zoom inner image */
}

/* Archive Stickers */
.sticker-badge {
    display: inline-block;
    padding: 5px 12px;
    font-weight: 700;
    font-size: 0.8rem;
    color: white;
    background-color: var(--color-ink);
    border-radius: 255px 15px 225px 15px / 15px 225px 15px 255px;
    transform: rotate(-2deg);
    margin-bottom: 1rem;
}

.bg-sticker-red {
    background-color: var(--color-red);
}

.bg-sticker-blue {
    background-color: var(--color-blue);
}

.bg-sticker-green {
    background-color: var(--color-green);
}

/* Buttons: Round Capsule Style */
.btn-crayon {
    display: inline-block;
    text-decoration: none;
    background: white;
    color: var(--color-ink);
    border: 2px solid var(--color-ink);
    padding: 12px 35px;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 3px 3px 0px var(--color-ink);
    transition: all 0.2s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.btn-crayon:hover {
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px var(--color-ink);
    background: var(--color-yellow);
    color: var(--color-ink);
}

.btn-crayon-dark {
    display: inline-block;
    text-decoration: none;
    background: var(--color-ink);
    color: white;
    border: 2px solid var(--color-ink);
    padding: 10px 30px;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2);
    transition: all 0.2s ease;
}

.btn-crayon-dark:hover {
    background: #444;
    color: white;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px rgba(0, 0, 0, 0.3);
}

.btn-crayon-secondary {
    display: inline-block;
    text-decoration: none;
    background: white;
    color: var(--color-ink-light);
    border: 2px solid #e0e0e0;
    padding: 10px 30px;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 3px 3px 0px #f0f0f0;
    transition: all 0.2s ease;
}

.btn-crayon-secondary:hover {
    border-color: var(--color-ink);
    color: var(--color-ink);
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px #e0e0e0;
}

.btn-crayon-danger {
    display: inline-block;
    text-decoration: none;
    background: white;
    color: var(--color-red);
    border: 2px solid var(--color-red);
    padding: 10px 30px;
    font-weight: 700;
    border-radius: 50px;
    box-shadow: 3px 3px 0px rgba(224, 82, 82, 0.1);
    transition: all 0.2s ease;
}

.btn-crayon-danger:hover {
    background: var(--color-red);
    color: white;
    transform: translateY(-2px);
    box-shadow: 5px 5px 0px rgba(224, 82, 82, 0.3);
}

/* Section Title with Sketch */
.section-title {
    position: relative;
    display: inline-block;
    margin-bottom: 3rem;
    font-size: 2rem;
}

.section-title::before {
    content: '';
    position: absolute;
    top: -10px;
    left: -15px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-yellow);
    z-index: -1;
    opacity: 0.5;
}

/* Scribble Decorations */
.scribble-line {
    height: 3px;
    background: var(--color-ink);
    width: 60px;
    margin: 10px auto;
    border-radius: 50%;
    transform: rotate(-1deg);
}

/* Footer */
footer {
    border-top: 3px dashed rgba(45, 52, 54, 0.1);
    padding-top: 4rem;
    background-color: #fff;
}

/* Board Tabs Override */
.board-tabs .nav-link {
    font-weight: 700;
    margin: 0;
    border: 2px solid var(--color-ink) !important;
    color: var(--color-ink) !important;
    background: white;
    transition: all 0.2s ease;
}

.board-tabs .nav-link:hover {
    background: var(--color-paper);
    transform: translateY(-2px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1);
}

.board-tabs .nav-link.active {
    background: var(--color-ink) !important;
    color: white !important;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.2) !important;
    border-color: var(--color-ink) !important;
}

.board-tabs .nav-link.active::after {
    display: none !important;
}

/* Pagination (Crayon Style) - Minimal & Clean */
.pagination {
    gap: 6px;
    --bs-pagination-focus-box-shadow: none;
}

.pagination .page-item .page-link {
    color: var(--color-ink-light) !important;
    /* Lighter text */
    background-color: white !important;
    border: 1px solid #ddd !important;
    /* Lighter border initially */
    border-radius: 50% !important;
    width: 38px;
    height: 38px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin: 0;
    transition: all 0.2s ease;
    box-shadow: none !important;
}

.pagination .page-item .page-link:hover {
    color: var(--color-ink) !important;
    border-color: var(--color-ink) !important;
    background-color: #fff !important;
    transform: translateY(-2px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.1) !important;
    /* Subtle shadow */
}

.pagination .page-item.active .page-link {
    background-color: var(--color-yellow) !important;
    /* Yellow Point */
    color: var(--color-ink) !important;
    border: 2px solid var(--color-ink) !important;
    /* Bold border for active */
    font-weight: 800;
    transform: translateY(-1px);
    box-shadow: 2px 2px 0px rgba(0, 0, 0, 0.15) !important;
    z-index: 1;
}

/* Segmented Control (Unified Pill Tab) */
.segmented-control {
    display: inline-flex;
    border: 2px solid var(--color-ink);
    border-radius: 50px;
    background: white;
    box-shadow: 3px 3px 0px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 2rem;
}

.segmented-control a {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 40px;
    text-decoration: none;
    color: var(--color-ink);
    font-weight: 700;
    background: white;
    border-right: 2px solid var(--color-ink);
    transition: all 0.2s ease;
    min-width: 120px;
}

.segmented-control a:last-child {
    border-right: none;
}

.segmented-control a:hover {
    background: #e7f5ff;
    color: var(--color-blue);
}

.segmented-control a.active {
    background: var(--color-yellow);
    color: var(--color-ink);
    box-shadow: inset 0 3px 5px rgba(0, 0, 0, 0.05);
}

/* Paper Sheet - Card Style for Board Lists */
.paper-sheet {
    background: #fff;
    padding: 2rem;
    border: 1px solid #eee;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    position: relative;
    border-radius: 2px;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    display: block;
    color: var(--color-ink);
}

.paper-sheet:hover {
    transform: scale(1.02) rotate(-1deg);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    z-index: 5;
    color: var(--color-ink);
}

.paper-sheet::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(to right, var(--color-red), var(--color-yellow), var(--color-blue), var(--color-green));
}

.video-card {
    border: none;
    overflow: hidden;
    border-radius: 12px;
    background: #fff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.video-thumb-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    /* 16:9 Aspect Ratio */
    overflow: hidden;
    background: #000;
}

.video-thumb {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.9;
    transition: opacity 0.3s ease, transform 0.5s ease;
}

.video-card:hover .video-thumb {
    opacity: 1;
    transform: scale(1.05);
    /* Zoom effect */
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 60px;
    height: 60px;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(4px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, 0.6);
    transition: all 0.3s ease;
}

.video-card:hover .play-overlay {
    background: var(--color-red);
    border-color: var(--color-red);
    transform: translate(-50%, -50%) scale(1.1);
}

.play-icon {
    color: white;
    font-size: 24px;
    margin-left: 4px;
    /* Optical adjustment */
}

.video-title {
    font-family: 'Pretendard', sans-serif;
    font-weight: 700;
    font-size: 1.1rem;
    color: var(--color-ink);
    margin-top: 0;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Board Table Styling (Mockup Style) */
.board-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0 10px;
    /* Row spacing */
}

.board-table thead th {
    border: none;
    padding: 15px;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--color-ink);
    text-align: center;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 8px;
}

.board-row {
    background: white;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}

.board-row:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    background: #fffdf0;
    /* Slight yellow tint like paper */
}

.board-row td {
    padding: 20px 15px;
    vertical-align: middle;
    border-top: 1px solid #eee;
    border-bottom: 1px solid #eee;
}

.board-row td:first-child {
    border-left: 1px solid #eee;
    border-top-left-radius: 12px;
    border-bottom-left-radius: 12px;
}

.board-row td:last-child {
    border-right: 1px solid #eee;
    border-top-right-radius: 12px;
    border-bottom-right-radius: 12px;
}

.status-badge {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-waiting {
    background-color: #ffeeba;
    color: #856404;
}

.status-done {
    background-color: #d4edda;
    color: #155724;
}

.secret-icon {
    font-size: 0.8rem;
    margin-right: 5px;
    color: #ccc;
}

/* Mobile Responsive for Board */
@media (max-width: 768px) {
    .board-table thead {
        display: none;
    }

    .board-table,
    .board-table tbody {
        display: block;
        width: 100%;
    }

    .board-row {
        display: flex;
        flex-direction: column;
        background: #fff;
        margin-bottom: 15px;
        padding: 20px;
        border-radius: 16px;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
        /* Softer shadow */
        border: 1px solid #f0f0f0;
        position: relative;
        /* Context for absolute positioning */
    }

    .board-row td {
        display: block;
        padding: 0;
        border: none !important;
        text-align: left !important;
        background: transparent !important;
    }


    /* 1. Title (Main) */
    .board-row td:nth-child(2) {
        font-size: 1.15rem;
        /* Larger title */
        font-weight: 700;
        margin-bottom: 20px;
        /* Space between title and author */
        line-height: 1.4;
        color: var(--color-ink);
        width: 100%;
        padding-right: 90px !important;
        /* Avoid Date overlap */
        box-sizing: border-box;
    }

    .board-row td:nth-child(2) .secret-icon {
        vertical-align: middle;
    }

    /* 2. Author (Bottom) */
    .board-row td:nth-child(3) {
        font-size: 0.9rem;
        color: #666;
        background: #f8f9fa !important;
        /* Slight bg for author area */
        padding: 8px 12px !important;
        border-radius: 8px;
        align-self: flex-start;
        /* Don't stretch */
        display: inline-block;
    }

    .board-row td:nth-child(3)::before {
        content: '작성자: ';
        color: #aaa;
        font-weight: normal;
        margin-right: 4px;
    }

    /* 3. Date (Top Right - Absolute) */
    .board-row td:nth-child(4) {
        position: absolute;
        top: 20px;
        right: 20px;
        font-size: 0.85rem;
        color: #999;
        font-weight: 500;
        text-align: right !important;
    }

    /* Hide No */
    .board-row td:nth-child(1) {
        display: none;
    }
}