/* Mobile-First CSS for 돈토리 관리 */

:root {
    --primary: #2563eb;
    --navbar-height: 50px;
    --bottomnav-height: 56px;
    --safe-area-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Noto Sans KR", sans-serif;
    padding-top: var(--navbar-height);
    padding-bottom: calc(var(--bottomnav-height) + var(--safe-area-bottom));
    background: #f8f9fa;
    -webkit-font-smoothing: antialiased;
}

/* Top Navbar */
.navbar {
    height: var(--navbar-height);
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    z-index: 1030;
}

/* Main Content */
.main-content {
    padding: 16px 0;
    min-height: calc(100vh - var(--navbar-height) - var(--bottomnav-height));
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(var(--bottomnav-height) + var(--safe-area-bottom));
    padding-bottom: var(--safe-area-bottom);
    background: #fff;
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -1px 3px rgba(0,0,0,0.1);
    z-index: 1030;
}

.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: #6c757d;
    font-size: 0.65rem;
    padding: 4px 12px;
    min-width: 56px;
    transition: color 0.15s;
}

.bottom-nav-item i {
    font-size: 1.25rem;
    margin-bottom: 1px;
}

.bottom-nav-item.active {
    color: var(--primary);
    font-weight: 600;
}

.bottom-nav-item:hover {
    color: var(--primary);
}

/* Login */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 380px;
    padding: 32px 24px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}

/* Stat Cards */
.stat-card {
    text-align: center;
    padding: 12px 8px;
    border-radius: 12px;
}

.stat-number {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.7rem;
    color: #6c757d;
    margin-top: 2px;
}

/* Cards */
.card {
    border-radius: 12px;
    overflow: hidden;
}

/* Lists */
.list-group-item {
    border-left: none;
    border-right: none;
    padding: 10px 12px;
}

.list-group-item:first-child {
    border-top: none;
}

/* Buttons */
.btn {
    border-radius: 8px;
}

.btn-lg {
    padding: 12px 24px;
    font-size: 1rem;
    border-radius: 12px;
    min-height: 48px;
}

/* Form controls */
.form-control,
.form-select {
    border-radius: 8px;
    min-height: 44px;
}

.form-control-lg {
    min-height: 48px;
}

/* Badge */
.badge {
    font-weight: 500;
    border-radius: 6px;
}

/* Touch-friendly spacing */
.list-group-item-action {
    min-height: 44px;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 4px;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 2px;
}

/* Loading spinner */
.spinner-border-sm {
    width: 1rem;
    height: 1rem;
}

/* Responsive adjustments */
@media (min-width: 768px) {
    .main-content {
        max-width: 720px;
        margin: 0 auto;
    }

    .bottom-nav-item {
        font-size: 0.75rem;
        padding: 4px 20px;
    }
}

@media (min-width: 1024px) {
    .main-content {
        max-width: 900px;
    }
}

/* Alert styling */
.alert {
    border-radius: 10px;
    border: none;
}

/* PWA standalone mode */
@media (display-mode: standalone) {
    body {
        padding-top: calc(var(--navbar-height) + env(safe-area-inset-top, 0px));
    }

    .navbar {
        padding-top: env(safe-area-inset-top, 0px);
        height: calc(var(--navbar-height) + env(safe-area-inset-top, 0px));
    }
}
