/* SkillPulse - Personal Skill Health Tracker */
/* Design System */

:root {
    /* Colors */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    --healthy: #10b981;
    --healthy-bg: #d1fae5;
    --warning: #f59e0b;
    --warning-bg: #fef3c7;
    --danger: #ef4444;
    --danger-bg: #fee2e2;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --bg-card: #1e293b;
    
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    
    --border: #334155;
    --border-light: #475569;
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    
    /* Typography */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.25rem;
    --text-2xl: 1.5rem;
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.4);
}

/* Reset & Base */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.5;
    min-height: 100vh;
}

/* App Container */
.app {
    max-width: 480px;
    margin: 0 auto;
    padding-bottom: 100px;
}

/* Header */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md);
    position: sticky;
    top: 0;
    background: var(--bg-primary);
    z-index: 100;
    border-bottom: 1px solid var(--border);
}

.logo {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    font-weight: 700;
    font-size: var(--text-xl);
}

.logo-icon {
    font-size: var(--text-2xl);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.btn-icon {
    background: none;
    border: none;
    font-size: var(--text-lg);
    cursor: pointer;
    position: relative;
    padding: var(--space-sm);
}

.notification-badge {
    position: absolute;
    top: 0;
    right: 0;
    background: var(--danger);
    color: white;
    font-size: 10px;
    padding: 2px 5px;
    border-radius: var(--radius-full);
    font-weight: 600;
}

.avatar {
    width: 36px;
    height: 36px;
    background: var(--primary);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: var(--text-sm);
}

/* Health Summary */
.health-summary {
    padding: var(--space-md);
}

.summary-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    display: flex;
    align-items: center;
    gap: var(--space-lg);
}

.summary-ring {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
}

.circular-chart {
    display: block;
    width: 100%;
    height: 100%;
}

.circle-bg {
    fill: none;
    stroke: rgba(255, 255, 255, 0.2);
    stroke-width: 3;
}

.circle {
    fill: none;
    stroke: white;
    stroke-width: 3;
    stroke-linecap: round;
    animation: progress 1s ease-out forwards;
    transform: rotate(-90deg);
    transform-origin: center;
}

@keyframes progress {
    0% { stroke-dasharray: 0, 100; }
}

.percentage {
    fill: white;
    font-size: 0.5em;
    font-weight: 700;
    text-anchor: middle;
}

.summary-info h2 {
    font-size: var(--text-lg);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.summary-info p {
    font-size: var(--text-sm);
    opacity: 0.9;
}

/* Quick Stats */
.quick-stats {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--space-sm);
    padding: 0 var(--space-md) var(--space-md);
}

.stat-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    text-align: center;
    border: 1px solid var(--border);
}

.stat-value {
    font-size: var(--text-2xl);
    font-weight: 700;
    margin-bottom: var(--space-xs);
}

.stat-value.healthy { color: var(--healthy); }
.stat-value.warning { color: var(--warning); }
.stat-value.danger { color: var(--danger); }
.stat-value.neutral { color: var(--text-secondary); }

.stat-label {
    font-size: var(--text-xs);
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Sections */
.section {
    padding: var(--space-md);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.section-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.badge {
    font-size: var(--text-xs);
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-full);
    font-weight: 500;
}

.badge.danger {
    background: var(--danger-bg);
    color: var(--danger);
}

.btn-link {
    background: none;
    border: none;
    color: var(--primary-light);
    font-size: var(--text-sm);
    cursor: pointer;
    font-weight: 500;
}

.btn-link:hover {
    text-decoration: underline;
}

/* Skill Cards */
.skill-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.skill-list.compact {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-sm);
}

.skill-card {
    background: var(--bg-card);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    border: 1px solid var(--border);
    transition: all 0.2s ease;
}

.skill-card:hover {
    border-color: var(--border-light);
    transform: translateY(-1px);
}

.skill-card.critical {
    border-left: 3px solid var(--danger);
}

.skill-card.warning {
    border-left: 3px solid var(--warning);
}

.skill-card.healthy {
    border-left: 3px solid var(--healthy);
}

.skill-card.mini {
    padding: var(--space-sm) var(--space-md);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.skill-info {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.skill-card.mini .skill-info {
    margin-bottom: 0;
    gap: var(--space-sm);
}

.skill-icon {
    font-size: var(--text-2xl);
}

.skill-card.mini .skill-icon {
    font-size: var(--text-lg);
}

.skill-details h4 {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: 2px;
}

.skill-card.mini .skill-details h4 {
    font-size: var(--text-sm);
}

.skill-meta {
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.skill-health {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    margin-bottom: var(--space-md);
}

.health-bar {
    flex: 1;
    height: 8px;
    background: var(--bg-tertiary);
    border-radius: var(--radius-full);
    overflow: hidden;
}

.health-fill {
    height: 100%;
    border-radius: var(--radius-full);
    transition: width 0.5s ease;
}

.health-fill.critical { background: var(--danger); }
.health-fill.warning { background: var(--warning); }
.health-fill.healthy { background: var(--healthy); }

.health-label {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--text-secondary);
    min-width: 40px;
    text-align: right;
}

.health-indicator {
    font-size: var(--text-sm);
    font-weight: 600;
    padding: var(--space-xs) var(--space-sm);
    border-radius: var(--radius-sm);
}

.health-indicator.healthy {
    background: var(--healthy-bg);
    color: var(--healthy);
}

.skill-actions {
    display: flex;
    gap: var(--space-sm);
}

.btn-action {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border-radius: var(--radius-sm);
    font-size: var(--text-sm);
    font-weight: 500;
    cursor: pointer;
    border: none;
    transition: all 0.2s ease;
}

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

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

.btn-action.secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.btn-action.secondary:hover {
    background: var(--border);
    color: var(--text-primary);
}

/* FAB */
.fab {
    position: fixed;
    bottom: var(--space-lg);
    right: var(--space-lg);
    width: 56px;
    height: 56px;
    border-radius: var(--radius-full);
    background: var(--primary);
    color: white;
    border: none;
    font-size: 28px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.fab:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Modals */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--bg-secondary);
    width: 100%;
    max-width: 480px;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.modal.active .modal-content {
    transform: translateY(0);
}

.modal-content.compact {
    max-height: 50vh;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-md) var(--space-lg);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--bg-secondary);
}

.modal-header h3 {
    font-size: var(--text-lg);
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: var(--text-2xl);
    color: var(--text-muted);
    cursor: pointer;
    padding: var(--space-xs);
}

.close-btn:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: var(--space-lg);
}

/* Practice Modal */
.practice-suggestion {
    background: var(--bg-tertiary);
    border-radius: var(--radius-md);
    padding: var(--space-md);
    margin-bottom: var(--space-md);
    cursor: pointer;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.practice-suggestion:hover {
    border-color: var(--primary);
}

.practice-suggestion h4 {
    font-size: var(--text-base);
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.practice-suggestion p {
    font-size: var(--text-sm);
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.practice-meta {
    display: flex;
    gap: var(--space-md);
    font-size: var(--text-xs);
    color: var(--text-muted);
}

.practice-meta span {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
}

/* Form Styles */
.form-group {
    margin-bottom: var(--space-lg);
}

.form-group label {
    display: block;
    font-size: var(--text-sm);
    font-weight: 500;
    margin-bottom: var(--space-sm);
    color: var(--text-secondary);
}

.form-group input[type="text"],
.form-group input[type="date"],
.form-group select {
    width: 100%;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    font-size: var(--text-base);
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.radio-group {
    display: flex;
    gap: var(--space-sm);
}

.radio-option {
    flex: 1;
    padding: var(--space-sm) var(--space-md);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    text-align: center;
    cursor: pointer;
    font-size: var(--text-sm);
    transition: all 0.2s ease;
}

.radio-option:has(input:checked) {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
}

.radio-option input {
    display: none;
}

.priority-select {
    display: flex;
    gap: var(--space-sm);
}

.priority-btn {
    flex: 1;
    padding: var(--space-sm);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    background: transparent;
    color: var(--text-secondary);
    font-size: var(--text-xs);
    cursor: pointer;
    transition: all 0.2s ease;
}

.priority-btn.active {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-light);
}

.btn-primary {
    background: var(--primary);
    color: white;
    border: none;
    padding: var(--space-md);
    border-radius: var(--radius-md);
    font-size: var(--text-base);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary.full-width {
    width: 100%;
}

/* Log Success */
.log-success {
    text-align: center;
    padding: var(--space-lg);
}

.success-icon {
    font-size: 48px;
    margin-bottom: var(--space-md);
}

.log-success h4 {
    font-size: var(--text-xl);
    font-weight: 600;
    margin-bottom: var(--space-sm);
}

.log-success p {
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
}

.health-boost {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-md);
    font-size: var(--text-2xl);
    font-weight: 700;
}

.health-boost .before {
    color: var(--warning);
}

.health-boost .arrow {
    color: var(--text-muted);
}

.health-boost .after {
    color: var(--healthy);
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--bg-tertiary);
    color: var(--text-primary);
    padding: var(--space-md) var(--space-lg);
    border-radius: var(--radius-full);
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.toast.active {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

.toast-icon {
    color: var(--healthy);
}

/* Animations */
@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.skill-card {
    animation: slideUp 0.3s ease forwards;
}

.skill-card:nth-child(2) { animation-delay: 0.1s; }
.skill-card:nth-child(3) { animation-delay: 0.2s; }
.skill-card:nth-child(4) { animation-delay: 0.3s; }

/* Media Queries */
@media (min-width: 768px) {
    .app {
        margin-top: var(--space-xl);
        border-radius: var(--radius-lg);
        border: 1px solid var(--border);
        overflow: hidden;
    }
    
    .modal-content {
        border-radius: var(--radius-lg);
        margin-bottom: var(--space-xl);
    }
}
