:root {
    --primary-color: #6c5ce7;
    --secondary-color: #a29bfe;
    --accent-color: #fdcb6e;
    --text-color: #2d3436;
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --header-bg: #ffffff;
    --border-color: #eeeeee;
    --white: #ffffff;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --radius: 12px;
}

body.dark-mode {
    --text-color: #f1f3f5;
    --bg-color: #212529;
    --card-bg: #343a40;
    --header-bg: #343a40;
    --border-color: #495057;
    --white: #343a40;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    transition: background-color 0.3s, color 0.3s;
}

#app {
    width: 100%;
    max-width: 480px;
    background-color: var(--bg-color);
    /* 모바일 뷰 배경색 통일 */
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 다크모드 토글 버튼 */
.theme-toggle {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-color);
    padding: 0.5rem;
}

/* 카드 그리드 스타일 */
.test-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    width: 100%;
}

.test-card {
    background: var(--card-bg);
    border-radius: var(--radius);
    padding: 1rem;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform 0.2s;
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.test-card:hover {
    transform: translateY(-5px);
}

.test-thumbnail {
    font-size: 3rem;
    margin-bottom: 0.5rem;
}

.test-title {
    font-weight: bold;
    font-size: 1rem;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.test-participants {
    font-size: 0.75rem;
    color: #868e96;
}

.badge-new {
    background-color: var(--accent-color);
    color: #333;
    font-size: 0.6rem;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    font-weight: bold;
}

.main-header {
    padding: 0.8rem 1.2rem;
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    transition: background-color 0.3s;
}

.logo {
    font-weight: 800;
    font-size: 1.1rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 테마 전환 버튼 스타일 개선 */
.theme-btn {
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.theme-btn:hover {
    background-color: var(--border-color);
}

.container {
    flex: 1;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main-footer {
    padding: 1rem;
    text-align: center;
    font-size: 0.75rem;
    color: #868e96;
    background-color: #f8f9fa;
}

/* 유틸리티 클래스 */
.btn {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background-color: var(--primary-color);
    color: var(--white);
    border-radius: var(--radius);
    font-weight: bold;
    transition: transform 0.1s, background-color 0.2s;
    width: 100%;
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
}

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

.text-center {
    text-align: center;
}

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

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

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

.hidden {
    display: none !important;
}