/* 공통 스타일 */
:root {
  --primary: #6366f1; /* Indigo 500 */
  --primary-dark: #4f46e5; /* Indigo 600 */
  --secondary: #64748b;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #0f172a;
  --success: #10b981;
  --danger: #ef4444;
  --accent: #818cf8;
}

[data-theme="dark"] {
  --bg: #020617;
  --card: #0f172a;
  --text: #f1f5f9;
  --primary: #818cf8;
  --primary-dark: #6366f1;
}

/* LITE Logo Styling */
.lite-logo {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -1.5px;
    color: var(--text);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: transform 0.2s;
}

.lite-logo:hover {
    transform: scale(1.02);
}

.lite-logo span {
    color: var(--primary);
    position: relative;
}

.lite-logo span::after {
    content: '';
    position: absolute;
    bottom: 4px;
    left: 0;
    width: 100%;
    height: 4px;
    background: var(--success);
    opacity: 0.3;
    border-radius: 2px;
}

.lite-tagline {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--secondary);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: -4px;
    opacity: 0.8;
}

body {
  font-family: 'Pretendard', sans-serif;
  background-color: var(--bg);
  color: var(--text);
  margin: 0;
  transition: background-color 0.3s;
}

.container {
  max-width: 800px;
  margin: 0 auto;
  padding: 2rem;
}

@media (max-width: 600px) {
  .container {
    padding: 1rem;
  }
}

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

@media (max-width: 600px) {
  header {
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 2rem;
  }
  
  header div:last-child {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
  }
}

/* 메인 대시보드 카드 */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
}

@media (max-width: 600px) {
  .grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
}

.exam-card {
  background: var(--card);
  padding: 2rem;
  border-radius: 1rem;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
  border: 1px solid transparent;
}

@media (max-width: 600px) {
  .exam-card {
    padding: 1.5rem;
  }
}

.exam-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 15px -3px rgb(0 0 0 / 0.1);
  border-color: var(--primary);
}

.exam-card h3 {
  margin: 0 0 0.5rem 0;
  font-size: 1.25rem;
}

.exam-card p {
  color: var(--secondary);
  font-size: 0.875rem;
}

/* 퀴즈 UI */
.quiz-header {
  margin-bottom: 2rem;
}

.progress-bar {
  width: 100%;
  height: 8px;
  background: #e2e8f0;
  border-radius: 4px;
  overflow: hidden;
  margin-top: 1rem;
}

@media (max-width: 600px) {
  .quiz-header {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }
}

.progress-fill {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.3s;
}

.option-btn {
  width: 100%;
  text-align: left;
  padding: 1rem;
  margin-bottom: 0.75rem;
  border: 2px solid #e2e8f0;
  border-radius: 0.75rem;
  background: var(--card);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
}

@media (max-width: 600px) {
  .option-btn {
    padding: 0.85rem;
    font-size: 0.95rem;
  }
}

.option-btn:hover:not(:disabled) {
  border-color: var(--primary);
  background: rgba(79, 70, 229, 0.05);
}

.option-btn.correct {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.1);
}

.option-btn.wrong {
  border-color: var(--danger);
  background: rgba(239, 68, 68, 0.1);
}

.explanation {
  margin-top: 1.5rem;
  padding: 1.5rem;
  background: rgba(0,0,0,0.05);
  border-radius: 0.75rem;
  display: none;
}

.nav-btns {
  margin-top: 2rem;
  display: flex;
  gap: 1rem;
}

button.primary {
  flex: 1;
  padding: 1rem;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 0.75rem;
  font-weight: bold;
  cursor: pointer;
}

.theme-toggle {
    background: var(--card);
    border: 1px solid #e2e8f0;
    padding: 0.75rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 1.25rem;
    color: var(--text);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.theme-toggle:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

footer {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    text-align: center;
    font-size: 0.85rem;
    color: var(--secondary);
    clear: both; /* Added to explicitly clear preceding floats */
}

@media (max-width: 600px) {
    footer {
        margin-top: 3rem;
    }
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 600px) {
    .footer-links {
        gap: 0.75rem 1rem;
    }
}

.footer-links a {
    color: var(--secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.hero-section {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 1rem;
    margin-bottom: 3rem;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
    line-height: 1.6;
}

@media (max-width: 600px) {
    .hero-section {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    .hero-section h2 {
        font-size: 1.25rem;
    }
    .hero-section p {
        font-size: 0.95rem;
    }
}

.hero-section h2 {
    margin-top: 0;
    color: var(--primary);
}

.content-page {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 1rem;
    line-height: 1.8;
    overflow: hidden; /* Added to establish a new Block Formatting Context */
}

@media (max-width: 600px) {
    .content-page {
        padding: 1.5rem;
    }
}

/* 연락처 폼 스타일 */
.contact-form {
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 600;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.5rem;
    background: var(--card);
    color: var(--text);
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.2s;
}

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

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

.contact-form button[type="submit"] {
    margin-top: 1rem;
}

/* 모달 관련 스타일 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--card);
    padding: 2.5rem;
    border-radius: 1.5rem;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    position: relative;
    animation: modal-up 0.3s ease-out;
}

@keyframes modal-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.modal-header {
    text-align: center;
    margin-bottom: 2rem;
}

.modal-header h2 {
    margin: 0;
    font-size: 1.5rem;
    color: var(--primary);
}

.modal-header p {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.auth-input-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary);
}

.auth-input-group input {
    padding: 0.75rem 1rem;
    border: 2px solid #e2e8f0;
    border-radius: 0.75rem;
    background: var(--card);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.2s;
}

.auth-input-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.auth-submit-btn {
    padding: 0.85rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: filter 0.2s;
    margin-top: 0.5rem;
}

.auth-submit-btn:hover {
    filter: brightness(1.1);
}

.auth-switch {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--secondary);
}

.auth-switch button {
    background: none;
    border: none;
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0 0.25rem;
}

/* AI Chat UI */
.ai-chat-container {
    margin-top: 1rem;
    border-top: 1px solid rgba(0,0,0,0.1);
    padding-top: 1rem;
}

.ai-chat-box {
    background: var(--card);
    border: 1px solid #e2e8f0;
    border-radius: 0.75rem;
    margin-top: 0.5rem;
    display: none;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.05);
}

.ai-messages {
    max-height: 300px;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
}

.message {
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    max-width: 85%;
    word-break: break-word;
}

.message.user {
    align-self: flex-end;
    background: var(--primary);
    color: white;
}

.message.ai {
    align-self: flex-start;
    background: rgba(0,0,0,0.05);
    color: var(--text);
    border: 1px solid #e2e8f0;
}

[data-theme="dark"] .message.ai {
    background: rgba(255,255,255,0.05);
}

.ai-input-area {
    display: flex;
    padding: 0.75rem;
    border-top: 1px solid #e2e8f0;
    gap: 0.5rem;
    background: var(--bg);
}

.ai-input-area input {
    flex: 1;
    padding: 0.5rem 0.75rem;
    border: 1px solid #e2e8f0;
    border-radius: 0.5rem;
    background: var(--card);
    color: var(--text);
    font-size: 0.9rem;
}

.ai-input-area button {
    padding: 0.5rem 1rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
}

.ai-ask-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

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


