/**
 * Smart Gym Tracker - Styles
 * Minimalist Black & White Design
 */

/* ========================
   BASE & RESET
   ======================== */
* {
    -webkit-tap-highlight-color: transparent;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #1a1a1a;
    margin: 0;
    padding: 0;
}

.font-display {
    font-family: 'Space Grotesk', sans-serif;
}

/* ========================
   PAGE TRANSITIONS
   ======================== */
.page {
    display: none;
    opacity: 0;
    transform: translateY(10px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.page.active {
    display: flex;
    flex-direction: column;
}

.page.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ========================
   CARDS
   ======================== */
.card {
    background: white;
    border-radius: 20px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.card:hover {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* ========================
   INPUTS
   ======================== */
.input-line {
    width: 100%;
    padding: 14px 0;
    border: none;
    border-bottom: 1.5px solid #e0e0e0;
    background: transparent;
    font-size: 15px;
    color: #1a1a1a;
    transition: border-color 0.2s;
    outline: none;
}

.input-line:focus {
    border-bottom-color: #1a1a1a;
}

.input-line::placeholder {
    color: #aaa;
}

.input-box {
    width: 100%;
    padding: 14px 16px;
    border: 1.5px solid #e5e5e5;
    border-radius: 14px;
    background: white;
    font-size: 15px;
    color: #1a1a1a;
    transition: all 0.2s;
    outline: none;
}

.input-box:focus {
    border-color: #1a1a1a;
}

textarea.input-box {
    resize: none;
}

/* ========================
   BUTTONS
   ======================== */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: #1a1a1a;
    color: white;
    font-weight: 600;
    font-size: 14px;
    border-radius: 50px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary:hover {
    background: #333;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 32px;
    background: white;
    color: #1a1a1a;
    font-weight: 600;
    font-size: 14px;
    border-radius: 50px;
    border: 2px solid #1a1a1a;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-outline:hover {
    background: #1a1a1a;
    color: white;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 10px 16px;
    background: transparent;
    color: #666;
    font-weight: 500;
    font-size: 14px;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-ghost:hover {
    background: #f0f0f0;
    color: #1a1a1a;
}

.btn-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    border: 1.5px solid #e5e5e5;
    border-radius: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    border-color: #1a1a1a;
}

/* ========================
   SELECT CARDS
   ======================== */
.select-card {
    background: white;
    border: 2px solid #e5e5e5;
    border-radius: 16px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s;
    text-align: center;
}

.select-card:hover {
    border-color: #ccc;
}

.select-card.selected {
    border-color: #1a1a1a;
    background: #fafafa;
}

.select-card.selected .card-icon {
    background: #1a1a1a;
    color: white;
}

.card-icon {
    width: 52px;
    height: 52px;
    margin: 0 auto 10px;
    background: #f5f5f5;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

/* ========================
   CHECKBOX CIRCLE
   ======================== */
.check-circle {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 2px solid #ddd;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.check-circle.checked {
    background: #22c55e;
    border-color: #22c55e;
}

.check-circle.checked svg {
    color: white;
}

/* ========================
   PROGRESS BAR
   ======================== */
.progress-bar {
    height: 6px;
    background: #e5e5e5;
    border-radius: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #1a1a1a;
    border-radius: 10px;
    transition: width 0.4s ease;
}

/* ========================
   DAY BADGE
   ======================== */
.day-badge {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    background: #f5f5f5;
    color: #aaa;
}

.day-badge.done {
    background: #22c55e;
    color: white;
}

.day-badge.active {
    background: #1a1a1a;
    color: white;
}

/* ========================
   EXERCISE ROW
   ======================== */
.ex-row {
    display: flex;
    align-items: center;
    padding: 18px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ex-row:last-child {
    border-bottom: none;
}

.ex-row.done .ex-name {
    color: #bbb;
    text-decoration: line-through;
}

/* ========================
   BADGES
   ======================== */
.badge {
    display: inline-flex;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-outline {
    border: 1.5px solid #e0e0e0;
    color: #888;
}

.badge-dark {
    background: #1a1a1a;
    color: white;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

/* ========================
   STAT CARDS
   ======================== */
.stat-card {
    background: white;
    border-radius: 16px;
    padding: 20px;
    text-align: center;
}

.stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 32px;
    font-weight: 700;
}

.stat-label {
    font-size: 11px;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 4px;
}

/* ========================
   MODALS
   ======================== */
.modal-bg {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 50;
}

.modal-box {
    background: white;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 90vh;
    overflow: hidden;
    z-index: 51;
    position: relative;
}

/* ========================
   TOAST
   ======================== */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 14px 28px;
    border-radius: 50px;
    font-weight: 500;
    z-index: 100;
    transition: all 0.3s;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    background: #1a1a1a;
    color: white;
}

.toast-error {
    background: #ef4444;
}

/* ========================
   SPINNER
   ======================== */
.spinner {
    width: 24px;
    height: 24px;
    border: 2.5px solid #e5e5e5;
    border-top-color: #1a1a1a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ========================
   ANIMATIONS
   ======================== */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* ========================
   MENU ICON
   ======================== */
.menu-icon {
    width: 24px;
    height: 18px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    cursor: pointer;
}

.menu-icon span {
    height: 2px;
    background: #1a1a1a;
    border-radius: 2px;
}

.menu-icon span:nth-child(2) {
    width: 70%;
    margin-left: auto;
}

/* ========================
   SCROLLBAR
   ======================== */
::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 10px;
}

/* ========================
   LABELS
   ======================== */
.label {
    display: block;
    font-size: 10px;
    font-weight: 700;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
}

/* ========================
   RESPONSIVE
   ======================== */
@media (max-width: 768px) {
    .hide-mobile {
        display: none !important;
    }
}

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ========================
   UTILITIES
   ======================== */
.text-center { text-align: center; }
.text-sm { font-size: 14px; }
.text-xs { font-size: 12px; }
.text-gray { color: #888; }
.text-red { color: #ef4444; }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.mb-2 { margin-bottom: 8px; }
.mb-4 { margin-bottom: 16px; }
.mb-6 { margin-bottom: 24px; }
.mt-4 { margin-top: 16px; }
.mt-6 { margin-top: 24px; }
.p-4 { padding: 16px; }
.p-6 { padding: 24px; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.w-full { width: 100%; }
.flex { display: flex; }
.flex-1 { flex: 1; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.hidden { display: none !important; }
.grid { display: grid; }
.grid-cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid-cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid-cols-4 { grid-template-columns: repeat(4, 1fr); }
.space-y-2 > * + * { margin-top: 8px; }
.space-y-3 > * + * { margin-top: 12px; }
.space-y-4 > * + * { margin-top: 16px; }
.space-y-5 > * + * { margin-top: 20px; }
.space-y-6 > * + * { margin-top: 24px; }
.overflow-hidden { overflow: hidden; }
.overflow-y-auto { overflow-y: auto; }
.min-h-screen { min-height: 100vh; }
.max-w-sm { max-width: 24rem; }
.max-w-lg { max-width: 32rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-5xl { max-width: 64rem; }
.mx-auto { margin-left: auto; margin-right: auto; }
.rounded-xl { border-radius: 12px; }
.border { border: 1px solid #e5e5e5; }
.border-t { border-top: 1px solid #e5e5e5; }
.border-b { border-bottom: 1px solid #e5e5e5; }
.bg-white { background: white; }
.bg-gray { background: #f5f5f5; }
