/* Reset and Global Styles */
:root {
    --bg-primary: #0b0f19;
    --bg-secondary: #161c2d;
    --bg-tertiary: #212b44;
    --text-primary: #f3f4f6;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --primary-light: rgba(99, 102, 241, 0.15);
    
    --accent-red: #ef4444;
    --accent-red-light: rgba(239, 68, 68, 0.15);
    --accent-orange: #f59e0b;
    --accent-orange-light: rgba(245, 158, 11, 0.15);
    --accent-green: #10b981;
    --accent-green-light: rgba(16, 185, 129, 0.15);
    
    --border-color: rgba(255, 255, 255, 0.08);
    --card-border-hover: rgba(99, 102, 241, 0.4);
    
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.2);
    --shadow-lg: 0 12px 24px rgba(0, 0, 0, 0.3);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 20px;
    --radius-full: 9999px;
    
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

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

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
::-webkit-scrollbar-track {
    background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* App Layout */
.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.8rem;
    background: linear-gradient(135deg, var(--primary), #8b5cf6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.brand h1 {
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.025em;
}

.brand h1 span {
    color: var(--primary);
}

/* Search and Filters */
.search-filter-bar {
    display: flex;
    flex: 1;
    max-width: 600px;
    gap: 0.75rem;
}

.search-wrapper {
    position: relative;
    flex: 1;
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.search-wrapper input {
    width: 100%;
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    transition: var(--transition);
}

.search-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.filter-wrapper select {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 2rem 0.75rem 1rem;
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    cursor: pointer;
    transition: var(--transition);
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%239ca3af'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1rem;
}

.filter-wrapper select:focus {
    outline: none;
    border-color: var(--primary);
}

/* User controls */
.user-controls {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-profile {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.admin-badge {
    background-color: var(--primary-light);
    color: #a5b4fc;
    padding: 0.35rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    border: 1px solid rgba(99, 102, 241, 0.3);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.7rem 1.25rem;
    border-radius: var(--radius-md);
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    font-family: inherit;
}

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

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

.btn-secondary {
    background-color: var(--bg-secondary);
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

.btn-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--text-muted);
}

.btn-outline-primary {
    background-color: transparent;
    color: var(--primary);
    border: 1px solid var(--primary);
}

.btn-outline-primary:hover {
    background-color: var(--primary-light);
}

.btn-danger {
    background-color: var(--accent-red-light);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background-color: var(--accent-red);
    color: white;
}

.btn-icon-only {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-md);
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon-only:hover {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
}

.btn-block {
    width: 100%;
}

/* Dashboard Summary */
.dashboard-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
}

.summary-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: var(--transition);
}

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

.summary-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
}

.summary-card.total .summary-icon {
    background-color: var(--primary-light);
    color: #a5b4fc;
}

.summary-card.urgent .summary-icon {
    background-color: var(--accent-red-light);
    color: #fca5a5;
}

.summary-card.upcoming .summary-icon {
    background-color: rgba(245, 158, 11, 0.1);
    color: #fde047;
}

.summary-info h3 {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.summary-info p {
    font-size: 1.8rem;
    font-weight: 800;
}

/* Exam Grid section */
.exam-list-section {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

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

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.status-indicator {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.status-indicator::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: var(--accent-green);
}

/* Exam Grid & Cards */
.exam-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

.exam-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-height: 200px;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
    overflow: hidden;
}

.exam-card:hover {
    transform: translateY(-4px) scale(1.01);
    border-color: var(--card-border-hover);
    box-shadow: 0 10px 25px -5px rgba(99, 102, 241, 0.15), 0 8px 10px -6px rgba(99, 102, 241, 0.15);
}

.exam-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.subject-badge {
    background-color: var(--bg-tertiary);
    color: var(--text-primary);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 600;
}

.dday-badge {
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-full);
    font-size: 0.8rem;
    font-weight: 800;
}

.dday-badge.urgent {
    background-color: var(--accent-red-light);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.dday-badge.warning {
    background-color: var(--accent-orange-light);
    color: #fdba74;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.dday-badge.normal {
    background-color: var(--primary-light);
    color: #a5b4fc;
    border: 1px solid rgba(99, 102, 241, 0.2);
}

.dday-badge.passed {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
}

.exam-card-body h3 {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.exam-card-body p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 1rem;
}

.exam-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding-top: 0.75rem;
}

.due-date {
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.card-admin-controls {
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}

.card-admin-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 0.95rem;
    padding: 0.25rem;
    transition: var(--transition);
}

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

.card-admin-btn.edit-btn:hover {
    color: var(--primary);
}

.card-admin-btn.delete-btn:hover {
    color: var(--accent-red);
}

/* Modals System */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(7, 10, 19, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.modal-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 90%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay:not(.hidden) .modal-card {
    transform: translateY(0);
}

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

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
}

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

.modal-body {
    padding: 1.5rem;
}

/* Form Styling */
.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.form-group input,
.form-group textarea {
    width: 100%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

/* Detail Modal Custom Styles */
.detail-card {
    max-width: 650px;
}

.detail-header {
    border: none;
    padding-bottom: 0;
}

.subject-tag-wrapper {
    display: flex;
    gap: 0.5rem;
}

.subject-tag {
    background-color: var(--primary-light);
    color: #c7d2fe;
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 700;
}

.dday-tag {
    padding: 0.35rem 0.85rem;
    border-radius: var(--radius-full);
    font-size: 0.85rem;
    font-weight: 800;
}

.dday-tag.urgent {
    background-color: var(--accent-red-light);
    color: #fca5a5;
}

.dday-tag.warning {
    background-color: var(--accent-orange-light);
    color: #fdba74;
}

.dday-tag.normal {
    background-color: rgba(16, 185, 129, 0.1);
    color: #6ee7b7;
}

.dday-tag.passed {
    background-color: var(--bg-tertiary);
    color: var(--text-muted);
}

.detail-title {
    font-size: 1.6rem;
    font-weight: 800;
    line-height: 1.3;
    margin-top: 0.5rem;
    margin-bottom: 1.25rem;
}

.detail-meta {
    display: flex;
    gap: 2rem;
    padding: 1rem 1.25rem;
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-md);
    margin-bottom: 1.5rem;
    border: 1px solid var(--border-color);
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.meta-item i {
    font-size: 1.2rem;
    color: var(--primary);
}

.meta-label {
    display: block;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
}

.meta-value {
    font-size: 0.95rem;
    font-weight: 600;
}

.detail-section {
    margin-bottom: 1.5rem;
}

.detail-section h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #c7d2fe;
}

.detail-section h3 i {
    color: var(--primary);
}

.detail-description {
    white-space: pre-wrap;
    color: var(--text-secondary);
    font-size: 0.98rem;
    line-height: 1.7;
}

.criteria-list {
    list-style: none;
}

.criteria-list li {
    position: relative;
    padding-left: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-size: 0.95rem;
}

.criteria-list li::before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--primary);
    font-weight: bold;
}

.admin-actions {
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-color);
}

/* Utilities */
.hidden {
    display: none !important;
}

.error-msg {
    color: #fca5a5;
    background-color: var(--accent-red-light);
    border: 1px solid rgba(239, 68, 68, 0.2);
    padding: 0.75rem;
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
}

.no-results {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    text-align: center;
    color: var(--text-muted);
}

.no-results i {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, var(--bg-tertiary), var(--text-muted));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .app-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-filter-bar {
        max-width: 100%;
    }
    
    .user-controls {
        justify-content: flex-end;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .detail-meta {
        flex-direction: column;
        gap: 1rem;
    }
}

/* Custom Confirm Modal Styling */
.confirm-card {
    max-width: 380px !important;
    text-align: center;
}

.confirm-body {
    padding: 2rem 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.confirm-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: var(--accent-red-light);
    color: var(--accent-red);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin-bottom: 0.5rem;
}

.confirm-body h3 {
    font-size: 1.25rem;
    font-weight: 700;
}

.confirm-body p {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.confirm-actions {
    display: flex;
    gap: 0.75rem;
    width: 100%;
    margin-top: 1rem;
}

.confirm-actions button {
    flex: 1;
}

/* Period Form Rows & detail cards */
.period-form-row {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.period-form-row input[type="text"] {
    flex: 1;
}

.period-form-row input[type="date"] {
    flex: 1.2;
}

.detail-periods-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.75rem;
    margin-top: 0.5rem;
}

.detail-period-card {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: var(--transition);
}

.detail-period-card:hover {
    border-color: var(--primary);
    transform: translateY(-1px);
}

.detail-period-info {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.detail-period-name {
    font-size: 0.85rem;
    font-weight: 700;
    color: #c7d2fe;
}

.detail-period-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}


