:root {
    --bg-color: #F9F9F9;
    --card-bg: #FFFFFF;
    --text-main: #1A1A1A;
    --text-sub: #666666;
    --gray-light: #F5F5F5;
    --gray-border: #E0E0E0;
    --accent: #6366F1;
    --accent-dark: #4F46E5;
    --success: #059669; /* 세련된 딥 그린 */
    --warning: #E11D48; /* 세련된 로즈 레드 */
}

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

body:not(.landing-page) {
    font-family: 'Pretendard', -apple-system, BlinkMacSystemFont, system-ui, Roboto, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    padding: 80px 20px;
    position: relative;
}

/* 메인 레이아웃 */
.main-layout {
    width: 100%;
    max-width: 600px;
    text-align: center;
    padding-bottom: 100px;
}

.visual-element { position: relative; margin-bottom: 30px; display: inline-block; }
.graph-line { width: 120px; height: auto; opacity: 0.8; }
.coin-icon {
    position: absolute; bottom: -5px; right: -15px; width: 44px; height: 44px;
    background: linear-gradient(145deg, #ffffff, #e6e6e6); border-radius: 50%;
    box-shadow: 5px 5px 15px #d1d1d1, -5px -5px 15px #ffffff;
    display: flex; justify-content: center; align-items: center;
    font-weight: 800; font-size: 1.2rem; color: var(--text-main);
}

.main-header h1 { font-size: 3.8rem; font-weight: 800; letter-spacing: -2px; margin: 0; }
.main-pre-title, .hero-pre-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--accent);
    letter-spacing: 0.1em;
    margin-bottom: 8px;
    text-transform: uppercase;
}
.main-header .slogan { 
    font-family: 'Caveat', cursive;
    font-size: 1.8rem; 
    font-weight: 400; 
    color: var(--text-sub); 
    margin-top: 5px; 
    margin-bottom: 60px; 
}

.input-card {
    background: var(--card-bg); padding: 40px; border-radius: 32px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.04); margin-bottom: 60px; text-align: left;
}
.date-selector {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
    justify-content: flex-start;
}
.date-selector select {
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text-sub);
    border: 1px solid var(--gray-border);
    border-radius: 8px;
    padding: 5px 10px;
    outline: none;
    background-color: transparent;
    cursor: pointer;
    transition: border-color 0.3s;
}
.date-selector select:focus {
    border-color: var(--accent);
    color: var(--text-main);
}
.input-main-group { display: flex; align-items: center; gap: 15px; border-bottom: 1.5px solid var(--gray-border); padding-bottom: 10px; margin-top: 25px; }
.input-main-group input, .input-main-group select { border: none; outline: none; font-size: 1.05rem; background: transparent; font-family: inherit; color: var(--text-main); }
.input-cat { width: 80px; color: var(--text-sub); cursor: pointer; appearance: none; }
.input-cont { flex: 1; text-align: center; }
.input-amt { width: 100px; text-align: right; font-weight: 600; }
#add-btn { background: var(--text-main); color: white; border: none; padding: 12px 24px; border-radius: 50px; font-size: 0.9rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; flex-shrink: 0; }
#add-btn:hover { background: #444; transform: translateY(-2px); box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

.list-section { text-align: left; }
.list-header h2 { font-size: 0.85rem; text-transform: uppercase; letter-spacing: 2px; color: var(--text-sub); margin-bottom: 30px; text-align: center; }
#expense-list { list-style: none; }
#expense-list li { display: flex; justify-content: space-between; align-items: center; padding: 20px 0; border-bottom: 1px solid var(--gray-light); }
.item-left { display: flex; align-items: center; gap: 15px; }
.date-label { font-size: 0.75rem; color: #BBB; width: 75px; }
.category { font-size: 0.7rem; color: var(--text-sub); background-color: var(--gray-light); padding: 2px 8px; border-radius: 4px; min-width: 50px; text-align: center; }
.content { font-size: 1.05rem; }
.amount { font-weight: 600; text-align: right; font-size: 1.05rem; }
.item-right { 
    display: flex; 
    align-items: center; 
    gap: 12px; 
}
.delete-btn { 
    background-color: #FFF; 
    border: none; 
    color: #AAA; 
    width: 26px;
    height: 26px;
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: all 0.25s ease; 
    cursor: pointer; 
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.delete-btn:hover { 
    background-color: #FF5555; 
    color: #FFF; 
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 4px 10px rgba(255, 85, 85, 0.3);
}
/* Navigation */
.top-nav { 
    position: fixed; 
    top: 40px; 
    right: 40px; 
    display: flex; 
    align-items: center; 
    gap: 12px; 
    z-index: 100; 
}
.nav-btn { background: var(--card-bg); border: 1px solid var(--gray-border); color: var(--text-sub); padding: 8px 18px; border-radius: 20px; font-size: 0.85rem; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 2px 10px rgba(0,0,0,0.02); }
.nav-btn:hover { border-color: var(--accent); color: var(--accent); }
.nav-btn.highlight { border-color: var(--accent); color: var(--accent); font-weight: 600; }

/* Summary Panel */
.summary-panel {
    position: fixed; top: 40px; left: 40px; display: flex; flex-direction: column; gap: 25px;
    z-index: 10; width: 240px; background-color: var(--card-bg); padding: 30px 25px; border-radius: 24px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03), 0 1px 8px rgba(0, 0, 0, 0.02);
}

.welcome-text {
    position: fixed;
    top: 15px;
    left: 50px;
    z-index: 100;
    font-size: 0.85rem;
    font-weight: 300;
    color: #888;
    letter-spacing: -0.3px;
}

.welcome-text strong {
    font-weight: 700;
    color: var(--text-main);
}

.rename-btn {
    position: fixed;
    top: 15px;
    left: 240px;
    z-index: 100;
    background: none;
    border: 1px solid var(--gray-border);
    color: #AAA;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.rename-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    background-color: #FFF;
}
.summary-panel-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-main);
    margin-bottom: -5px;
    padding-bottom: 15px;
    border-bottom: 1.5px solid var(--gray-light);
    letter-spacing: -0.5px;
}
.summary-item { display: flex; flex-direction: column; gap: 8px; }
.summary-label { font-size: 0.7rem; font-weight: 600; color: var(--text-sub); text-transform: uppercase; letter-spacing: 0.05em; }
.summary-row { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.summary-value { font-size: 1.15rem; font-weight: 700; color: var(--text-main); white-space: nowrap; transition: color 0.3s ease; }

.goal-group { display: flex; align-items: center; gap: 6px; }
.summary-divider { color: #DDD; font-size: 0.9rem; font-weight: 600; }

/* Goal Box Styling */
.goal-box {
    display: flex;
    align-items: center;
    background-color: var(--gray-light);
    padding: 2px 8px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.3s ease;
}
.goal-box:focus-within {
    background-color: #FFF;
    border-color: var(--gray-border);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}
.goal-input { 
    width: 75px; 
    border: none; 
    font-size: 1.15rem; 
    font-weight: 700; 
    color: #555; /* 짙은 회색 */
    background: transparent; 
    outline: none; 
    text-align: right; 
    padding: 0; 
    transition: color 0.3s ease; 
}
.goal-input::placeholder { color: #BBB; font-size: 0.8rem; font-weight: 500; }
.goal-unit { font-size: 0.85rem; color: #999; font-weight: 600; margin-left: 2px; flex-shrink: 0; }

.ratio-bar-container { width: 100%; height: 3px; background-color: var(--gray-light); border-radius: 2px; overflow: hidden; margin-top: 4px; }
.ratio-bar { height: 100%; width: 0%; background-color: var(--accent); transition: all 0.6s cubic-bezier(0.22, 1, 0.36, 1); }
.ratio-text { font-size: 0.7rem; font-weight: 600; color: var(--text-sub); margin-top: 2px; }

/* Status Classes */
.status-safe { color: var(--accent) !important; }
.status-warning { color: var(--warning) !important; }
.status-warning-bg { background-color: rgba(225, 29, 72, 0.05) !important; }

/* Modal */
.modal { display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.4); backdrop-filter: blur(4px); z-index: 1000; justify-content: center; align-items: center; }
.modal-content { background-color: var(--card-bg); width: 90%; max-width: 400px; padding: 40px; border-radius: 32px; box-shadow: 0 30px 60px rgba(0, 0, 0, 0.12); }
.modal-content input, .modal-content textarea { font-family: inherit; }
.stats-content { max-width: 1000px; max-height: 85vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.modal-header h2 { font-size: 1.25rem; font-weight: 700; }
.close-btn { background: none; border: none; font-size: 1.5rem; color: var(--text-sub); cursor: pointer; }

/* Contact Modal specific styles */
#contact-modal .form-group { margin-bottom: 20px; }
#contact-modal input { width: 100%; padding: 15px 20px; border: 1px solid var(--gray-border); border-radius: 12px; font-size: 1rem; outline: none; transition: border-color 0.3s; }
#contact-modal textarea { width: 100%; height: 180px; padding: 15px 20px; border: 1px solid var(--gray-border); border-radius: 12px; font-size: 1rem; outline: none; resize: none; transition: border-color 0.3s; }
#contact-modal input:focus, #contact-modal textarea:focus { border-color: var(--accent); }

/* Share Modal Layout */
.share-body { display: flex; gap: 30px; overflow: hidden; height: 100%; }
.share-left-side { flex: 1; min-width: 320px; }
.share-right-side { flex: 1.5; display: flex; flex-direction: column; border-left: 1px solid var(--gray-light); padding-left: 30px; }

/* Share Feed Styles */
.share-input-area { background-color: #FAFAFA; padding: 25px; border-radius: 20px; text-align: center; }
.share-period-tabs { display: flex; gap: 8px; justify-content: center; margin-bottom: 20px; }
.period-tab { padding: 6px 14px; border-radius: 10px; border: 1px solid var(--gray-border); background: #FFF; font-size: 0.8rem; color: var(--text-sub); cursor: pointer; transition: all 0.3s ease; }
.period-tab.active { background-color: var(--accent); color: #FFF; border-color: var(--accent); }
.share-amount-display { margin-bottom: 20px; }
.share-amount-display span { font-size: 0.8rem; color: var(--text-sub); }
.share-amount-display h3 { font-size: 1.8rem; font-weight: 800; color: var(--text-main); margin-top: 5px; }
.share-input-area textarea { width: 100%; height: 120px; padding: 15px; border: 1px solid var(--gray-border); border-radius: 12px; outline: none; font-family: inherit; font-size: 0.95rem; resize: none; margin-bottom: 15px; transition: border-color 0.3s ease; }
.share-input-area textarea:focus { border-color: var(--accent); }

.share-feed-container { overflow-y: auto; flex: 1; padding-right: 10px; }
.feed-item { padding: 20px; border-bottom: 1px solid var(--gray-light); }
.feed-user { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.feed-meta { display: flex; align-items: center; gap: 10px; }
.user-name { font-weight: 700; font-size: 0.95rem; }
.feed-date { font-size: 0.75rem; color: #BBB; }
.post-delete-btn { background: none; border: none; font-size: 1.2rem; color: #DDD; cursor: pointer; padding: 0 5px; line-height: 1; transition: color 0.2s; }
.post-delete-btn:hover { color: #FF5555; }
.feed-content { font-size: 1rem; margin-bottom: 12px; color: #444; text-align: left; line-height: 1.5; }
.feed-footer { display: flex; justify-content: space-between; align-items: center; }
.feed-amount { font-size: 0.85rem; color: var(--text-sub); text-align: left; }
.feed-amount span { font-weight: 700; color: var(--accent); }

.like-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #BBB;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    padding: 5px 8px;
    border-radius: 8px;
}
.like-btn:hover {
    background-color: rgba(255, 85, 85, 0.05);
    color: #FF5555;
}
.like-btn.active {
    color: #FF5555;
}
.like-btn.active i {
    animation: heartBeat 0.3s ease-in-out;
}
@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

@media (max-width: 900px) {
    .share-body { flex-direction: column; overflow-y: auto; }
    .share-right-side { border-left: none; padding-left: 0; padding-top: 30px; border-top: 1px solid var(--gray-light); }
    .share-feed-container { overflow-y: visible; }
}

/* Stats Specific */
.stats-top-controls { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; flex-wrap: wrap; gap: 15px; }
.stats-tabs { display: flex; gap: 8px; }
.stats-tab { padding: 6px 14px; border-radius: 12px; border: 1px solid var(--gray-border); background: none; font-size: 0.8rem; color: var(--text-sub); cursor: pointer; transition: all 0.3s ease; }
.stats-tab.active { background-color: var(--accent); color: #FFF; border-color: var(--accent); }
.date-picker-group { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; color: var(--text-sub); }
.date-picker-group input { border: 1px solid var(--gray-border); padding: 4px 8px; border-radius: 8px; font-family: inherit; font-size: 0.8rem; }

.apply-btn {
    background-color: var(--accent);
    color: white;
    border: none;
    padding: 5px 14px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-left: 5px;
}
.apply-btn:hover {
    background-color: var(--accent-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(99, 102, 241, 0.2);
}
.apply-btn:active {
    transform: translateY(0);
}

.stats-scroll-area { overflow-y: auto; padding-right: 15px; }
.chart-container { width: 100%; height: 300px; margin-bottom: 40px; padding: 20px; background-color: #FAFAFA; border-radius: 20px; }
.stats-tables { display: grid; grid-template-columns: 1fr 1fr; gap: 35px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font-size: 0.75rem; color: #BBB; padding-bottom: 10px; border-bottom: 1px solid var(--gray-light); }
th:nth-child(2), th:nth-child(3) { text-align: right; }
td { padding: 12px 0; font-size: 0.95rem; border-bottom: 1px solid var(--gray-light); }
td:nth-child(2), td:nth-child(3) { text-align: right; }
td:last-child { font-weight: 600; }

.selected-row {
    background-color: rgba(99, 102, 241, 0.1) !important;
}
.selected-row td {
    color: var(--accent) !important;
    font-weight: 700 !important;
}

/* Spending Data Tab Layout */
.stats-data-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
    height: 100%;
}

.calendar-container {
    background-color: #FAFAFA;
    padding: 20px;
    border-radius: 20px;
}

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

.calendar-header h3 {
    font-size: 1.1rem;
    font-weight: 700;
}

.calendar-header button {
    background: none;
    border: none;
    font-size: 1.2rem;
    color: var(--text-sub);
    cursor: pointer;
    padding: 5px 10px;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 5px;
    text-align: center;
}

.calendar-day-header {
    font-size: 0.75rem;
    font-weight: 600;
    color: #BBB;
    padding-bottom: 10px;
}

.calendar-day {
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    font-size: 0.9rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
}

.calendar-day:hover {
    background-color: var(--gray-light);
}

.calendar-day.active {
    background-color: var(--accent);
    color: white;
    font-weight: 700;
}

.calendar-day.today {
    color: var(--accent);
    font-weight: 800;
    text-decoration: underline;
}

.calendar-day.has-data::after {
    content: '';
    position: absolute;
    bottom: 5px;
    width: 4px;
    height: 4px;
    background-color: var(--accent);
    border-radius: 50%;
}

.calendar-day.active.has-data::after {
    background-color: white;
}

.day-records-container {
    padding: 10px;
    overflow-y: auto;
}

#selected-date-label {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid var(--gray-light);
}

.day-records-list {
    list-style: none;
}

.day-record-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-light);
}

.day-record-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.day-record-cat {
    font-size: 0.7rem;
    color: var(--text-sub);
    background-color: var(--gray-light);
    padding: 2px 6px;
    border-radius: 4px;
    width: fit-content;
}

.day-record-content {
    font-size: 0.95rem;
    font-weight: 500;
}

.day-record-amount {
    font-weight: 700;
    color: var(--text-main);
}

.submit-btn { width: 100%; background-color: var(--accent); color: #FFF; border: none; padding: 14px; border-radius: 12px; font-weight: 600; cursor: pointer; transition: opacity 0.3s ease; }

.submit-btn:hover { opacity: 0.8; }

.fade-in { animation: fadeInContainer 1.2s ease-out forwards; }
.fade-in-item { opacity: 0; animation: fadeInItem 0.8s ease-out forwards; }
@keyframes fadeInContainer { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeInItem { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

@media (max-width: 1100px) {
    body { padding-top: 180px; }
    .summary-panel, .top-nav { position: absolute; top: 20px; }
    .summary-panel { left: 20px; width: calc(100% - 40px); flex-direction: row; flex-wrap: wrap; justify-content: center; }
    .top-nav { right: 20px; top: 120px; width: calc(100% - 40px); justify-content: center; }
}
/* Landing Page Specific Styles */
.landing-page {
    background: radial-gradient(circle at top left, #FDFDFD 0%, #E8E8E8 100%);
    padding: 0;
    display: block;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: 'Pretendard', sans-serif;
}

.landing-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 50px 80px;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
}

.landing-header .logo {
    display: flex;
    align-items: center;
    gap: 14px;
    font-weight: 800;
    font-size: 1.6rem;
    color: #1A1A1A;
    letter-spacing: -0.8px;
    animation: fadeInContainer 1s ease-out forwards;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4A69BD 0%, #1E3799 100%);
    color: white;
    border-radius: 12px; /* Rounded corner instead of circle for modern look */
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 8px;
    box-shadow: 0 8px 16px rgba(74, 105, 189, 0.25);
}

.landing-main {
    height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero-visual {
    position: relative;
    width: 450px;
    height: 220px;
    margin-bottom: 10px;
    animation: fadeUp 1.2s ease-out forwards;
}

.graph-svg {
    width: 100%;
    height: 100%;
    opacity: 0.45;
    filter: drop-shadow(0 10px 20px rgba(0,0,0,0.05));
}

.floating-coin {
    position: absolute;
    bottom: 40px;
    right: 90px;
    width: 85px;
    height: 85px;
    background: radial-gradient(circle at 35% 35%, #FFFFFF 0%, #EFEFEF 30%, #C0C0C0 100%);
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.8);
    box-shadow: 
        20px 25px 50px rgba(0,0,0,0.12), 
        inset -6px -6px 12px rgba(255,255,255,0.9), 
        inset 6px 6px 12px rgba(0,0,0,0.18);
    display: flex;
    justify-content: center;
    align-items: center;
    animation: floatingReal 5s ease-in-out infinite;
}

.coin-inner {
    font-size: 2.6rem;
    font-weight: 900;
    color: #999;
    text-shadow: 
        -1.5px -1.5px 1.5px rgba(255,255,255,0.8), 
        1.5px 1.5px 1.5px rgba(0,0,0,0.3);
    user-select: none;
}

@keyframes floatingReal {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-25px) rotate(5deg); }
}

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

.hero-title {
    font-size: 5.2rem;
    font-weight: 800;
    color: #1A1A1A;
    margin-bottom: 8px;
    letter-spacing: -3.5px;
    animation: fadeUp 1s ease-out 0.2s forwards;
    opacity: 0;
}

.hero-slogan {
    font-family: 'Caveat', cursive;
    font-size: 2.8rem;
    color: #777;
    font-weight: 400;
    margin-bottom: 70px;
    letter-spacing: 0;
    animation: fadeUp 1s ease-out 0.4s forwards;
    opacity: 0;
}

.action-box {
    animation: fadeUp 1s ease-out 0.6s forwards;
    opacity: 0;
}

.btn-start {
    padding: 22px 100px;
    font-size: 1.3rem;
    font-weight: 700;
    background-color: #1A1A1A;
    color: white;
    border: none;
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.23, 1, 0.32, 1);
    box-shadow: 0 15px 35px rgba(0,0,0,0.15);
}

.btn-start:hover {
    transform: translateY(-8px) scale(1.03);
    background-color: #333;
    box-shadow: 0 25px 50px rgba(0,0,0,0.22);
}

@media (max-width: 768px) {
    .landing-header { padding: 30px 40px; }
    .hero-title { font-size: 3.8rem; letter-spacing: -2px; }
    .hero-slogan { font-size: 1.6rem; }
    .hero-visual { width: 320px; }
    .btn-start { padding: 18px 70px; width: 80%; }
}