/* ============================================
   Honda HF2417 HME Restoration Guide Styles
   ============================================ */

/* ============================================
   CSS VARIABLES & RESET
   ============================================ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #cc0000;
    --secondary-color: #333;
    --bg-light: #f5f5f5;
    --bg-white: #ffffff;
    --text-dark: #222;
    --text-light: #666;
    --success: #28a745;
    --warning: #ffc107;
    --danger: #dc3545;
    --info: #17a2b8;
    --easy: #28a745;
    --moderate: #ffc107;
    --advanced: #dc3545;
}

/* ============================================
   DARK MODE VARIABLES
   ============================================ */
body.dark-mode {
    --bg-light: #1a1a1a;
    --bg-white: #2d2d2d;
    --text-dark: #e0e0e0;
    --text-light: #aaa;
    --secondary-color: #e0e0e0;
}

/* ============================================
   BASE STYLES
   ============================================ */
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background: var(--bg-light);
}

/* ============================================
   HEADER
   ============================================ */
header {
    background: var(--primary-color);
    color: white;
    padding: 2rem 1rem;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

header p {
    font-size: 1.1rem;
    opacity: 0.95;
}

/* ============================================
   CONTROLS BAR
   ============================================ */
.controls {
    background: var(--bg-white);
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.search-box {
    flex: 1;
    min-width: 250px;
}

.search-box input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
}

.control-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   BUTTONS
   ============================================ */
button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.3s;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: #990000;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #555;
    transform: translateY(-2px);
}

/* ============================================
   NAVIGATION
   ============================================ */
nav {
    background: var(--bg-white);
    padding: 1rem;
    margin: 1rem auto;
    max-width: 1400px;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

nav h3 {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 0.75rem;
}

.nav-item {
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
    border-left: 4px solid var(--primary-color);
}

.nav-item:hover {
    background: #e0e0e0;
    transform: translateX(5px);
}

body.dark-mode .nav-item:hover {
    background: #3a3a3a;
}

/* ============================================
   MAIN CONTENT
   ============================================ */
main {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
}

/* ============================================
   SECTIONS
   ============================================ */
.section {
    background: var(--bg-white);
    margin-bottom: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    overflow: hidden;
}

.section-header {
    background: var(--secondary-color);
    color: white;
    padding: 1.5rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s;
}

.section-header:hover {
    background: #444;
}

.section-header h2 {
    font-size: 1.8rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.section-content {
    padding: 2rem;
    display: none;
}

.section-content.active {
    display: block;
}

/* ============================================
   DIFFICULTY BADGES
   ============================================ */
.difficulty-badge {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.difficulty-easy { 
    background: var(--easy); 
    color: white; 
}

.difficulty-moderate { 
    background: var(--moderate); 
    color: var(--text-dark); 
}

.difficulty-advanced { 
    background: var(--advanced); 
    color: white; 
}

/* ============================================
   SUBSECTIONS
   ============================================ */
.subsection {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--bg-light);
}

.subsection:last-child {
    border-bottom: none;
}

.subsection h3 {
    color: var(--primary-color);
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

.subsection h4 {
    color: var(--secondary-color);
    margin: 1.5rem 0 0.75rem 0;
    font-size: 1.2rem;
}

.subsection p {
    margin-bottom: 1rem;
}

/* ============================================
   INFO BOXES
   ============================================ */
.info-box {
    padding: 1.25rem;
    border-radius: 5px;
    margin: 1.5rem 0;
    border-left: 5px solid;
}

.info-box.safety {
    background: #fee;
    border-color: var(--danger);
}

.info-box.warning {
    background: #fff8e1;
    border-color: var(--warning);
}

.info-box.tip {
    background: #e3f2fd;
    border-color: var(--info);
}

.info-box.success {
    background: #e8f5e9;
    border-color: var(--success);
}

.info-box-title {
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* ============================================
   LISTS & CONTENT BLOCKS
   ============================================ */
.tool-list, .parts-list, .steps-list {
    background: var(--bg-light);
    padding: 1.5rem;
    border-radius: 5px;
    margin: 1rem 0;
}

.tool-list h4, .parts-list h4, .steps-list h4 {
    margin-top: 0;
    color: var(--secondary-color);
    margin-bottom: 1rem;
}

ul, ol {
    margin-left: 2rem;
    margin-top: 0.75rem;
}

li {
    margin-bottom: 0.5rem;
}

/* ============================================
   TABLES
   ============================================ */
.spec-table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    background: var(--bg-white);
}

.spec-table th, .spec-table td {
    padding: 0.75rem;
    text-align: left;
    border: 1px solid #ddd;
}

.spec-table th {
    background: var(--secondary-color);
    color: white;
    font-weight: 600;
}

.spec-table tr:nth-child(even) {
    background: var(--bg-light);
}

/* ============================================
   TIME ESTIMATES
   ============================================ */
.time-estimate {
    display: inline-block;
    background: var(--info);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    margin: 1rem 0;
}

/* ============================================
   CHECKPOINTS
   ============================================ */
.checkpoint {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: var(--bg-light);
    border-radius: 5px;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: all 0.3s;
}

.checkpoint:hover {
    background: #e0e0e0;
}

body.dark-mode .checkpoint:hover {
    background: #3a3a3a;
}

.checkpoint input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
}

.checkpoint label {
    cursor: pointer;
    flex: 1;
}

/* ============================================
   TOGGLE ICONS
   ============================================ */
.toggle-icon {
    transition: transform 0.3s;
    font-size: 1.5rem;
}

.toggle-icon.rotated {
    transform: rotate(180deg);
}

/* ============================================
   DIAGRAM PLACEHOLDERS
   ============================================ */
.diagram-placeholder {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 3rem;
    text-align: center;
    border-radius: 8px;
    margin: 1.5rem 0;
    font-weight: 600;
}

/* ============================================
   FOOTER
   ============================================ */
footer {
    background: var(--secondary-color);
    color: white;
    text-align: center;
    padding: 2rem;
    margin-top: 3rem;
}

footer p {
    margin: 0.5rem 0;
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    .controls, 
    nav, 
    .checkpoint input, 
    button { 
        display: none; 
    }
    
    .section-content { 
        display: block !important; 
    }
    
    .section { 
        page-break-inside: avoid; 
    }
    
    .section-header {
        background: #333 !important;
        color: white !important;
    }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */
@media (max-width: 768px) {
    header h1 { 
        font-size: 1.8rem; 
    }
    
    .section-header h2 { 
        font-size: 1.4rem; 
    }
    
    .nav-grid { 
        grid-template-columns: 1fr; 
    }
    
    .controls {
        flex-direction: column;
    }
    
    .search-box {
        width: 100%;
    }
    
    .control-buttons {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    header h1 {
        font-size: 1.5rem;
    }
    
    .section-header h2 {
        font-size: 1.2rem;
    }
    
    button {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
    
    .subsection {
        padding: 1rem;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */
button:focus,
input:focus {
    outline: 3px solid var(--info);
    outline-offset: 2px;
}

.nav-item:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Ensure sufficient color contrast in dark mode */
body.dark-mode .info-box.warning {
    background: #3a3000;
    color: #fff8e1;
}

body.dark-mode .info-box.tip {
    background: #003a4a;
    color: #e3f2fd;
}

body.dark-mode .info-box.success {
    background: #003a00;
    color: #e8f5e9;
}

body.dark-mode .info-box.safety {
    background: #4a0000;
    color: #fee;
}

/* ============================================
   UTILITY CLASSES
   ============================================ */
.note {
    font-style: italic;
    color: var(--text-light);
    padding: 1rem;
    background: var(--bg-light);
    border-radius: 5px;
    margin: 1rem 0;
}

.hidden {
    display: none;
}

.text-center {
    text-align: center;
}

.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }