:root {
    --primary: #2563EB;
    --primary-light: #3B82F6;
    --primary-dark: #1D4ED8;
    --accent: #06B6D4;
    --gradient: linear-gradient(135deg, #2563EB 0%, #06B6D4 100%);
    --gradient-hover: linear-gradient(135deg, #1D4ED8 0%, #0891B2 100%);
    --bg-dark: #000000;
    --bg-darker: #000000;
    --bg-card: rgba(255, 255, 255, 0.03);
    --bg-card-hover: rgba(255, 255, 255, 0.06);
    --text-primary: #F5F5F7;
    --text-secondary: #86868B;
    --border: rgba(255, 255, 255, 0.1);
}

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

html {
    scroll-behavior: smooth;
}

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

a {
    text-decoration: none;
    color: inherit;
}

ul,
li {
    list-style: none;
}

/* Particle Background */
#particles-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    border-radius: 50%;
    opacity: 0;
    animation: float-particle linear infinite;
}

@keyframes float-particle {
    0% {
        opacity: 0;
        transform: translateY(0) scale(0.5);
    }

    5% {
        opacity: 0.6;
    }

    95% {
        opacity: 0.6;
    }

    100% {
        opacity: 0;
        transform: translateY(-100vh) scale(1);
    }
}

/* Page Title Section */
.page-title-section {
    padding: 140px 20px 60px;
    text-align: center;
    background: linear-gradient(180deg, #0a0a1a 0%, #000000 100%);
}

.page-title-section h1 {
    font-size: 48px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 16px;
}

.page-title-section p {
    font-size: 18px;
    color: var(--text-secondary);
}

/* Reviews Container */
.reviews-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px 80px;
    margin-bottom: 300px;
    /* Added spacing from footer */
}

/* Campus Tabs */
.campus-tabs {
    display: flex;
    justify-content: flex-start;
    gap: 8px;
    margin-bottom: 32px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-bottom: 0;
}

.campus-tab {
    padding: 12px 20px;
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    border-radius: 0;
    font-size: 15px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: -1px;
}

.campus-tab:hover {
    color: var(--text-primary);
}

.campus-tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
    background: transparent;
    box-shadow: none;
}

/* Teacher Selection */
.teacher-selection {
    margin-bottom: 40px;
}

.teacher-selection h3 {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 16px;
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.teacher-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 10px;
}

.teacher-btn {
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.teacher-btn:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: var(--text-primary);
}

.teacher-btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Teacher Profile Card */
/* Teacher Profile Card */
.teacher-profile-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 16px;
    padding: 32px;
    margin-bottom: 40px;
    display: flex;
    gap: 28px;
    align-items: flex-start;
    /* Changed from center to align with top badges */
    position: relative;
    /* For absolute positioning of edit button */
}

.teacher-profile-image {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    /* Subtle definition */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    /* Soft shadow */
}

.teacher-profile-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.3s ease-in-out;
    opacity: 1;
    /* Default state */
}

.teacher-profile-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Increased from 12px for better readability */
}

.teacher-profile-info h2 {
    font-size: 22px;
    font-weight: 600;
    color: #fff;
    margin: 0;
}

.teacher-profile-info .university {
    display: none;
}

.teacher-profile-info .tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
}

.teacher-profile-info .tag {
    padding: 6px 14px;
    background: rgba(37, 99, 235, 0.15);
    border: 1px solid rgba(37, 99, 235, 0.3);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    color: var(--primary-light);
}

.teacher-badges {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}

.teacher-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    color: white;
    display: inline-block;
    letter-spacing: 0.5px;
}

.teacher-badge.middle {
    background: rgba(6, 182, 212, 0.15);
    color: #22d3ee;
    border: 1px solid rgba(6, 182, 212, 0.3);
}

.teacher-badge.high {
    background: rgba(139, 92, 246, 0.15);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.3);
}

.teacher-profile-info .intro {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.7;
    margin: 0;
}

/* Reviews Section */
.reviews-section h3 {
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 20px;
    padding-left: 12px;
    border-left: 3px solid var(--primary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.reviews-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

/* Review Card */
.review-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 24px;
    transition: all 0.25s ease;
    cursor: pointer;
}

.review-card:hover {
    background: rgba(37, 99, 235, 0.08);
    border-color: rgba(37, 99, 235, 0.3);
    transform: translateY(-3px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2);
}

.review-admin-buttons {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 8px;
    z-index: 10;
}

.review-admin-buttons button {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
}

.review-admin-buttons button:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.review-admin-buttons button.delete:hover {
    background: #ef4444;
    border-color: #ef4444;
}

.review-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.review-card-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 500;
    color: var(--text-secondary);
}

.review-card-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.review-card-info h4 {
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.review-card-info p {
    font-size: 12px;
    color: var(--text-secondary);
}

.review-card-score {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.15) 0%, rgba(6, 182, 212, 0.1) 100%);
    border: 1px solid rgba(37, 99, 235, 0.25);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 16px;
    text-align: center;
}

.review-card-score .label {
    font-size: 11px;
    color: var(--text-secondary);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.review-card-score .value {
    font-size: 18px;
    font-weight: 700;
    background: linear-gradient(135deg, var(--primary-light) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.review-card-content {
    font-size: 13px;
    color: var(--text-primary);
    line-height: 1.6;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    opacity: 0.9;
}

.review-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.review-card-tags span {
    font-size: 11px;
    color: var(--primary-light);
    background: rgba(37, 99, 235, 0.15);
    padding: 4px 10px;
    border-radius: 4px;
    border: 1px solid rgba(37, 99, 235, 0.2);
}

/* Review Modal */
.review-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 2000;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.review-modal.active {
    display: flex;
}

.review-modal-content {
    background: #0a0a0a;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    max-width: 520px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    /* Transition for width changes */
    transition: max-width 0.3s ease;
}

/* Detail Modal Wider Width */
#reviewDetailModal .review-modal-content {
    max-width: 900px;
}

/* Modal Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
    margin-bottom: 20px;
}

.modal-tab {
    flex: 1;
    text-align: center;
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    margin-bottom: -2px;
    /* Overlap border */
}

.modal-tab:hover {
    color: var(--text-primary);
}

.modal-tab.active {
    color: var(--primary-light);
    border-bottom-color: var(--primary-light);
}

.modal-tab-content {
    display: none;
    animation: fadeIn 0.3s;
}

.modal-tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.review-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    background: rgba(255, 255, 255, 0.08);
    border: none;
    border-radius: 6px;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.review-modal-close:hover {
    background: rgba(255, 255, 255, 0.15);
}

.modal-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.modal-avatar {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.08);
}

.modal-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.modal-info h3 {
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
}

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

.modal-score {
    background: rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 20px;
    text-align: center;
}

.modal-score .label {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.modal-score .value {
    font-size: 20px;
    font-weight: 600;
    color: var(--primary-light);
}

.modal-content-text {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.8;
    margin-bottom: 20px;
}

.modal-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.modal-tags span {
    font-size: 12px;
    color: var(--text-secondary);
    background: rgba(255, 255, 255, 0.06);
    padding: 4px 10px;
    border-radius: 4px;
}

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 0;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.05);
    border-top: 2px solid var(--primary);
    border-right: 2px solid rgba(255, 255, 255, 0.05);
    border-bottom: 2px solid rgba(255, 255, 255, 0.05);
    border-left: 2px solid var(--primary);
    /* Double sided for elegance */
    border-radius: 50%;
    animation: spin 1.2s cubic-bezier(0.45, 0.05, 0.55, 0.95) infinite;
    box-shadow: 0 0 15px rgba(37, 99, 235, 0.2);
    /* Subtle glow */
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-secondary);
}

.empty-state svg {
    width: 64px;
    height: 64px;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state p {
    font-size: 16px;
}

/* Responsive */
@media (max-width: 1024px) {
    .reviews-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .page-title-section h1 {
        font-size: 32px;
    }

    .page-title-section p {
        font-size: 15px;
    }

    /* 캠퍼스 탭 가로 배치 */
    .campus-tabs {
        flex-direction: row;
        justify-content: center;
        gap: 0;
    }

    .campus-tab {
        flex: 1;
        max-width: none;
        text-align: center;
        padding: 10px 12px;
        font-size: 14px;
    }

    /* 선생님 버튼 3열 그리드 */
    .teacher-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }

    .teacher-btn {
        padding: 8px 10px;
        font-size: 13px;
        text-align: center;
        justify-content: center;
    }

    .teacher-profile-card {
        flex-direction: column;
        text-align: center;
        padding: 24px;
        gap: 16px;
        align-items: center;
    }

    .teacher-profile-image {
        width: 80px;
        height: 80px;
        margin: 0 auto;
    }

    .teacher-profile-info {
        align-items: center;
    }

    .teacher-profile-info h2 {
        font-size: 18px;
    }

    .teacher-profile-info .tags {
        justify-content: center;
    }

    .teacher-profile-info .intro {
        font-size: 13px;
    }

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

    .review-modal-content {
        padding: 24px;
    }

    .modal-header {
        flex-direction: column;
        text-align: center;
    }

    /* 모바일에서 관리자 톱니바퀴 버튼 숨기기 */
    div[style*="position: fixed"][style*="bottom: 20px"][style*="right: 20px"] {
        display: none !important;
    }
}

/* Fix for select dropdown in dark mode */
select option {
    background-color: #0a0a0a;
    color: #fff;
}

/* Toast Container */
#toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.toast {
    background: rgba(0, 0, 0, 0.85);
    color: #fff;
    padding: 14px 20px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(8px);
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 250px;
    max-width: 400px;
    animation: slideIn 0.3s ease-out forwards;
    opacity: 0;
    transform: translateX(100%);
}

.toast.success {
    border-left: 4px solid #10b981;
}

.toast.error {
    border-left: 4px solid #ef4444;
}

.toast.info {
    border-left: 4px solid #3b82f6;
}

@keyframes slideIn {
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeOut {
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

/* Image Loading Transitions */
.teacher-profile-image img,
.review-card-avatar img,
.modal-avatar img {
    transition: opacity 0.3s ease-in-out;
}

.review-card-avatar {
    display: flex;
    align-items: center;
    justify-content: center;
}

.review-card-avatar span {
    font-weight: 500;
}

/* Skeleton Loading Effect */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.img-loading {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.03) 25%,
        rgba(255, 255, 255, 0.08) 50%,
        rgba(255, 255, 255, 0.03) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}