:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --text-main: #f8fafc;
    --text-muted: #cbd5e1;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    --error-color: #ef4444;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    overflow-x: hidden;
}

/* Background Shapes */
.background-shapes {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    overflow: hidden;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
}

.shape-1 {
    top: -10%;
    left: -10%;
    width: 40vw;
    height: 40vw;
    background: rgba(99, 102, 241, 0.4);
    animation: float 10s ease-in-out infinite alternate;
}

.shape-2 {
    bottom: -10%;
    right: -10%;
    width: 35vw;
    height: 35vw;
    background: rgba(139, 92, 246, 0.3);
    animation: float 12s ease-in-out infinite alternate-reverse;
}

.shape-3 {
    top: 40%;
    left: 60%;
    width: 20vw;
    height: 20vw;
    background: rgba(14, 165, 233, 0.3);
    animation: float 8s ease-in-out infinite alternate;
}

@keyframes float {
    0% { transform: translateY(0) translateX(0); }
    100% { transform: translateY(-30px) translateX(30px); }
}

/* Glassmorphism Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 1.5rem;
}

.container {
    width: 90%;
    max-width: 450px;
    padding: 2.5rem;
    margin-top: 5vh;
    margin-bottom: 5vh;
    display: flex;
    flex-direction: column;
}

.title {
    font-size: 1.75rem;
    font-weight: 700;
    text-align: center;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #a5b4fc, #c084fc);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 2rem;
}

.select-group, .password-group {
    margin-bottom: 1.25rem;
    animation: slideDown 0.3s ease forwards;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-muted);
}

.form-select, .form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: white;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s ease;
    outline: none;
}

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

.form-select option {
    background-color: var(--bg-color);
    color: white;
}

.btn {
    width: 100%;
    padding: 0.875rem;
    border-radius: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-family: inherit;
}

.primary-btn {
    background: var(--primary-color);
    color: white;
    margin-top: 1rem;
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

.outline-btn {
    background: transparent;
    border: 1px solid var(--text-muted);
    color: var(--text-muted);
    padding: 0.5rem 1rem;
    width: auto;
}

.outline-btn:hover {
    border-color: white;
    color: white;
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-size: 0.85rem;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--glass-border);
}

.divider span {
    padding: 0 10px;
}

.error-msg {
    color: var(--error-color);
    font-size: 0.85rem;
    margin-top: 0.5rem;
    display: none;
}

.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 10;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.show {
    opacity: 1;
}

.modal-content {
    padding: 2rem;
    width: 90%;
    max-width: 400px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
}

.modal.show .modal-content {
    transform: scale(1);
}

.close-btn {
    position: absolute;
    top: 1rem;
    right: 1.5rem;
    color: var(--text-muted);
    font-size: 1.5rem;
    font-weight: bold;
    cursor: pointer;
}

.close-btn:hover {
    color: white;
}

/* Main App Layout */
.navbar {
    width: 100%;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-top: none;
}

.logo {
    font-weight: 700;
    font-size: 1.25rem;
}

.main-container {
    width: 90%;
    max-width: 1000px;
    margin-top: 2rem;
    flex: 1;
}

.welcome-avatar-wrapper {
    display: flex;
    justify-content: center;
    width: 100%;
}

.teacher-avatar-container {
    position: relative;
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.teacher-avatar-img {
    width: 100%;
    max-width: 100%; /* 아래 컨텐츠 영역과 가로폭 맞춤 */
    max-height: 400px; /* 배너처럼 보이게 세로 길이 제한 */
    height: auto;
    object-fit: cover;
    object-position: center 10%; /* 얼굴/턱 부분이 잘 보이도록 조정 */
    border-radius: 1.5rem;
    margin-bottom: 1.5rem; /* 텍스트 박스와의 간격 */
}

.teacher-avatar-text {
    width: 100%;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.teacher-avatar-text h1 {
    font-size: 1.4rem;
    color: white;
    margin-bottom: 0.5rem;
}

.teacher-avatar-text .subtitle {
    margin-bottom: 0; /* 불필요한 하단 여백 제거 */
}

.app-content {
    padding: 2rem;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.placeholder-box {
    text-align: center;
    color: var(--text-muted);
}

.placeholder-box svg {
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Animations */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

.delay-1 {
    animation-delay: 0.2s;
    opacity: 0;
}

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

/* Mobile responsive adjustments */
@media (max-width: 600px) {
    .container {
        width: 95%;
        padding: 1.5rem;
    }
    
    .title {
        font-size: 1.5rem;
    }
    
    .teacher-avatar-text h1 {
        font-size: 1.1rem;
    }
    .teacher-avatar-text {
        width: 95%;
        padding: 1rem;
        bottom: 2%;
    }
}

/* Generator UI Styles */
.generator-container {
    width: 100%;
}

.form-row {
    display: flex;
    gap: 1.5rem;
}

.w-50 {
    width: 50%;
}

.keyword-input-wrap {
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    padding: 0;
    flex-shrink: 0;
}

.keyword-pills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.keyword-pill {
    background: rgba(99, 102, 241, 0.2);
    border: 1px solid rgba(99, 102, 241, 0.4);
    color: var(--text-main);
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    animation: fadeIn 0.2s ease;
}

.keyword-pill button {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
}

.keyword-pill button:hover {
    color: white;
}

/* Loading & Result Area */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-top: 2rem;
    gap: 1rem;
    color: var(--text-muted);
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    border-top-color: var(--primary-color);
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.result-container {
    border-top: 1px solid var(--glass-border);
    padding-top: 1.5rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.result-header h3 {
    font-size: 1.25rem;
    color: white;
}

.small-btn {
    padding: 0.4rem 0.8rem;
    font-size: 0.85rem;
}

.result-textarea {
    resize: vertical;
    min-height: 300px;
    line-height: 1.6;
    background: rgba(0, 0, 0, 0.2);
}

@media (max-width: 600px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    .w-50 {
        width: 100%;
    }
}
