/* 완전히 새로운 좌석 배치 최적화 Google 디자인 */
@import url('https://fonts.googleapis.com/css2?family=Google+Sans:wght@300;400;500;600&family=Roboto:wght@300;400;500&display=swap');

/* CSS Reset & Base */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    /* Google 정확한 컬러 시스템 */
    --google-grey-50: #fafafa;
    --google-grey-100: #f5f5f5;
    --google-grey-200: #eeeeee;
    --google-grey-300: #e0e0e0;
    --google-grey-400: #bdbdbd;
    --google-grey-500: #9e9e9e;
    --google-grey-600: #757575;
    --google-grey-700: #616161;
    --google-grey-800: #424242;
    --google-grey-900: #212121;
    
    --google-blue: #1a73e8;
    --google-blue-hover: #1557b0;
    --google-blue-light: #e8f0fe;
    --google-blue-50: #f1f8ff;
    
    --google-green: #137333;
    --google-green-hover: #0f5132;
    --google-green-light: #e6f4ea;
    
    --google-red: #d93025;
    --google-red-hover: #b52d20;
    --google-red-light: #fce8e6;
    
    --google-orange: #f9ab00;
    --google-orange-hover: #e8a100;
    --google-orange-light: #fef7e0;
    
    /* 명확한 텍스트 컬러 */
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --text-disabled: #9aa0a6;
    --text-on-primary: #ffffff;
    
    /* 배경 컬러 */
    --background-primary: #ffffff;
    --background-secondary: #fafafa;
    --surface: #ffffff;
    --surface-variant: #f8f9fa;
    
    /* 그림자 */
    --shadow-1: 0 1px 2px 0 rgba(60,64,67,.3), 0 1px 3px 1px rgba(60,64,67,.15);
    --shadow-2: 0 1px 2px 0 rgba(60,64,67,.3), 0 2px 6px 2px rgba(60,64,67,.15);
    --shadow-3: 0 4px 8px 3px rgba(60,64,67,.15), 0 1px 3px 0 rgba(60,64,67,.3);
    
    /* 테두리 */
    --border-color: #dadce0;
    --border-focus: #1a73e8;
    
    /* 간격 */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-8: 32px;
    --space-10: 40px;
    --space-12: 48px;
    
    /* 최적화된 그리드 */
    --cell-size: 44px;
    --grid-gap: 6px;
}

html, body {
    height: 100%;
    font-family: 'Google Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--background-secondary);
    color: var(--text-primary);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 1600px;
    margin: 0 auto;
}

.hidden {
    display: none !important;
}

/* Google 스타일 헤더 - 컴팩트 */
.header {
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-4) var(--space-6);
    text-align: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-1);
}

.header h1 {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--space-1);
    font-family: 'Google Sans', sans-serif;
}

.header p {
    font-size: 14px;
    color: var(--text-secondary);
    font-weight: 400;
}

/* 뒤로가기 링크 - 컴팩트 */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: var(--space-2);
    padding: var(--space-2) var(--space-3);
    margin: var(--space-3);
    background: var(--surface);
    color: var(--google-blue);
    text-decoration: none;
    border-radius: 6px;
    border: 1px solid var(--border-color);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.back-link:hover {
    background: var(--google-blue-light);
    border-color: var(--google-blue);
    box-shadow: var(--shadow-1);
}

/* 메인 레이아웃 - 최적화 */
.main-layout {
    flex: 1;
    display: grid;
    grid-template-columns: 300px 1fr;
    padding: var(--space-4);
    gap: var(--space-4);
}

/* 사이드바 - 컴팩트 */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

/* Google 카드 스타일 - 최적화 */
.panel {
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    overflow: hidden;
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.2s ease;
}

.panel:hover {
    box-shadow: var(--shadow-2);
}

.panel-header {
    padding: var(--space-4) var(--space-5);
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 56px;
}

.panel-title {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'Google Sans', sans-serif;
    /* Allow wrapping to prevent clipping like "내 교..." in narrow spaces */
    white-space: normal;
    overflow-wrap: anywhere;
    word-break: keep-all;
    flex: 1 1 auto;
    margin-right: var(--space-3);
}

/* Google 버튼 스타일 - 향상된 디자인 */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    padding: var(--space-3) var(--space-4);
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    font-family: 'Google Sans', sans-serif;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    min-height: 36px;
    white-space: nowrap;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.btn:hover::before {
    opacity: 1;
}

.btn img {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.btn-primary {
    background: linear-gradient(135deg, var(--google-blue), #1557b0);
    color: var(--text-on-primary);
    border-color: var(--google-blue);
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--google-blue-hover), #0f4a8c);
    border-color: var(--google-blue-hover);
    box-shadow: 0 4px 8px rgba(26, 115, 232, 0.3);
    transform: translateY(-1px);
}

.btn-secondary {
    background: linear-gradient(135deg, var(--google-green), #0f5132);
    color: var(--text-on-primary);
    border-color: var(--google-green);
    box-shadow: 0 2px 4px rgba(19, 115, 51, 0.2);
}

.btn-secondary:hover {
    background: linear-gradient(135deg, var(--google-green-hover), #0d4429);
    border-color: var(--google-green-hover);
    box-shadow: 0 4px 8px rgba(19, 115, 51, 0.3);
    transform: translateY(-1px);
}

.btn-danger {
    background: linear-gradient(135deg, var(--google-red), #b52d20);
    color: var(--text-on-primary);
    border-color: var(--google-red);
    box-shadow: 0 2px 4px rgba(217, 48, 37, 0.2);
}

.btn-danger:hover {
    background: linear-gradient(135deg, var(--google-red-hover), #9a251a);
    border-color: var(--google-red-hover);
    box-shadow: 0 4px 8px rgba(217, 48, 37, 0.3);
    transform: translateY(-1px);
}

.btn-outline {
    background: var(--surface);
    color: var(--text-primary);
    border-color: var(--border-color);
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.12);
}

.btn-outline:hover {
    background: var(--surface-variant);
    border-color: var(--google-blue);
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.15);
    transform: translateY(-1px);
    color: var(--google-blue);
}

.btn-sm {
    padding: var(--space-2) var(--space-3);
    font-size: 12px;
    min-height: 32px;
}

/* 교실 리스트 - 향상된 인터랙션 */
#classroom-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

#classroom-list li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--google-grey-100);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 52px;
    position: relative;
}

#classroom-list li::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0;
    background: linear-gradient(135deg, var(--google-blue), var(--google-blue-hover));
    transition: width 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

#classroom-list li:last-child {
    border-bottom: none;
}

#classroom-list li:hover {
    background: linear-gradient(90deg, var(--google-blue-50), transparent);
    transform: translateX(4px);
    padding-left: var(--space-5);
}

#classroom-list li:hover::before {
    width: 4px;
}

#classroom-list li.active {
    background: linear-gradient(90deg, var(--google-blue-light), var(--google-blue-50));
    font-weight: 600;
    color: var(--google-blue);
    box-shadow: inset 0 0 0 1px rgba(26, 115, 232, 0.1);
}

#classroom-list li.active::before {
    width: 4px;
}

#classroom-list li span {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    margin-right: var(--space-2);
    transition: color 0.2s ease;
}

#classroom-list li.active span {
    color: var(--google-blue);
    font-weight: 600;
}

.classroom-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: 50%;
    font-size: 14px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    opacity: 0;
    transform: scale(0.8);
}

#classroom-list li:hover .classroom-delete-btn {
    opacity: 1;
    transform: scale(1);
}

.classroom-delete-btn:hover {
    background: var(--google-red-light);
    color: var(--google-red);
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(217, 48, 37, 0.2);
}

/* 빈 상태 메시지 - 줄바꿈 방지 */
#classroom-list p {
    padding: var(--space-4);
    text-align: center;
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.4;
    word-break: keep-all;
    /* Let empty state wrap to avoid awkward cutoffs */
    white-space: normal;
}

/* 모달 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.modal-content {
    background: var(--surface);
    border-radius: 8px;
    box-shadow: var(--shadow-3);
    width: 90%;
    max-width: 480px;
    max-height: 90vh;
    overflow: auto;
    animation: slideIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-32px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

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

.modal-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    font-family: 'Google Sans', sans-serif;
}

.modal-close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: 50%;
    font-size: 18px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-close-btn:hover {
    background: var(--google-grey-100);
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-5);
}

.modal-footer {
    padding: var(--space-5);
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: var(--space-3);
}

/* 폼 */
.form-group {
    margin-bottom: var(--space-5);
}

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

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: var(--space-3);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 1px var(--border-focus);
}

.form-group textarea {
    min-height: 100px;
    resize: vertical;
}

/* 학생 추가 폼 - 향상된 디자인 */
.add-student-form {
    background: linear-gradient(135deg, var(--google-blue-50), var(--google-grey-50));
    padding: var(--space-5);
    border-radius: 16px;
    border: 2px solid var(--border-color);
    box-shadow: 0 4px 16px rgba(60, 64, 67, 0.1);
    position: relative;
    overflow: hidden;
}

.add-student-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--google-blue), var(--google-green), var(--google-orange));
    border-radius: 16px 16px 0 0;
}

.add-student-form h3 {
    margin: 0 0 var(--space-4) 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-family: 'Google Sans', sans-serif;
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.add-student-form h3::before {
    content: '👥';
    font-size: 18px;
}

.input-group {
    display: flex;
    gap: var(--space-3);
    align-items: stretch;
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    background: var(--surface);
    padding: var(--space-4);
    border-radius: 12px;
    border: 2px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.08);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-group:focus-within {
    border-color: var(--google-blue);
    box-shadow: 0 4px 16px rgba(26, 115, 232, 0.15);
    transform: translateY(-1px);
}

.input-group input {
    flex: 1;
    min-width: 140px;
    padding: var(--space-3) var(--space-4);
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Roboto', sans-serif;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: inset 0 1px 3px rgba(60, 64, 67, 0.08);
}

.input-group input:focus {
    outline: none;
    border-color: var(--google-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1), inset 0 1px 3px rgba(60, 64, 67, 0.08);
    transform: translateY(-1px);
}

.input-group input::placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

.input-group .btn {
    align-self: stretch;
    min-width: 100px;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.2);
}

/* 탭 - 개선된 디자인 */
.class-tabs {
    display: flex;
    background: var(--surface);
    border-bottom: 1px solid var(--border-color);
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    position: relative;
}

.class-tabs::-webkit-scrollbar {
    display: none;
}

.class-tab {
    padding: var(--space-3) var(--space-4);
    border: none;
    background: none;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Google Sans', sans-serif;
    position: relative;
    min-height: 48px;
    display: flex;
    align-items: center;
    border-radius: 8px 8px 0 0;
}

.class-tab:hover {
    color: var(--text-primary);
    background: var(--google-blue-50);
    transform: translateY(-1px);
}

.class-tab.active {
    color: var(--google-blue);
    border-bottom-color: var(--google-blue);
    background: var(--google-blue-50);
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(26, 115, 232, 0.1);
}

/* 좌석 그리드 - 완전히 새로운 레이아웃 */
.seat-grid-container {
    padding: var(--space-6);
    background: linear-gradient(135deg, var(--google-grey-50), var(--google-blue-50));
    display: flex;
    align-items: flex-start;
    justify-content: center;
    min-height: 300px;
    border-radius: 12px;
    margin: var(--space-3);
    overflow: auto;
    border: 1px solid rgba(26, 115, 232, 0.1);
}

.seat-grid {
    display: inline-grid;
    gap: var(--grid-gap);
    padding: var(--space-5);
    background: var(--surface);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(60, 64, 67, 0.15), 0 1px 3px rgba(60, 64, 67, 0.3);
    border: 1px solid var(--border-color);
    position: relative;
}

.seat-grid::before {
    content: '';
    position: absolute;
    top: -1px;
    left: -1px;
    right: -1px;
    bottom: -1px;
    background: linear-gradient(45deg, transparent, rgba(26, 115, 232, 0.05), transparent);
    border-radius: 12px;
    z-index: -1;
}

.grid-cell {
    width: var(--cell-size);
    height: var(--cell-size);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border: 2px solid transparent;
    font-family: 'Roboto', sans-serif;
    overflow: hidden;
    background-clip: padding-box;
}

.grid-cell:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 16px rgba(60, 64, 67, 0.2), 0 2px 4px rgba(60, 64, 67, 0.1);
    z-index: 10;
    border-color: rgba(26, 115, 232, 0.3);
}

.grid-cell:active {
    transform: translateY(0) scale(0.98);
    transition-duration: 0.1s;
}

/* 좌석 타입별 색상 - 개선된 디자인과 미묘한 그라디언트 */
.grid-cell[data-type="empty"] {
    background: linear-gradient(135deg, #fafafa, #f5f5f5);
    color: var(--text-disabled);
    border-color: var(--google-grey-200);
    opacity: 0.6;
}

.grid-cell[data-type="seat"] {
    background: linear-gradient(135deg, #fff8dc, #f5ead6);
    color: #8b4513;
    border-color: #deb887;
    box-shadow: 0 2px 8px rgba(139, 69, 19, 0.1);
}

.grid-cell[data-type="vacant"] {
    background: repeating-linear-gradient(45deg, #f9fafb, #f9fafb 6px, #eceff1 6px, #eceff1 12px);
    color: #9ca3af;
    border-color: #d1d5db;
    position: relative;
}

.grid-cell[data-type="vacant"]::after {
    content: '공석';
    font-size: 10px;
    font-weight: 600;
    color: #6b7280;
}

.grid-cell[data-type="seat"]:hover {
    background: linear-gradient(135deg, #fffadc, #f7ead0);
    box-shadow: 0 6px 16px rgba(139, 69, 19, 0.15);
}

.grid-cell[data-type="desk"] {
    /* Dark brown desk (교탁) */
    background: linear-gradient(135deg, #8b5a2b 0%, #654321 100%);
    color: #ffffff;
    border-color: #6d4423;
    box-shadow: 0 2px 8px rgba(101, 67, 33, 0.4);
}

.grid-cell[data-type="desk"]:hover {
    background: linear-gradient(135deg, #9c6430 0%, #533618 100%);
    box-shadow: 0 6px 16px rgba(101, 67, 33, 0.55);
}

.grid-cell[data-type="board"] {
    /* Board (칠판) now uses previous desk green */
    background: linear-gradient(135deg, var(--google-green-light), #d4eda8);
    color: var(--google-green);
    border-color: #a8e6a3;
    box-shadow: 0 2px 8px rgba(19, 115, 51, 0.1);
}

.grid-cell[data-type="board"]:hover {
    background: linear-gradient(135deg, #e8f5e8, #d6eda6);
    box-shadow: 0 6px 16px rgba(19, 115, 51, 0.15);
}

.grid-cell[data-type="door"] {
    background: linear-gradient(135deg, var(--google-orange-light), #ffe0b3);
    color: #e8a100;
    border-color: #ffe0b3;
    box-shadow: 0 2px 8px rgba(232, 161, 0, 0.1);
}

.grid-cell[data-type="door"]:hover {
    background: linear-gradient(135deg, #fff4e0, #ffdcaa);
    box-shadow: 0 6px 16px rgba(232, 161, 0, 0.15);
}

/* 팔레트 - 개선된 디자인 */
.palette {
    display: flex;
    gap: var(--space-2);
    flex-wrap: wrap;
    margin: var(--space-3) 0;
    padding: var(--space-3);
    background: var(--google-grey-50);
    border-radius: 8px;
    border: 1px solid var(--border-color);
}

.palette-btn {
    padding: var(--space-3) var(--space-4);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 2px solid transparent;
    min-width: 60px;
    text-align: center;
    font-family: 'Roboto', sans-serif;
    position: relative;
    backdrop-filter: blur(2px);
}

.palette-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(60, 64, 67, 0.15);
    border-color: rgba(26, 115, 232, 0.3);
}

.palette-btn.active {
    border-color: var(--google-blue);
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2), 0 0 0 1px var(--google-blue);
    transform: translateY(-1px);
}

.palette-btn.active::before {
    content: '✓';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 16px;
    height: 16px;
    background: var(--google-blue);
    color: white;
    border-radius: 50%;
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.palette-btn[data-type="seat"] {
    background: #fff8dc;
    color: #8b4513;
}

.palette-btn[data-type="vacant"] {
    background: #f1f5f9;
    color: #475569;
}

.palette-btn[data-type="desk"] {
    /* Dark brown desk (교탁) */
    background: linear-gradient(135deg, #8b5a2b 0%, #654321 100%);
    color: #ffffff;
}

.palette-btn[data-type="board"] {
    /* Board (칠판) now uses previous desk green */
    background: linear-gradient(135deg, var(--google-green-light), #d4eda8);
    color: var(--google-green);
}

.palette-btn[data-type="door"] {
    background: var(--google-orange-light);
    color: #e8a100;
}

.palette-btn[data-type="empty"] {
    background: var(--google-grey-50);
    color: var(--text-disabled);
}

/* 학생 관리 - 개선된 디자인 */
.student-management-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-5);
    padding: var(--space-4);
}

.add-student-form {
    background: linear-gradient(135deg, var(--google-blue-50), var(--google-grey-50));
    padding: var(--space-4);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.08);
}

.student-list {
    list-style: none;
    max-height: 320px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(60, 64, 67, 0.08);
}

.student-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-3) var(--space-4);
    border-bottom: 1px solid var(--google-grey-100);
    font-size: 13px;
    color: var(--text-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.student-item:last-child {
    border-bottom: none;
}

.student-item:hover {
    background: linear-gradient(90deg, var(--google-blue-50), transparent);
    transform: translateX(4px);
    padding-left: var(--space-5);
}

.student-delete-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: var(--space-2);
    border-radius: 50%;
    font-size: 14px;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    opacity: 0;
}

.student-item:hover .student-delete-btn {
    opacity: 1;
}

.student-delete-btn:hover {
    background: var(--google-red-light);
    color: var(--google-red);
    transform: scale(1.1);
}

/* 학생 이름 표시 - 향상된 디자인 */
.student-name-pill {
    position: absolute;
    bottom: 2px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, rgba(32, 33, 36, 0.9), rgba(32, 33, 36, 0.95));
    color: white;
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 8px;
    font-weight: 600;
    white-space: nowrap;
    pointer-events: none;
    font-family: 'Roboto', sans-serif;
    max-width: calc(var(--cell-size) - 6px);
    overflow: hidden;
    text-overflow: ellipsis;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.seat-number-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: linear-gradient(135deg, rgba(26, 115, 232, 0.9), rgba(21, 87, 176, 0.9));
    color: white;
    border-radius: 4px;
    padding: 1px 3px;
    font-size: 7px;
    font-weight: 700;
    line-height: 1;
    pointer-events: none;
    font-family: 'Roboto', sans-serif;
    box-shadow: 0 1px 2px rgba(26, 115, 232, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* 에디터 컨트롤 - 개선된 디자인 */
.editor-controls {
    padding: var(--space-5);
    background: linear-gradient(135deg, var(--google-grey-50), var(--surface-variant));
    border-bottom: 1px solid var(--border-color);
    border-radius: 12px 12px 0 0;
    box-shadow: 0 2px 4px rgba(60, 64, 67, 0.08);
}

.control-group {
    display: flex;
    gap: var(--space-3);
    align-items: center;
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
    padding: var(--space-3);
    background: var(--surface);
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.08);
}

.control-group:last-child {
    margin-bottom: 0;
}

.control-group label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    font-family: 'Google Sans', sans-serif;
}

.control-group input[type="number"],
.control-group select {
    padding: var(--space-2) var(--space-3);
    border: 2px solid var(--border-color);
    border-radius: 6px;
    font-size: 13px;
    background: var(--surface);
    color: var(--text-primary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: 'Roboto', sans-serif;
}

.control-group input[type="number"]:focus,
.control-group select:focus {
    outline: none;
    border-color: var(--google-blue);
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.1);
    transform: translateY(-1px);
}

.control-group input[type="number"] {
    width: 64px;
    text-align: center;
}

.control-group select {
    min-width: 120px;
}

/* 웰컴 뷰 */
#welcome-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: var(--space-10);
    text-align: center;
}

#welcome-view h2 {
    font-size: 20px;
    font-weight: 400;
    color: var(--text-primary);
    margin-bottom: var(--space-3);
    font-family: 'Google Sans', sans-serif;
}

#welcome-view p {
    font-size: 14px;
    color: var(--text-secondary);
    max-width: 400px;
    line-height: 1.6;
}

/* 반응형 - 최적화 */
@media (max-width: 1024px) {
    .main-layout {
        grid-template-columns: 280px 1fr;
        gap: var(--space-3);
        padding: var(--space-3);
    }
}

@media (max-width: 768px) {
    .main-layout {
        grid-template-columns: 1fr;
        padding: var(--space-3);
        gap: var(--space-3);
    }
    
    .sidebar {
        order: 2;
    }
    
    .student-management-grid {
        grid-template-columns: 1fr;
        gap: var(--space-3);
    }
    
    .panel-header {
        flex-wrap: wrap;
        gap: var(--space-2);
        padding: var(--space-3);
    }
    
    .control-group {
        flex-wrap: wrap;
        gap: var(--space-2);
    }
    
    :root {
        --cell-size: 40px;
        --grid-gap: 4px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0;
    }
    
    .header {
        padding: var(--space-3);
    }
    
    .header h1 {
        font-size: 20px;
    }
    
    .back-link {
        margin: var(--space-2);
    }
    
    :root {
        --cell-size: 36px;
        --grid-gap: 3px;
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 추가 모달 스타일 - 이름 편집용 */
.edit-name-modal .modal-content {
    max-width: 420px;
}

.edit-name-modal .modal-body {
    padding: var(--space-6);
}

.edit-name-modal .form-group input {
    font-size: 16px;
    padding: var(--space-4);
    border-radius: 8px;
    border: 2px solid var(--border-color);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.edit-name-modal .form-group input:focus {
    border-color: var(--google-blue);
    box-shadow: 0 0 0 3px rgba(26, 115, 232, 0.1);
    transform: translateY(-1px);
}

.edit-name-modal .modal-title {
    display: flex;
    align-items: center;
    gap: var(--space-2);
}

.edit-name-modal .modal-title::before {
    content: '✏️';
    font-size: 20px;
}