:root {
    --bg-color: #050505;
    --card-bg: #111111;
    --text-primary: #ffffff;
    --text-secondary: #a0a0a0;
    --accent-color: #00f2ff;
    --error-color: #ff4d4d;
    --success-color: #4dff88;
    --shadow-deep: 0 10px 30px rgba(0, 0, 0, 0.7);
    --glow-effect: 0 0 15px rgba(0, 242, 255, 0.4);
    --font-main: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    overflow-x: hidden;
    min-height: 100vh;
}

#app {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

button {
    cursor: pointer;
    border: none;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

button:active {
    transform: scale(0.95);
}

.glass-card {
    background: var(--card-bg);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 24px;
    padding: 24px;
    box-shadow: var(--shadow-deep);
}

/* Auth Component Styles */
.auth-container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 100vh;
    gap: 20px;
}

.auth-logo {
    font-size: 2.5rem;
    font-weight: 800;
    background: linear-gradient(to bottom right, #fff, #888);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 10px;
}

.auth-input {
    width: 100%;
    padding: 16px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
}

.auth-btn:hover {
    box-shadow: 0 0 25px rgba(0, 242, 255, 0.6);
    transform: translateY(-2px);
}

/* Full Screen Calendar Grid */
.calendar-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 40px);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.calendar-month-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    grid-auto-rows: 1fr;
    gap: 12px;
    flex-grow: 1;
}

.calendar-day-square {
    background: #1a1a1a;
    border-radius: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid #333;
    position: relative;
}

.calendar-day-square:hover {
    background: #252525;
    border-color: var(--accent-color);
    transform: translateY(-4px);
    box-shadow: var(--glow-effect);
}

.calendar-day-square.has-record::after {
    content: '';
    position: absolute;
    bottom: 12px;
    width: 8px;
    height: 8px;
    background: var(--accent-color);
    border-radius: 50%;
    box-shadow: 0 0 10px var(--accent-color);
}

.calendar-day-number {
    font-size: 1.5rem;
    font-weight: 700;
}

/* Setup View Styles */
.setup-container {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 40px);
}

.setup-grid {
    display: grid;
    grid-template-columns: 1fr; /* 세로로 한 줄씩 배치 */
    gap: 15px;
    margin-top: 20px;
}

.setup-item-card {
    background: #151515;
    border: 2px solid #333;
    border-radius: 20px;
    /* aspect-ratio 제거 */
    display: flex;
    flex-direction: row; /* 가로로 정렬 */
    align-items: center;
    justify-content: space-between;
    padding: 20px 30px;
    position: relative;
    transition: all 0.3s ease;
    width: 100%;
}

.setup-item-card:focus-within {
    border-color: var(--accent-color);
    box-shadow: var(--glow-effect);
}

.setup-item-name {
    background: none;
    border: none;
    color: white;
    font-size: 1.2rem;
    font-weight: 700;
    text-align: left; /* 왼쪽 정렬 */
    flex-grow: 1;
    margin-bottom: 0;
    margin-right: 20px;
}

.setup-item-weight-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.3rem;
    color: var(--accent-color);
    font-weight: 800;
}

.setup-weight-input {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid #444;
    border-radius: 8px;
    color: var(--accent-color);
    width: 65px;
    text-align: center;
    font-size: 1.1rem;
    padding: 5px;
}

.add-btn-card {
    background: #0a0a0a;
    border: 2px dashed #444;
    color: #444;
    font-size: 2rem;
    cursor: pointer;
    border-radius: 20px;
    height: 70px; /* 높이 고정으로 가로가 긴 형태 유지 */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
}

.add-btn-card:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(0, 242, 255, 0.05);
}

.weight-status-bar {
    position: sticky;
    bottom: 20px;
    background: var(--card-bg);
    padding: 20px;
    border-radius: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -10px 30px rgba(0,0,0,0.5);
    margin-top: auto;
    border: 1px solid #333;
}

.complete-btn {
    padding: 12px 30px;
    background: var(--accent-color);
    color: black;
    font-weight: 800;
    border-radius: 12px;
    opacity: 0.5;
    pointer-events: none;
}

.complete-btn.active {
    opacity: 1;
    pointer-events: auto;
    box-shadow: var(--glow-effect);
}

.remove-item-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    color: var(--error-color);
    background: none;
    font-size: 1.2rem;
}

.back-btn {
    padding: 12px 24px;
    background: #222;
    color: var(--text-secondary);
    margin-bottom: 20px;
    border-radius: 12px;
    font-weight: 600;
}

input[type="range"] {
    accent-color: var(--accent-color);
}

.ai-reason-card {
    border-left: 4px solid var(--accent-color);
    padding: 20px;
    background: linear-gradient(90deg, #0f1c24 0%, #050505 100%);
    border-radius: 0 16px 16px 0;
    line-height: 1.6;
    margin-top: 20px;
}

.deficiency-alert {
    color: var(--error-color);
    font-weight: bold;
    margin-top: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

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