/* KidsRule - Minimalist Design System */

:root {
    --bg-app: #f9fafb;
    --bg-card: #ffffff;
    --border-color: #e5e7eb;
    
    --primary: #3b82f6;
    --primary-hover: #2563eb;
    --danger: #ef4444;
    --danger-hover: #dc2828;
    
    --text-main: #111827;
    --text-muted: #6b7280;
    
    --font-primary: 'Inter', 'Noto Sans SC', sans-serif;
    --transition-speed: 0.2s;
    --radius: 12px;
}

/* Global Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-primary);
}

body {
    background: var(--bg-app);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 16px;
}

/* App Container */
.app-container {
    width: 100%;
    max-width: 1000px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Base Card Style */
.base-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius);
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
    padding: 24px;
}

/* Header */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 16px;
}

.app-logo {
    width: 48px;
    height: 48px;
    object-fit: contain;
    opacity: 0.9;
}

.brand-text h1 {
    font-size: 1.4rem;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.brand-text p {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Buttons */
.btn {
    padding: 10px 18px;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-outline {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.btn-outline:hover {
    background: #f3f4f6;
}

.btn-danger {
    background: transparent;
    color: var(--danger);
    padding: 6px;
}

.btn-danger:hover {
    background: #fee2e2;
    border-radius: 6px;
}

.btn-block {
    display: block;
    width: 100%;
    text-align: center;
}

/* Dashboard Section */
.dashboard-section {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 1.5fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
}

.main-progress-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.main-progress-col h3 {
    font-size: 1rem;
    color: var(--text-muted);
    font-weight: 500;
    margin-bottom: 24px;
}

.progress-ring-container {
    position: relative;
    width: 160px;
    height: 160px;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.6s ease;
}

.progress-ring-text {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    display: flex;
    flex-direction: column;
    align-items: center;
}

.time-large {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-main);
    letter-spacing: -1px;
    line-height: 1;
}

.time-unit {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 4px;
}

.budget-info {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 24px;
}

.budget-info span {
    font-weight: 600;
    color: var(--text-main);
}

/* Stats Grid */
.stats-col {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
}

.stat-box {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.stat-value-wrap {
    display: flex;
    align-items: baseline;
    gap: 4px;
}

.stat-value {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-main);
}

.stat-unit {
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Workspace Grid */
.main-content {
    display: grid;
    grid-template-columns: 1fr 1.2fr;
    gap: 24px;
}

@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }
}

.panel-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 24px;
}

/* Form Styles */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-main);
    margin-bottom: 8px;
}

.input-suffix-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.min-input {
    width: 100%;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text-main);
    font-size: 1rem;
    outline: none;
    transition: all var(--transition-speed);
}

.input-suffix-wrapper .min-input {
    padding-right: 48px;
}

.input-suffix-wrapper .suffix {
    position: absolute;
    right: 14px;
    color: var(--text-muted);
    font-size: 0.9rem;
    pointer-events: none;
}

.min-input:focus {
    border-color: var(--primary);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.input-hint {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 6px;
}

.info-box {
    margin: 24px 0;
    padding: 12px;
    border-radius: 8px;
    background: #f3f4f6;
    color: var(--text-muted);
    font-size: 0.85rem;
    text-align: center;
}

/* Timeline & Card List */
.scrollable-panel {
    max-height: 500px;
    overflow-y: auto;
}

.timeline-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.empty-state {
    text-align: center;
    padding: 40px 0;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.log-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: #ffffff;
}

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

.log-title {
    font-size: 0.95rem;
    font-weight: 500;
}

.log-date {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.log-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.log-duration {
    font-size: 1.1rem;
    font-weight: 600;
}

.log-card-extra {
    background: #fafafa;
}

.log-card-extra .log-title {
    color: var(--text-muted);
}

/* Archives */
.archive-section {
    margin-top: 8px;
}

.archives-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.empty-archives {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.archive-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 16px;
    background: #f9fafb;
}

.archive-header {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color);
}

.archive-details {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.archive-details strong {
    color: var(--text-main);
    font-weight: 500;
}
