/* styles.css - Depreciation Schedule Generator - January 15, 2026 */
:root {
    --navy-primary: #1a365d;
    --navy-dark: #0f2341;
    --navy-light: #2c5282;
    --accent-gold: #d69e2e;
    --accent-teal: #319795;
    --bg-light: #f7fafc;
    --bg-card: #ffffff;
    --text-primary: #2d3748;
    --text-secondary: #718096;
    --border-color: #e2e8f0;
    --success: #38a169;
    --error: #e53e3e;
}

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

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(135deg, var(--bg-light) 0%, #edf2f7 100%);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

.app-container { max-width: 1400px; margin: 0 auto; padding: 20px; }

.header {
    text-align: center;
    margin-bottom: 30px;
    padding: 30px;
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-dark) 100%);
    border-radius: 16px;
    color: white;
    box-shadow: 0 10px 40px rgba(26, 54, 93, 0.3);
}

.header h1 { font-size: clamp(1.5rem, 4vw, 2.5rem); font-weight: 700; margin-bottom: 10px; }
.header p { font-size: 1rem; opacity: 0.9; max-width: 700px; margin: 0 auto; }

.main-grid { display: grid; grid-template-columns: 380px 1fr; gap: 24px; }
@media (max-width: 1024px) { .main-grid { grid-template-columns: 1fr; } }

.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid var(--border-color);
}

.card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--navy-primary);
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-title svg { width: 24px; height: 24px; color: var(--accent-teal); }

.form-group { margin-bottom: 18px; }
.form-group label { display: block; font-size: 0.875rem; font-weight: 500; color: var(--text-primary); margin-bottom: 6px; }

.form-group input, .form-group select {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.95rem;
    transition: all 0.2s ease;
    background: white;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: var(--navy-light);
    box-shadow: 0 0 0 3px rgba(44, 82, 130, 0.15);
}

.form-group input:disabled { background: #f0f0f0; cursor: not-allowed; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.checkbox-group {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 12px;
}

.checkbox-group input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.checkbox-group label { font-size: 0.9rem; cursor: pointer; margin-bottom: 0; }

.conditional-field {
    margin-top: 12px;
    padding: 12px;
    background: #fefcf3;
    border: 1px solid var(--accent-gold);
    border-radius: 8px;
    display: none;
}

.conditional-field.active { display: block; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    color: white;
    width: 100%;
}

.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(26, 54, 93, 0.3); }

.btn-secondary { background: var(--bg-light); color: var(--navy-primary); border: 2px solid var(--border-color); }
.btn-secondary:hover { background: var(--border-color); }
.btn-success { background: var(--success); color: white; }
.btn-success:hover { background: #2f855a; }
.btn-warning { background: var(--accent-gold); color: white; }
.btn-warning:hover { background: #b7791f; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

.button-group { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 20px; }
.button-group .btn { flex: 1; min-width: 120px; }

.tabs { display: flex; border-bottom: 2px solid var(--border-color); margin-bottom: 20px; overflow-x: auto; }

.tab {
    padding: 12px 20px;
    background: none;
    border: none;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
}

.tab:hover { color: var(--navy-primary); }
.tab.active { color: var(--navy-primary); border-bottom-color: var(--navy-primary); }

.tab-content { display: none; }
.tab-content.active { display: block; }

.summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 16px; }

.summary-card {
    background: linear-gradient(135deg, var(--navy-primary) 0%, var(--navy-light) 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    text-align: center;
}

.summary-card.alt { background: linear-gradient(135deg, var(--accent-teal) 0%, #2c7a7b 100%); }
.summary-card.gold { background: linear-gradient(135deg, var(--accent-gold) 0%, #b7791f 100%); }
.summary-card .label { font-size: 0.75rem; opacity: 0.9; text-transform: uppercase; letter-spacing: 0.5px; }
.summary-card .value { font-size: 1.25rem; font-weight: 700; margin-top: 6px; }

.table-container { overflow-x: auto; border-radius: 8px; border: 1px solid var(--border-color); }

.depreciation-table { width: 100%; border-collapse: collapse; font-size: 0.9rem; }

.depreciation-table th {
    background: var(--navy-primary);
    color: white;
    padding: 14px 12px;
    text-align: right;
    font-weight: 600;
    white-space: nowrap;
}

.depreciation-table th:first-child { text-align: left; }
.depreciation-table td { padding: 12px; border-bottom: 1px solid var(--border-color); text-align: right; }
.depreciation-table td:first-child { text-align: left; font-weight: 500; }
.depreciation-table tbody tr:hover { background: var(--bg-light); }
.depreciation-table tbody tr:last-child td { border-bottom: none; }
.depreciation-table tfoot td { background: var(--bg-light); font-weight: 600; border-top: 2px solid var(--navy-primary); }

.charts-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(350px, 1fr)); gap: 20px; }
@media (max-width: 600px) { .charts-grid { grid-template-columns: 1fr; } }

.chart-card { background: white; border-radius: 12px; padding: 20px; border: 1px solid var(--border-color); }
.chart-card h4 { font-size: 1rem; color: var(--navy-primary); margin-bottom: 16px; text-align: center; }
.chart-wrapper { position: relative; height: 280px; }

.saved-assets-list { max-height: 300px; overflow-y: auto; }

.asset-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: var(--bg-light);
    border-radius: 8px;
    margin-bottom: 10px;
}

.asset-item:last-child { margin-bottom: 0; }
.asset-info { flex: 1; }
.asset-name { font-weight: 600; color: var(--navy-primary); font-size: 0.9rem; }
.asset-details { font-size: 0.75rem; color: var(--text-secondary); }
.asset-actions { display: flex; gap: 6px; }

.empty-state { text-align: center; padding: 30px; color: var(--text-secondary); }
.empty-state svg, .empty-state img { 
    width: 60px !important; 
    height: 60px !important; 
    max-width: 60px !important; 
    max-height: 60px !important; 
    margin: 0 auto 16px auto; 
    display: block; 
    opacity: 0.5; 
}

.method-info {
    font-size: 0.85rem;
    color: var(--text-secondary);
    background: var(--bg-light);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 18px;
    border-left: 4px solid var(--accent-teal);
}

.tooltip { position: relative; display: inline-block; cursor: help; }

.tooltip::after {
    content: attr(data-tip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: var(--navy-dark);
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 100;
}

.tooltip:hover::after { opacity: 1; visibility: visible; }

.footer {
    text-align: center;
    margin-top: 40px;
    padding: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.footer img { width: 32px; height: 32px; }
.footer a { color: var(--navy-primary); text-decoration: none; font-weight: 500; }
.footer a:hover { text-decoration: underline; }

.info-section { background: var(--bg-light); border-radius: 12px; padding: 24px; margin-top: 30px; }
.info-section h2 { color: var(--navy-primary); font-size: 1.25rem; margin-bottom: 16px; }
.info-section p { color: var(--text-secondary); margin-bottom: 12px; }

.features-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 20px; }
.feature-item { display: flex; align-items: flex-start; gap: 12px; }
.feature-icon { width: 36px; height: 36px; background: var(--navy-primary); border-radius: 8px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.feature-icon svg { width: 20px; height: 20px; color: white; }
.feature-text h4 { font-size: 0.95rem; color: var(--navy-primary); margin-bottom: 4px; }
.feature-text p { font-size: 0.85rem; margin-bottom: 0; }

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 16px 24px;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 1000;
    transform: translateX(120%);
    transition: transform 0.3s ease;
}

.notification.show { transform: translateX(0); }
.notification.success { background: var(--success); }
.notification.error { background: var(--error); }

.hidden { display: none !important; }

@media (max-width: 600px) {
    .app-container { padding: 12px; }
    .header { padding: 20px; }
    .card { padding: 16px; }
    .form-row { grid-template-columns: 1fr; }
    .summary-grid { grid-template-columns: 1fr 1fr; }
    .button-group { flex-direction: column; }
    .button-group .btn { width: 100%; }
}

@media print {
    .sidebar, .header, .footer, .button-group, .tabs { display: none !important; }
    .main-grid { grid-template-columns: 1fr; }
    .card { box-shadow: none; border: 1px solid #ccc; }
}
