/* ================================================
   GLOBAL STYLES AND RESET
   ================================================ */

/* Reset default margins and paddings */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Body styling with background gradient */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    background: linear-gradient(135deg, #f5f7fa 0%, #e8edf2 100%);
    color: #333;
    padding: 0;
    margin: 0;
}

/* ================================================
   HEADER SECTION
   ================================================ */

/* Header container with primary brand color */
header {
    background: linear-gradient(135deg, rgb(212, 61, 15) 0%, rgb(180, 50, 10) 100%);
    color: white;
    padding: 20px 0;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    border-bottom: 4px solid rgb(150, 40, 8);
}

/* Header content container */
.header-container {
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
    padding: 0 20px;
}

/* Logo styling - positioned at top center */
.logo {
    width: 120px;
    height: 120px;
    margin-bottom: 15px;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background: white;
    padding: 5px;
}

/* Main heading */
header h1 {
    font-size: 2.5em;
    margin: 10px 0;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    font-weight: bold;
}

/* Subtitle styling */
.subtitle {
    font-size: 1.1em;
    margin-top: 10px;
    opacity: 0.95;
    font-weight: 300;
}

/* ================================================
   MAIN CONTAINER
   ================================================ */

/* Main content wrapper */
.container {
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
}

/* ================================================
   SECTION STYLES
   ================================================ */

/* Introduction section */
.intro-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-left: 5px solid rgb(212, 61, 15);
}

.intro-section h2 {
    color: rgb(212, 61, 15);
    font-size: 2em;
    margin-bottom: 20px;
    border-bottom: 3px solid rgb(212, 61, 15);
    padding-bottom: 10px;
}

/* Theory box styling */
.theory-box {
    background: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #e0e0e0;
    margin-top: 20px;
}

.theory-box h3 {
    color: rgb(180, 50, 10);
    margin-bottom: 15px;
    font-size: 1.4em;
}

.theory-box p {
    margin-bottom: 15px;
    text-align: justify;
}

.theory-box ul {
    margin-left: 30px;
    margin-bottom: 15px;
}

.theory-box li {
    margin-bottom: 10px;
}

/* Error types grid */
.error-types {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.error-type {
    background: white;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid rgb(212, 61, 15);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.error-type strong {
    color: rgb(212, 61, 15);
    display: block;
    margin-bottom: 8px;
}

/* ================================================
   EXAMPLE SECTIONS
   ================================================ */

/* Individual example section */
.example-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border: 2px solid #e0e0e0;
    transition: transform 0.3s ease;
}

.example-section:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(212, 61, 15, 0.2);
}

/* Example header with number badge */
.example-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
    gap: 15px;
}

.example-number {
    background: rgb(212, 61, 15);
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    font-weight: bold;
    font-size: 1.1em;
    box-shadow: 0 2px 5px rgba(212, 61, 15, 0.3);
}

.example-header h3 {
    color: rgb(180, 50, 10);
    font-size: 1.5em;
    flex: 1;
}

/* Problem box */
.problem-box {
    background: #fff8f5;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid rgb(212, 61, 15);
    margin-bottom: 20px;
}

.problem-box h4 {
    color: rgb(212, 61, 15);
    margin-bottom: 10px;
    font-size: 1.2em;
}

.problem-box p {
    color: #333;
    line-height: 1.8;
}

/* ================================================
   SOLUTION TOGGLE BUTTON
   ================================================ */

/* Solution button styling */
.solution-btn {
    background: linear-gradient(135deg, rgb(212, 61, 15) 0%, rgb(180, 50, 10) 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    font-size: 1em;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: block;
    margin: 20px auto;
    min-width: 180px;
}

.solution-btn:hover {
    background: linear-gradient(135deg, rgb(180, 50, 10) 0%, rgb(150, 40, 8) 100%);
    box-shadow: 0 6px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.solution-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* ================================================
   SOLUTION BOX
   ================================================ */

/* Solution container */
.solution-box {
    background: #f0fdf4;
    padding: 25px;
    border-radius: 8px;
    border: 2px solid #86efac;
    margin-top: 20px;
    animation: slideDown 0.5s ease;
}

/* Slide down animation for solution */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.solution-box h4 {
    color: #16a34a;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Explanation box within solution */
.explanation {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #16a34a;
}

.explanation p {
    margin-bottom: 10px;
    color: #333;
}

.explanation strong {
    color: #16a34a;
}

/* ================================================
   TABLE STYLES
   ================================================ */

/* Journal table styling */
.journal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

/* Table caption */
.journal-table caption {
    background: rgb(212, 61, 15);
    color: white;
    padding: 12px;
    font-size: 1.2em;
    font-weight: bold;
    text-align: center;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

/* Table header styling */
.journal-table thead {
    background: linear-gradient(135deg, rgb(180, 50, 10) 0%, rgb(150, 40, 8) 100%);
    color: white;
}

.journal-table th {
    padding: 15px;
    text-align: center;
    font-weight: bold;
    border: 2px solid rgb(212, 61, 15);
}

/* Table body cells */
.journal-table td {
    padding: 12px 15px;
    text-align: left;
    border: 2px solid #e0e0e0;
}

/* Numeric columns alignment */
.journal-table td:nth-child(3),
.journal-table td:nth-child(4) {
    text-align: right;
    font-weight: bold;
    color: rgb(212, 61, 15);
}

/* Alternating row colors */
.journal-table tbody tr:nth-child(odd) {
    background-color: #fef2f2;
}

.journal-table tbody tr:nth-child(even) {
    background-color: white;
}

/* Hover effect on table rows */
.journal-table tbody tr:hover {
    background-color: #fee2e2;
    transition: background-color 0.3s ease;
}

/* Description row styling */
.description-row {
    background-color: #f9fafb !important;
    font-style: italic;
}

.description-row td {
    border-top: 3px solid rgb(212, 61, 15);
    color: #666;
}

/* Total row styling */
.total-row {
    background: linear-gradient(135deg, #fff8f5 0%, #ffe4d9 100%) !important;
    font-weight: bold;
}

.total-row td {
    border-top: 3px solid rgb(212, 61, 15);
    border-bottom: 3px solid rgb(212, 61, 15);
    color: rgb(212, 61, 15);
    font-size: 1.1em;
}

/* ================================================
   SUSPENSE ACCOUNT TABLE
   ================================================ */

/* Suspense table specific styling */
.suspense-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: white;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    overflow: hidden;
}

.suspense-table caption {
    background: rgb(212, 61, 15);
    color: white;
    padding: 12px;
    font-size: 1.2em;
    font-weight: bold;
}

.suspense-table thead th {
    background: linear-gradient(135deg, rgb(180, 50, 10) 0%, rgb(150, 40, 8) 100%);
    color: white;
    padding: 12px;
    border: 2px solid rgb(212, 61, 15);
}

.suspense-table td {
    padding: 12px;
    border: 2px solid #e0e0e0;
}

.suspense-table tbody tr:hover {
    background-color: #fee2e2;
}

/* ================================================
   SUSPENSE SECTION
   ================================================ */

.suspense-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-left: 5px solid rgb(212, 61, 15);
}

.suspense-section h2 {
    color: rgb(212, 61, 15);
    font-size: 2em;
    margin-bottom: 20px;
    border-bottom: 3px solid rgb(212, 61, 15);
    padding-bottom: 10px;
}

/* Note box */
.note-box {
    background: #fff8f5;
    border-left: 5px solid rgb(212, 61, 15);
    padding: 15px;
    margin-top: 20px;
    border-radius: 5px;
}

.note-box strong {
    color: rgb(212, 61, 15);
}

/* ================================================
   SUMMARY SECTION
   ================================================ */

.summary-section {
    background: white;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
    border-left: 5px solid rgb(212, 61, 15);
}

.summary-section h2 {
    color: rgb(212, 61, 15);
    font-size: 2em;
    margin-bottom: 25px;
    border-bottom: 3px solid rgb(212, 61, 15);
    padding-bottom: 10px;
}

/* Key points grid layout */
.key-points-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 20px;
}

.key-point {
    background: linear-gradient(135deg, #fff8f5 0%, #ffe4d9 100%);
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid rgb(212, 61, 15);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.key-point:hover {
    transform: translateX(5px);
    box-shadow: 0 4px 10px rgba(212, 61, 15, 0.2);
}

.key-point strong {
    color: rgb(212, 61, 15);
    display: block;
    margin-bottom: 10px;
    font-size: 1.1em;
}

.key-point p {
    color: #555;
    line-height: 1.6;
}

/* ================================================
   FOOTER
   ================================================ */

footer {
    background: linear-gradient(135deg, rgb(212, 61, 15) 0%, rgb(180, 50, 10) 100%);
    color: white;
    text-align: center;
    padding: 20px;
    margin-top: 40px;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.1);
}

footer p {
    margin: 0;
    font-size: 1em;
}

/* ================================================
   RESPONSIVE DESIGN
   ================================================ */

/* Tablet and below */
@media (max-width: 768px) {
    /* Logo size adjustment */
    .logo {
        width: 100px;
        height: 100px;
    }
    
    /* Header text sizes */
    header h1 {
        font-size: 1.8em;
    }
    
    .subtitle {
        font-size: 0.9em;
    }
    
    /* Error types stack vertically */
    .error-types {
        grid-template-columns: 1fr;
    }
    
    /* Key points stack vertically */
    .key-points-grid {
        grid-template-columns: 1fr;
    }
    
    /* Table font size */
    .journal-table th,
    .journal-table td {
        padding: 8px;
        font-size: 0.9em;
    }
    
    /* Example header stack */
    .example-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Mobile devices */
@media (max-width: 480px) {
    .logo {
        width: 80px;
        height: 80px;
    }
    
    header h1 {
        font-size: 1.5em;
    }
    
    .container {
        padding: 0 10px;
    }
    
    .journal-table {
        font-size: 0.8em;
    }
    
    .example-number {
        padding: 8px 15px;
        font-size: 1em;
    }
}

/* ================================================
   PRINT STYLES
   ================================================ */

@media print {
    /* Hide interactive elements when printing */
    .solution-btn {
        display: none;
    }
    
    /* Show all solutions when printing */
    .solution-box {
        display: block !important;
    }
    
    /* Ensure proper page breaks */
    .example-section {
        page-break-inside: avoid;
    }
    
    /* Simplify colors for print */
    body {
        background: white;
    }
}