/* Google Fonts Import */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+KR:wght@300;400;500;700&display=swap');

.welad-calendar-container {
    font-family: 'Noto Sans KR', sans-serif;
    max-width: 900px;
    margin: 40px auto;
    padding: 20px;
    background: #fdfdfd;
    border-radius: 20px;
    /* box-shadow: 0 10px 30px rgba(0,0,0,0.08); */
}

.welad-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 40px;
    background: linear-gradient(135deg, #1e3a8a 0%, #3b82f6 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.welad-timeline {
    position: relative;
    padding: 20px 0;
}

.welad-timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 100%;
    background: #e2e8f0;
    border-radius: 2px;
}

.welad-card {
    position: relative;
    width: 45%;
    font-size: 2.2rem;
    font-weight: 800;
    color: #0f172a;
    margin: 0 0 10px 0;
    line-height: 1.2;
}

.welad-desc {
    color: #64748b;
    font-size: 1.1rem;
    max-width: 600px;
}

/* Month Tabs */
.welad-month-tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    overflow-x: auto;
    padding-bottom: 10px;
}

.welad-month-tabs button {
    background: transparent;
    border: none;
    padding: 8px 16px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
}

.welad-month-tabs button.active {
    border-bottom-color: #2563eb;
}

/* Ministry Filter Chips */
.welad-ministry-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding-bottom: 5px;
}

.welad-ministry-tabs button {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 6px 14px;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.2s;
}

.welad-ministry-tabs button:hover {
    background: #e2e8f0;
    color: #334155;
}

.welad-ministry-tabs button.active {
    background: #3b82f6;
    color: #fff;
    border-color: #3b82f6;
    box-shadow: 0 4px 6px -1px rgba(59, 130, 246, 0.3);
}

/* Grid Layout for Roadmap */
.welad-roadmap-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 24px;
}

/* Roadmap Card */
.welad-roadmap-card {
    background: #ffffff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s, box-shadow 0.2s;
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
}

.welad-roadmap-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.welad-card-top {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
}

.welad-tag {
    background: #eff6ff;
    color: #2563eb;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.welad-d-day {
    color: #94a3b8;
    font-size: 0.8rem;
    font-weight: 500;
}

.welad-d-day.ended {
    color: #cbd5e1;
    text-decoration: line-through;
}

.welad-d-day.today {
    color: #ef4444;
    font-weight: 800;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        opacity: 1;
    }

    50% {
        opacity: 0.6;
    }

    100% {
        opacity: 1;
    }
}

.welad-card-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 6px 0;
    line-height: 1.4;
}

.welad-card-agency {
    font-size: 0.9rem;
    color: #64748b;
    margin-bottom: 20px;
}

.welad-card-info-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f1f5f9;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-item .label {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-bottom: 4px;
}

.info-item .value {
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
}

.welad-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.deadline {
    font-size: 0.8rem;
    color: #ef4444;
    /* Red for deadline */
    font-weight: 600;
    background: #fef2f2;
    padding: 2px 8px;
    border-radius: 4px;
}

.details-link {
    font-size: 0.9rem;
    color: #2563eb;
    text-decoration: none;
    font-weight: 600;
}

/* Internal Steps Section */
.welad-section-internal {
    background: #ffffff;
    border-radius: 16px;
    padding: 40px;
    margin-bottom: 40px;
}

.welad-section-title {
    font-size: 1.8rem;
    font-weight: 800;
    color: #0f172a;
    margin-bottom: 10px;
}

.welad-section-desc {
    color: #64748b;
    margin-bottom: 40px;
}

.welad-steps-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 30px;
    position: relative;
}

.welad-step-card {
    position: relative;
    padding-top: 20px;
}

.welad-step-circle {
    width: 40px;
    height: 40px;
    background: #2563eb;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 1.2rem;
    margin-bottom: 16px;
    box-shadow: 0 4px 6px -1px rgba(37, 99, 235, 0.3);
}

.welad-step-title {
    font-size: 1.1rem;
    font-weight: 700;
    color: #1e293b;
    margin: 0 0 8px 0;
}

.welad-step-period {
    font-size: 0.85rem;
    color: #2563eb;
    font-weight: 600;
    margin-bottom: 8px;
}

.welad-step-content {
    font-size: 0.9rem;
    color: #64748b;
    line-height: 1.5;
}

/* CTA Banner */
.welad-cta-banner {
    background: linear-gradient(135deg, #1e293b 0%, #0f172a 100%);
    border-radius: 12px;
    padding: 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    flex-wrap: wrap;
    gap: 20px;
}

.welad-cta-banner h3 {
    font-size: 1.5rem;
    margin: 0 0 8px 0;
}

.welad-cta-banner p {
    margin: 0;
    color: #94a3b8;
}

.welad-btn-primary {
    background: #3b82f6;
    color: #fff;
    padding: 12px 30px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.welad-btn-primary:hover {
    background: #2563eb;
}

/* Responsive */
@media (max-width: 768px) {
    .welad-roadmap-grid {
        grid-template-columns: 1fr;
    }

    .welad-steps-container {
        grid-template-columns: 1fr;
    }
}

/* =========================================
   ADMIN DASHBOARD STYLES (New Table Layout)
   ========================================= */
.welad-admin-wrapper {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    padding: 20px;
    background-color: #f8fafc;
    /* Light gray background */
    min-height: 100vh;
}

/* Header */
.welad-admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.header-left h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0 0 4px 0;
}

.header-left p {
    color: #64748b;
    font-size: 0.9rem;
    margin: 0;
}

.header-right {
    display: flex;
    gap: 12px;
}

/* Buttons */
.welad-btn-white {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

.welad-btn-blue {
    background: #2563eb;
    border: 1px solid #2563eb;
    color: #fff;
    padding: 8px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: background 0.2s;
}

.welad-btn-blue:hover {
    background: #1d4ed8;
    color: #fff;
}

/* Filters */
.welad-admin-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 20px;
}

.filter-item {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 8px 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: #64748b;
}

.filter-item select {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    color: #334155;
    font-weight: 500;
    cursor: pointer;
    padding-right: 20px;
}

.filter-item select:focus {
    outline: none;
    box-shadow: none;
}

/* Table Container */
.welad-admin-table-container {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.welad-admin-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
}

.welad-admin-table th {
    background: #f8fafc;
    color: #64748b;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 20px;
    border-bottom: 1px solid #e2e8f0;
}

.welad-admin-table td {
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
    color: #334155;
    font-size: 0.9rem;
}

.welad-admin-table tr:last-child td {
    border-bottom: none;
}

.welad-admin-table tr:hover {
    background-color: #fcfcfc;
}

/* Checkbox Column */
.check-col {
    width: 40px;
    text-align: center;
}

/* Columns */
.month-col {
    font-weight: 600;
    color: #0f172a;
}

.project-title {
    font-weight: 600;
    color: #0f172a;
    font-size: 0.95rem;
}

.project-id {
    font-size: 0.75rem;
    color: #94a3b8;
    margin-top: 4px;
}

/* Badges */
.welad-admin-badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 600;
}

.badge-blue {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #dbeafe;
}

.badge-green {
    background: #f0fdf4;
    color: #16a34a;
    border: 1px solid #dcfce7;
}

.badge-purple {
    background: #f3e8ff;
    color: #9333ea;
    border: 1px solid #e9d5ff;
}

.badge-orange {
    background: #fff7ed;
    color: #ea580c;
    border: 1px solid #ffedd5;
}

.period-col {
    color: #64748b;
}

.budget-col {
    font-family: monospace;
    font-weight: 600;
    color: #0f172a;
}

/* Actions */
.actions-col {
    display: flex;
    gap: 8px;
}

.actions-col a {
    color: #94a3b8;
    text-decoration: none;
    transition: color 0.2s;
}

.actions-col a:hover {
    color: #2563eb;
}

.actions-col a.delete-icon:hover {
    color: #ef4444;
}

/* Pagination */
.welad-admin-pagination {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-top: 1px solid #e2e8f0;
    color: #64748b;
    font-size: 0.85rem;
}

.welad-admin-pagination .pages {
    display: flex;
    gap: 4px;
}

.welad-admin-pagination button {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #64748b;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.welad-admin-pagination button.active {
    background: #2563eb;
    color: #fff;
    border-color: #2563eb;
}

/* =========================================
   MODAL STYLES (Details Popup)
   ========================================= */
.welad-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    /* Hidden by default */
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.welad-modal-content {
    background: #fff;
    width: 90%;
    max-width: 500px;
    border-radius: 16px;
    padding: 30px;
    position: relative;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    animation: weladSlideUp 0.3s ease-out;
}

@keyframes weladSlideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.welad-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: transparent;
    border: none;
    font-size: 2rem;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.welad-modal-close:hover {
    color: #475569;
}

.welad-modal-header {
    margin-bottom: 20px;
}

.welad-modal-badge {
    display: inline-block;
    background: #eff6ff;
    color: #2563eb;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.welad-modal-header h3 {
    margin: 0;
    font-size: 1.5rem;
    color: #0f172a;
    font-weight: 700;
}

.welad-modal-body {
    margin-bottom: 24px;
}

.welad-modal-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f1f5f9;
}

.welad-modal-row .label {
    color: #64748b;
    font-weight: 500;
}

.welad-modal-row .value {
    color: #334155;
    font-weight: 600;
}

.welad-modal-desc {
    margin-top: 20px;
    color: #475569;
    line-height: 1.6;
    font-size: 0.95rem;
    background: #f8fafc;
    padding: 16px;
    border-radius: 8px;
}

.welad-modal-footer {
    text-align: right;
}

.welad-btn-secondary {
    display: inline-block;
    background: #e2e8f0;
    color: #475569;
    padding: 10px 24px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: background 0.2s;
}

.welad-btn-secondary:hover {
    background: #cbd5e1;
}

/* =========================================
   INTERNAL TIMELINE CALENDAR
   ========================================= */
.welad-timeline-container {
    background: #fff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    margin-top: 20px;
    overflow-x: auto;
    /* Allow horizontal scroll if needed */
    padding-bottom: 20px;
}

.welad-timeline-header {
    display: grid;
    /* Label column (220px) + 16 Month columns (Sep-Dec) */
    grid-template-columns: 220px repeat(16, 1fr);
    border-bottom: 1px solid #cbd5e1;
    background: #f8fafc;
    position: sticky;
    top: 0;
    z-index: 10;
}

.timeline-label {
    padding: 12px 16px;
    font-weight: 700;
    color: #475569;
    font-size: 0.85rem;
    border-right: 1px solid #e2e8f0;
}

.timeline-month {
    padding: 12px 4px;
    text-align: center;
    font-size: 0.8rem;
    color: #64748b;
    font-weight: 600;
    border-right: 1px solid #f1f5f9;
}

.welad-timeline-body {
    min-width: 1000px;
    /* Ensure 16 columns don't crush */
}

.timeline-row {
    display: grid;
    /* Matches header */
    grid-template-columns: 220px repeat(16, 1fr);
    border-bottom: 1px solid #f1f5f9;
    align-items: center;
    height: 56px;
}

.timeline-row:hover {
    background-color: #fcfcfc;
}

.timeline-row-label {
    padding: 0 16px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #1e293b;
    border-right: 1px solid #e2e8f0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* The track where bars sit */
.timeline-track {
    position: relative;
    /* This occupies columns 2 to 18 (16 months) */
    /* Handled inline in PHP */
    height: 100%;
    align-items: center;
}

/* The actual bar */
.timeline-bar {
    background-color: #3b82f6;
    color: #fff;
    margin: 10px 2px;
    border-radius: 20px;
    /* Pill shape */
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    overflow: hidden;
    padding: 0 12px;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
    min-width: 20px;
    height: 36px;
}

.timeline-bar.long-task {
    background: linear-gradient(90deg, #3b82f6 0%, #60a5fa 100%);
    justify-content: flex-start;
}

/* Review Phase Color */
.timeline-bar.bar-orange {
    background: linear-gradient(90deg, #f59e0b 0%, #fbbf24 100%);
    box-shadow: 0 2px 4px rgba(245, 158, 11, 0.2);
}

/* Header Buttons override */
.welad-btn-white {
    background: #fff;
    border: 1px solid #e2e8f0;
    color: #475569;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
}
/* =========================================
   HEADER CONTROLS (Year & View)
   ========================================= */
.welad-year-select-wrapper {
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 6px 10px;
    display: flex;
    align-items: center;
}

.welad-year-select {
    border: none;
    background: transparent;
    font-size: 0.9rem;
    font-weight: 600;
    color: #334155;
    cursor: pointer;
    outline: none;
}

.welad-view-toggle {
    display: flex;
    background: #f1f5f9;
    padding: 4px;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.toggle-btn {
    text-decoration: none;
    padding: 6px 14px;
    font-size: 0.8rem;
    font-weight: 600;
    color: #64748b;
    border-radius: 6px;
    transition: all 0.2s;
}

.toggle-btn:hover {
    color: #334155;
    background: rgba(255,255,255,0.5);
}

.toggle-btn.active {
    background: #fff;
    color: #0f172a;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

/* =========================================
   PHASE DETAILS SIDE PANEL
   ========================================= */
.welad-details-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.welad-details-overlay.open {
    opacity: 1;
    pointer-events: auto;
}

.welad-details-panel {
    position: fixed;
    top: 0;
    right: -450px; /* Hidden by default */
    width: 400px;
    height: 100vh;
    background: #fff;
    z-index: 9999;
    box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    transition: right 0.3s ease-in-out;
    display: flex;
    flex-direction: column;
}

.welad-details-panel.open {
    right: 0;
}

.panel-header {
    padding: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.panel-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.panel-tag {
    background: #fff7ed;
    color: #ea580c; /* Orange for Review, dynamic? */
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
}

.panel-close {
    background: transparent;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #94a3b8;
}

.panel-header h2 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0f172a;
}

.panel-body {
    padding: 24px;
    flex: 1;
    overflow-y: auto;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #64748b;
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
}

.welad-input, .welad-textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    font-size: 0.95rem;
    color: #334155;
    box-sizing: border-box;
}

.welad-textarea {
    resize: vertical;
}

.welad-range {
    width: 100%;
}

.panel-footer {
    padding: 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
}
