/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a5490;
    --secondary-color: #2c5aa0;
    --accent-color: #4a90e2;
    --success-color: #28a745;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --info-color: #17a2b8;
    --dark-bg: #1a1d29;
    --light-bg: #f5f7fa;
    --card-bg: #ffffff;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --border-color: #dee2e6;
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.15);
}

body {
    font-family: 'Noto Sans KR', sans-serif;
    background: var(--light-bg);
    color: var(--text-primary);
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
.main-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: var(--shadow-md);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 20px;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo-section i {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.9);
}

.logo-section h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 5px;
}

.subtitle {
    font-size: 13px;
    opacity: 0.85;
    font-weight: 300;
}

.header-info {
    display: flex;
    gap: 30px;
}

.info-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.info-item i {
    font-size: 16px;
}

/* Navigation */
.main-nav {
    background: white;
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-menu {
    list-style: none;
    display: flex;
    gap: 5px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 15px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
    color: var(--text-secondary);
    font-weight: 500;
}

.nav-item:hover {
    background: var(--light-bg);
    color: var(--primary-color);
}

.nav-item.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.nav-item i {
    font-size: 18px;
}

/* Main Content */
.main-content {
    padding: 30px 0;
    min-height: calc(100vh - 250px);
}

.page-content {
    display: none;
}

.page-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Header */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h2 {
    font-size: 26px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.page-header h2 i {
    color: var(--primary-color);
}

/* KPI Cards */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.kpi-card {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    display: flex;
    gap: 20px;
    align-items: center;
    transition: all 0.3s ease;
}

.kpi-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.kpi-icon {
    width: 70px;
    height: 70px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    color: white;
}

.kpi-info h3 {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 8px;
}

.kpi-value {
    font-size: 36px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
    margin-bottom: 5px;
}

.kpi-label {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.dashboard-card {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
    background: linear-gradient(to right, #f8f9fa, white);
}

.card-header h3 {
    font-size: 18px;
    color: var(--text-primary);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-header h3 i {
    color: var(--primary-color);
}

.card-body {
    padding: 25px;
}

/* Buttons */
.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--text-secondary);
    color: white;
}

.btn-secondary:hover {
    background: #6c757d;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 13px;
    border-radius: 4px;
}

.btn-edit {
    background: var(--info-color);
    color: white;
}

.btn-delete {
    background: var(--danger-color);
    color: white;
}

/* Table */
.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
}

.data-table thead {
    background: linear-gradient(to right, var(--primary-color), var(--secondary-color));
    color: white;
}

.data-table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    font-size: 14px;
}

.data-table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
}

.data-table tbody tr:hover {
    background: var(--light-bg);
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

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

.status-warning {
    background: #fff3cd;
    color: #856404;
}

.status-danger {
    background: #f8d7da;
    color: #721c24;
}

.status-completed {
    background: #d1ecf1;
    color: #0c5460;
}

.status-progress {
    background: #e7f3ff;
    color: #004085;
}

.status-pending {
    background: #f8f9fa;
    color: #6c757d;
}

/* Digital Level Stars */
.digital-level {
    color: #ffc107;
}

/* Filter Section */
.filter-section {
    margin-bottom: 20px;
    display: flex;
    gap: 15px;
}

.filter-section select {
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* Monitoring Grid */
.monitoring-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.monitoring-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
}

.monitoring-card h3 {
    font-size: 18px;
    margin-bottom: 20px;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 10px;
}

.monitoring-metrics {
    display: grid;
    gap: 15px;
}

.metric-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--light-bg);
    border-radius: 6px;
}

.metric-label {
    font-size: 14px;
    color: var(--text-secondary);
}

.metric-value {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.monitoring-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: var(--success-color);
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success-color);
}

.status-indicator.active {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Logs Container */
.logs-container {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
}

.log-item {
    display: flex;
    gap: 20px;
    padding: 20px;
    border-left: 4px solid;
    margin-bottom: 15px;
    border-radius: 6px;
    background: var(--light-bg);
}

.log-item.log-info {
    border-left-color: var(--info-color);
}

.log-item.log-warning {
    border-left-color: var(--warning-color);
}

.log-item.log-error {
    border-left-color: var(--danger-color);
}

.log-item.log-inspection {
    border-left-color: var(--success-color);
}

.log-icon {
    font-size: 24px;
    width: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.log-content {
    flex: 1;
}

.log-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.log-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.log-time {
    font-size: 13px;
    color: var(--text-secondary);
}

.log-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.log-meta {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text-secondary);
}

/* Alerts Container */
.alerts-container {
    display: grid;
    gap: 15px;
}

.alert-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid;
}

.alert-item.alert-warning {
    background: #fff3cd;
    border-left-color: var(--warning-color);
}

.alert-item.alert-danger {
    background: #f8d7da;
    border-left-color: var(--danger-color);
}

.alert-item.alert-info {
    background: #d1ecf1;
    border-left-color: var(--info-color);
}

.alert-icon {
    font-size: 24px;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 600;
    margin-bottom: 5px;
}

.alert-text {
    font-size: 13px;
    color: var(--text-secondary);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    animation: fadeIn 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h3 {
    font-size: 20px;
    color: var(--text-primary);
}

.close-btn {
    background: none;
    border: none;
    font-size: 28px;
    color: var(--text-secondary);
    cursor: pointer;
    line-height: 1;
    padding: 0;
    width: 30px;
    height: 30px;
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 14px;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.form-group textarea {
    resize: vertical;
}

/* Responsive Design */
@media (max-width: 1200px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-info {
        width: 100%;
        justify-content: space-between;
    }

    .logo-section h1 {
        font-size: 22px;
    }

    .nav-menu {
        flex-wrap: wrap;
    }

    .nav-item {
        padding: 12px 15px;
        font-size: 14px;
    }

    .kpi-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .monitoring-grid {
        grid-template-columns: 1fr;
    }

    .table-container {
        overflow-x: auto;
    }

    .data-table {
        min-width: 800px;
    }

    .filter-section {
        flex-direction: column;
    }

    .filter-section select {
        width: 100%;
    }
}

/* Educational Videos Section */
.education-intro {
    padding: 15px;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 8px;
    margin-bottom: 25px;
    border-left: 4px solid var(--primary-color);
}

.education-intro p {
    margin: 0;
    color: var(--text-primary);
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.education-intro i {
    color: var(--primary-color);
    font-size: 18px;
}

.video-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.video-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
}

.video-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.video-wrapper {
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    background: #000;
}

.video-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.video-info {
    padding: 20px;
}

.video-info h4 {
    font-size: 16px;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.video-info h4 i {
    color: var(--danger-color);
}

.video-info p {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin: 0;
}

/* Print Styles */
@media print {
    .main-nav,
    .page-header button,
    .btn-edit,
    .btn-delete,
    .video-grid {
        display: none;
    }
}

/* Responsive for Video Grid */
@media (max-width: 1200px) {
    .video-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .video-grid {
        grid-template-columns: 1fr;
    }
    
    .education-intro p {
        font-size: 13px;
    }
}