* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: wheat;
    min-height: 100vh;
    padding: 20px;
    overflow-x: hidden;
}

/* 페이지 인디케이터 */
.page-indicator {
    position: fixed;
    bottom: 50px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
    z-index: 1000;
}

.indicator-dot {
    width: 30px;
    height: 30px;
    border-radius: 20%;
    border: 2px solid #667eea;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.3rem;
    font-weight: 500;
    color: #667eea;
}

.indicator-dot.active {
    background: #667eea;
    color: white;
}

/* 슬라이드 컨테이너 */
.slides-container {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 0 auto;
}

.slide {
    display: none;
    width: 100%;
}

.slide.active {
    display: block;
    animation: slideIn 0.5s ease-in-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.container {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    max-width: 600px;
    width: 100%;
    text-align: center;
}

header h1 {
    color: #333;
    margin-bottom: 10px;
    font-size: 2.5rem;
    font-weight: 700;
}

.subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 30px;
    font-weight: 400;
}

.subtitle2 {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 5px;
    font-weight: 400;
}

.subtitle2-small {
    color: #666;
    font-size: 0.8rem;
    margin-bottom: 30px;
    font-weight: 400;
}

.controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.input-group label {
    color: #555;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* 체크박스 토글 스위치 스타일 */
.checkbox-group {
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-switch {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    user-select: none;
}

.toggle-switch input[type="checkbox"] {
    display: none;
}

.toggle-slider {
    position: relative;
    width: 50px;
    height: 26px;
    background: #e1e5e9;
    border-radius: 13px;
    transition: all 0.3s ease;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    top: 3px;
    left: 3px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::before {
    transform: translateX(24px);
}

.toggle-label {
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    transition: color 0.3s ease;
}

.toggle-switch input[type="checkbox"]:checked ~ .toggle-label {
    color: #667eea;
}

.toggle-switch:hover .toggle-slider {
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15), 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.period-selector {
    margin-top: 20px;
    padding: 20px;
    background: linear-gradient(135deg, #e0f2fe 0%, #bae6fd 100%);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    animation: fadeIn 0.3s ease-in;
}

.period-inputs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.period-input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.period-input-group label {
    font-size: 0.9rem;
    font-weight: 600;
    color: #333;
}

.period-input-group input[type="date"] {
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    background: white;
    color: #333;
    transition: all 0.3s ease;
}

.period-input-group input[type="date"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.progress-section {
    margin-bottom: 40px;
}

.time-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 80px;
}

.current-time, .remaining-time {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: black;
    padding: 20px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(240, 147, 251, 0.3);
}

.current-time .label, .remaining-time .label {
    display: block;
    font-size: 0.9rem;
    margin-bottom: 8px;
    opacity: 0.9;
}

.current-time .value, .remaining-time .value {
    display: block;
    font-size: 1.8rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.remaining-time-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.arrow-icon {
    font-size: 0.9rem;
    color: #667eea;
    cursor: pointer;
    transition: transform 0.3s ease;
    user-select: none;
}

.arrow-icon:hover {
    color: #764ba2;
    transform: scale(1.1);
}

.remaining-months {
    margin-top: 10px;
    font-size: 1rem;
    font-weight: 600;
    color: #555;
    text-align: center;
    animation: fadeIn 0.3s ease-in;
}

.progress-container {
    position: relative;
    background: #e1e5e9;
    height: 20px;
    border-radius: 10px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.progress-bar {
    width: 100%;
    height: 100%;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #5bb1fde8 0%, #8fc9ffb0 100%);
    border-radius: 10px;
    width: 0%;
    transition: none; /* JavaScript에서 애니메이션을 제어하므로 CSS transition 비활성화 */
    position: relative;
    overflow: hidden;
}

.progress-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 700;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.runner-icon {
    position: absolute;
    top: -45px; /* 바 위쪽에 표시 */
    left: 0;
    transform: translateX(-50%);
    width: 50px;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    animation: run-bounce 0.8s infinite ease-in-out;
    pointer-events: none;
}

.beer-icon {
    position: absolute;
    top: -60px; /* 바 위쪽 우측 고정 */
    right: -30px;
    width: 65px;
    height: 65px;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,0.2));
    pointer-events: none;
}

@keyframes run-bounce {
    0%, 100% { transform: translateX(-50%) translateY(0); }
    50% { transform: translateX(-50%) translateY(-4px); }
}

.salary-section {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.daily-salary, .hourly-salary {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(168, 237, 234, 0.3);
}

.daily-salary .label {
    display: block;
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.hourly-salary .label {
    display: block;
    color: #555;
    font-size: 0.9rem;
    margin-bottom: 10px;
    font-weight: 600;
}

.daily-salary .value, .hourly-salary .value {
    display: block;
    color: #333;
    font-size: 1.5rem;
    font-weight: 700;
    font-family: 'Courier New', monospace;
}

.status-message {
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    color: #8b4513;
    padding: 20px;
    border-radius: 15px;
    font-size: 1.1rem;
    font-weight: 600;
    box-shadow: 0 10px 20px rgba(255, 236, 210, 0.3);
    animation: pulse 2s infinite;
    margin-bottom: 20px;
}

.quote-section {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 10px 20px rgba(168, 237, 234, 0.3);
    margin-top: 20px;
}

.quote-text {
    color: #333;
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.6;
    text-align: center;
    font-weight: 500;
    animation: fadeIn 1s ease-in;
}

.quote-text.fadeIn {
    animation: fadeIn 1s ease-in;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.02); }
}

/* 반응형 디자인 */
@media (max-width: 768px) {
    .container {
        padding: 30px 20px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    .controls {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .time-info, .salary-section {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .current-time .value, .remaining-time .value {
        font-size: 1.5rem;
    }
    
    .daily-salary .value, .hourly-salary .value {
        font-size: 1.3rem;
    }
}

/* 숫자 카운팅 애니메이션 */
.counting {
}

@keyframes countUp {
    from { transform: scale(1.2); opacity: 0.7; }
    to { transform: scale(1); opacity: 1; }
}

/* 행복한 일 페이지 스타일 */
.happiness-section {
    margin-bottom: 40px;
}

.happiness-gauge-container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    margin-bottom: 20px;
}

.happiness-gauge {
    position: relative;
    width: 100%;
    max-width: 400px;
    height: 30px;
    background: #e1e5e9;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.happiness-fill {
    height: 100%;
    background: linear-gradient(90deg, #5bb1fde8 0%, #8fc9ffb0 100%);
    border-radius: 15px;
    width: 0%;
    transition: width 0.5s ease;
    position: relative;
}

.happiness-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #333;
    font-weight: 700;
    font-size: 0.9rem;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
    z-index: 1;
}

.happiness-emoji {
    font-size: 3rem;
    animation: bounce 1s infinite;
}

@keyframes bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

/* To-do 입력 섹션 */
.todo-input-section {
    margin-bottom: 30px;
}

.todo-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#todo-input {
    flex: 1;
    padding: 15px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

#todo-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.add-btn {
    padding: 15px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.add-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.3);
}

.add-btn:active {
    transform: translateY(0);
}

/* To-do 리스트 */
.todo-list-section {
    margin-bottom: 30px;
}

.todo-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.todo-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 20px;
    background: linear-gradient(135deg, #ffecd2 0%, #fcb69f 100%);
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(255, 236, 210, 0.3);
    transition: all 0.3s ease;
    animation: slideInItem 0.3s ease-out;
}

@keyframes slideInItem {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.todo-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 236, 210, 0.4);
}

.todo-item.completed {
    background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%);
    opacity: 0.8;
}

.todo-checkbox {
    width: 24px;
    height: 24px;
    cursor: pointer;
    accent-color: #667eea;
}

.todo-text {
    flex: 1;
    font-size: 1.1rem;
    color: #333;
    text-align: left;
    word-break: break-word;
}

.todo-item.completed .todo-text {
    text-decoration: line-through;
    color: #666;
}

.todo-delete {
    background: #ff6b6b;
    color: white;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.todo-delete:hover {
    background: #ff5252;
    transform: scale(1.1);
}

/* 저장 섹션 */
.save-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.save-btn {
    padding: 15px 40px;
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(79, 172, 254, 0.3);
}

.save-message {
    color: #4facfe;
    font-size: 0.9rem;
    font-weight: 500;
    min-height: 20px;
}

/* 반응형 - 행복한 일 페이지 */
@media (max-width: 768px) {
    .page-indicator {
        bottom: 10px;
        left: 50%;
        transform: translateX(-50%);
    }
    
    .happiness-gauge-container {
        flex-direction: column;
        gap: 15px;
    }
    
    .happiness-emoji {
        font-size: 2.5rem;
    }
    
    .todo-input-group {
        flex-direction: column;
    }
    
    .add-btn {
        width: 100%;
    }
}

/* 카드 뽑기 섹션 */
.card-draw-section {
    margin: 40px 0;
}

.draw-card-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 18px 40px;
    font-size: 1.3rem;
    font-weight: 700;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.3);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.draw-card-btn:hover:not(:disabled) {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.4);
}

.draw-card-btn:active:not(:disabled) {
    transform: translateY(-1px);
}

.draw-card-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* 카드 컨테이너 */
.card-container {
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 30px;
}

/* 카드 플레이스홀더 */
.card-placeholder {
    width: 100%;
    max-width: 400px;
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.card-placeholder-text {
    color: #999;
    font-size: 1.2rem;
    font-weight: 500;
}

/* 카드 뒤집기 애니메이션 */
.card-flipping {
    width: 100%;
    max-width: 400px;
    height: 300px;
    perspective: 1000px;
}

.card-back {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 5rem;
    color: white;
    font-weight: 700;
    animation: flipCard 0.8s ease-in-out;
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
}

@keyframes flipCard {
    0% {
        transform: rotateY(0deg);
    }
    50% {
        transform: rotateY(180deg) scale(0.9);
    }
    100% {
        transform: rotateY(360deg) scale(1);
    }
}

/* 카드 */
.card {
    width: 100%;
    max-width: 400px;
    min-height: 300px;
    background: linear-gradient(135deg, #ffeaa7 0%, #fab1a0 100%);
    border-radius: 20px;
    padding: 40px 30px;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% {
        transform: rotate(0deg);
    }
    100% {
        transform: rotate(360deg);
    }
}

.card-appear {
    animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
    0% {
        opacity: 0;
        transform: scale(0.8) translateY(30px);
    }
    50% {
        transform: scale(1.05) translateY(-10px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* 카드 SVG 그래픽 */
.card-graphic {
    width: 160px;
    height: 160px;
    margin-bottom: 20px;
    animation: floatUp 1s ease-in-out;
    filter: drop-shadow(0 5px 10px rgba(0, 0, 0, 0.18));
    z-index: 1;
}

.card-graphic svg {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

.card-graphic img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: contain;
}

@keyframes floatUp {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

/* 카드 메시지 */
.card-message {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2d3436;
    text-align: center;
    line-height: 1.6;
    word-break: keep-all;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(255, 255, 255, 0.5);
}

/* 반응형 디자인 */
@media (max-width: 600px) {
    .draw-card-btn {
        padding: 15px 30px;
        font-size: 1.1rem;
    }
    
    .card,
    .card-back,
    .card-placeholder {
        max-width: 100%;
        height: 250px;
    }
    
    .card-graphic {
        width: 130px;
        height: 130px;
        margin-bottom: 15px;
    }
    
    .card-message {
        font-size: 1.2rem;
    }
    
    .card-container {
        min-height: 250px;
    }
}

/* 페이지 4: 격자 링크 카드 (인스타그램 검색 탭 스타일) */
.container:has(.link-cards-grid) {
    max-width: 640px;
}

.link-cards-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(160px, 1fr));
    gap: 4px;
    margin-top: 16px;
    max-width: 100%;
}

.link-card {
    display: flex;
    flex-direction: column;
    background: #fff;
    border-radius: 0;
    overflow: hidden;
    box-shadow: none;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease;
}

.link-card:hover {
    opacity: 0.85;
}

.link-card-image {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background: #efefef;
    border-radius: 0;
}

.link-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    vertical-align: top;
}

.link-card-title {
    padding: 10px 12px 0;
    font-size: 0.9rem;
    font-weight: 600;
    color: #262626;
    margin: 0;
}

.link-card-content {
    padding: 4px 12px 12px;
    font-size: 0.8rem;
    color: #8e8e8e;
    line-height: 1.4;
    margin: 0;
}

@media (max-width: 768px) {
    .link-cards-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 2px;
    }
    .link-card-title {
        font-size: 0.8rem;
    }
    .link-card-content {
        font-size: 0.75rem;
        padding: 2px 8px 10px;
    }
}
