/* LIBF FIS Revision - Main Stylesheet */

:root {
    --primary: #1F4E79;
    --primary-light: #2E6B9E;
    --secondary: #385723;
    --accent: #ED7D31;
    --danger: #C00000;
    --success: #28a745;
    --warning: #ffc107;
    --light: #f8f9fa;
    --dark: #343a40;
    --gray: #6c757d;
    --white: #ffffff;
    
    --topic-1: #1F4E79;
    --topic-2: #2E6B9E;
    --topic-3: #385723;
    --topic-4: #4CAF50;
    --topic-5: #ED7D31;
    --topic-6: #9C27B0;
    --topic-7: #00BCD4;
    --topic-8: #C00000;
    --topic-9: #7030A0;
    --topic-10: #FF5722;
    --topic-11: #607D8B;
    
    --shadow: 0 2px 8px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 16px rgba(0,0,0,0.15);
    --radius: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header */
header {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: var(--white);
    padding: 20px 0;
    box-shadow: var(--shadow);
}

header h1 {
    font-size: 1.8rem;
    font-weight: 600;
}

header .subtitle {
    font-size: 1rem;
    opacity: 0.9;
}

/* Navigation breadcrumb */
.breadcrumb {
    background: var(--white);
    padding: 12px 0;
    border-bottom: 1px solid #e0e0e0;
}

.breadcrumb a {
    color: var(--primary);
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb span {
    color: var(--gray);
    margin: 0 8px;
}

/* Main content */
main {
    padding: 30px 0;
    min-height: calc(100vh - 200px);
}

/* Topic Cards Grid */
.topic-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.topic-card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    transition: var(--transition);
    border-left: 4px solid var(--primary);
    text-decoration: none;
    color: inherit;
    display: block;
}

.topic-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.topic-card h3 {
    color: var(--primary);
    margin-bottom: 8px;
    font-size: 1.1rem;
}

.topic-card p {
    color: var(--gray);
    font-size: 0.9rem;
}

.topic-card .topic-number {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    margin-bottom: 12px;
}

/* Topic-specific colors */
.topic-card[data-topic="1"] { border-left-color: var(--topic-1); }
.topic-card[data-topic="1"] .topic-number { background: var(--topic-1); }
.topic-card[data-topic="2"] { border-left-color: var(--topic-2); }
.topic-card[data-topic="2"] .topic-number { background: var(--topic-2); }
.topic-card[data-topic="3"] { border-left-color: var(--topic-3); }
.topic-card[data-topic="3"] .topic-number { background: var(--topic-3); }
.topic-card[data-topic="4"] { border-left-color: var(--topic-4); }
.topic-card[data-topic="4"] .topic-number { background: var(--topic-4); }
.topic-card[data-topic="5"] { border-left-color: var(--topic-5); }
.topic-card[data-topic="5"] .topic-number { background: var(--topic-5); }
.topic-card[data-topic="6"] { border-left-color: var(--topic-6); }
.topic-card[data-topic="6"] .topic-number { background: var(--topic-6); }
.topic-card[data-topic="7"] { border-left-color: var(--topic-7); }
.topic-card[data-topic="7"] .topic-number { background: var(--topic-7); }
.topic-card[data-topic="8"] { border-left-color: var(--topic-8); }
.topic-card[data-topic="8"] .topic-number { background: var(--topic-8); }
.topic-card[data-topic="9"] { border-left-color: var(--topic-9); }
.topic-card[data-topic="9"] .topic-number { background: var(--topic-9); }
.topic-card[data-topic="10"] { border-left-color: var(--topic-10); }
.topic-card[data-topic="10"] .topic-number { background: var(--topic-10); }
.topic-card[data-topic="11"] { border-left-color: var(--topic-11); }
.topic-card[data-topic="11"] .topic-number { background: var(--topic-11); }

/* Section styling */
.section {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 24px;
    margin-bottom: 24px;
}

.section h2 {
    color: var(--primary);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 2px solid var(--light);
}

.section h3 {
    color: var(--dark);
    margin: 20px 0 12px;
}

/* Knowledge Organiser Table */
.knowledge-table {
    width: 100%;
    border-collapse: collapse;
    margin: 16px 0;
}

.knowledge-table th,
.knowledge-table td {
    padding: 12px 16px;
    text-align: left;
    border: 1px solid #e0e0e0;
}

.knowledge-table th {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
}

.knowledge-table tr:nth-child(even) {
    background: var(--light);
}

.knowledge-table tr:hover {
    background: #e8f4fc;
}

/* Activity containers */
.activity {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    border-radius: var(--radius);
    padding: 24px;
    margin: 24px 0;
    border: 1px solid #dee2e6;
}

.activity-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.activity-icon {
    width: 40px;
    height: 40px;
    background: var(--primary);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.activity h3 {
    margin: 0;
    color: var(--primary);
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: var(--radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    text-align: center;
}

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

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

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

.btn-success:hover {
    background: #218838;
}

.btn-warning {
    background: var(--warning);
    color: var(--dark);
}

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

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Quiz Styles */
.quiz-question {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 16px;
    border: 1px solid #e0e0e0;
}

.quiz-question h4 {
    margin-bottom: 16px;
    color: var(--dark);
}

.quiz-question .question-number {
    display: inline-block;
    background: var(--primary);
    color: var(--white);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    margin-right: 8px;
}

.quiz-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quiz-option {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    background: var(--light);
    border: 2px solid transparent;
    border-radius: var(--radius);
    cursor: pointer;
    transition: var(--transition);
}

.quiz-option:hover {
    background: #e8f4fc;
    border-color: var(--primary);
}

.quiz-option.selected {
    background: #e8f4fc;
    border-color: var(--primary);
}

.quiz-option.correct {
    background: #d4edda;
    border-color: var(--success);
}

.quiz-option.incorrect {
    background: #f8d7da;
    border-color: var(--danger);
}

.quiz-option input[type="radio"] {
    margin-right: 12px;
    transform: scale(1.2);
}

.quiz-feedback {
    margin-top: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    display: none;
}

.quiz-feedback.show {
    display: block;
}

.quiz-feedback.correct {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.quiz-feedback.incorrect {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.quiz-score {
    text-align: center;
    padding: 24px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    margin-top: 24px;
}

.quiz-score h3 {
    font-size: 2rem;
    margin-bottom: 8px;
}

/* Card Sort Activity */
.card-sort-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.card-sort-terms {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 16px;
    background: var(--light);
    border-radius: var(--radius);
    min-height: 60px;
}

.sort-term {
    padding: 10px 16px;
    background: var(--primary);
    color: var(--white);
    border-radius: var(--radius);
    cursor: grab;
    user-select: none;
    transition: var(--transition);
}

.sort-term:hover {
    background: var(--primary-light);
    transform: scale(1.02);
}

.sort-term.dragging {
    opacity: 0.5;
    cursor: grabbing;
}

.sort-term.placed {
    background: var(--success);
}

.card-sort-zones {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
}

.drop-zone {
    background: var(--white);
    border: 2px dashed #ccc;
    border-radius: var(--radius);
    padding: 16px;
    min-height: 120px;
    transition: var(--transition);
}

.drop-zone h4 {
    color: var(--primary);
    margin-bottom: 12px;
    font-size: 0.95rem;
}

.drop-zone.drag-over {
    border-color: var(--primary);
    background: #e8f4fc;
}

.drop-zone .dropped-items {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.drop-zone .sort-term {
    font-size: 0.9rem;
    padding: 8px 12px;
}

/* Flip Cards */
.flip-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.flip-card {
    height: 180px;
    perspective: 1000px;
    cursor: pointer;
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.flip-card.flipped .flip-card-inner {
    transform: rotateY(180deg);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
    box-shadow: var(--shadow);
}

.flip-card-front {
    background: var(--primary);
    color: var(--white);
    font-weight: 600;
    font-size: 1.1rem;
}

.flip-card-back {
    background: var(--white);
    color: var(--dark);
    transform: rotateY(180deg);
    border: 2px solid var(--primary);
}

/* Case Study */
.case-study {
    background: #fff9e6;
    border: 1px solid #ffc107;
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
}

.case-study h4 {
    color: var(--accent);
    margin-bottom: 12px;
}

.reveal-answer {
    margin-top: 16px;
}

.answer-content {
    display: none;
    margin-top: 12px;
    padding: 16px;
    background: var(--white);
    border-radius: var(--radius);
    border-left: 4px solid var(--success);
}

.answer-content.show {
    display: block;
}

/* Info boxes */
.info-box {
    padding: 16px 20px;
    border-radius: var(--radius);
    margin: 16px 0;
}

.info-box.tip {
    background: #e7f5ff;
    border-left: 4px solid #0066cc;
}

.info-box.warning {
    background: #fff3cd;
    border-left: 4px solid var(--warning);
}

.info-box.danger {
    background: #f8d7da;
    border-left: 4px solid var(--danger);
}

.info-box.success {
    background: #d4edda;
    border-left: 4px solid var(--success);
}

/* Footer */
footer {
    background: var(--dark);
    color: var(--white);
    padding: 24px 0;
    text-align: center;
    margin-top: 40px;
}

footer a {
    color: var(--warning);
}

/* Responsive */
@media (max-width: 768px) {
    header h1 {
        font-size: 1.4rem;
    }
    
    .section {
        padding: 16px;
    }
    
    .topic-grid {
        grid-template-columns: 1fr;
    }
    
    .card-sort-zones {
        grid-template-columns: 1fr;
    }
    
    .flip-cards-grid {
        grid-template-columns: 1fr;
    }
    
    .knowledge-table {
        font-size: 0.9rem;
    }
    
    .knowledge-table th,
    .knowledge-table td {
        padding: 8px;
    }
}

/* Print styles */
@media print {
    header, footer, .btn, .activity {
        display: none;
    }
    
    .section {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
/* Baker Family Scenario Styles */

.baker-card {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 12px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #4a6fa5;
}

.baker-card h4 {
    margin: 0 0 10px 0;
    color: #4a6fa5;
    display: flex;
    align-items: center;
    gap: 10px;
}

.baker-card .avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #4a6fa5;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.baker-quote {
    font-style: italic;
    background: white;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    position: relative;
}

.baker-quote::before {
    content: '"';
    font-size: 3rem;
    color: #4a6fa5;
    position: absolute;
    top: -10px;
    left: 10px;
    opacity: 0.3;
}

.scenario-box {
    background: #fff3cd;
    border: 1px solid #ffc107;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.scenario-box h4 {
    color: #856404;
    margin-top: 0;
}

.decision-point {
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    border-left: 4px solid #28a745;
}

.decision-point h4 {
    color: #155724;
    margin-top: 0;
}

.consequence-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 15px 0;
}

.consequence-good {
    background: #d4edda;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.consequence-bad {
    background: #f8d7da;
    padding: 15px;
    border-radius: 8px;
    border-left: 4px solid #dc3545;
}

.numbers-box {
    background: #f8f9fa;
    border: 2px solid #dee2e6;
    border-radius: 8px;
    padding: 15px;
    margin: 15px 0;
    font-family: monospace;
}

.numbers-box table {
    width: 100%;
}

.numbers-box td {
    padding: 5px 10px;
}

.numbers-box .amount {
    text-align: right;
    font-weight: bold;
}

.numbers-box .highlight {
    background: #fff3cd;
}

.numbers-box .total {
    border-top: 2px solid #333;
    font-weight: bold;
}

.payslip {
    background: white;
    border: 2px solid #333;
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
    font-family: 'Courier New', monospace;
}

.payslip-header {
    text-align: center;
    border-bottom: 2px solid #333;
    padding-bottom: 10px;
    margin-bottom: 15px;
}

.payslip-row {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
}

.payslip-section {
    margin: 15px 0;
}

.payslip-section h5 {
    margin: 0 0 10px 0;
    color: #333;
}

.family-tree {
    background: #e7f3ff;
    padding: 20px;
    border-radius: 12px;
    margin: 20px 0;
}

.family-tree h4 {
    text-align: center;
    color: #0056b3;
}

.generation {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin: 15px 0;
    flex-wrap: wrap;
}

.family-member {
    text-align: center;
    padding: 10px;
}

.family-member .avatar {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    margin: 0 auto 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

.family-member .name {
    font-weight: bold;
    font-size: 0.9rem;
}

.family-member .detail {
    font-size: 0.75rem;
    color: #666;
}

.flow-diagram {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.flow-box {
    background: white;
    padding: 15px 20px;
    border-radius: 8px;
    text-align: center;
    border: 2px solid #4a6fa5;
    min-width: 120px;
}

.flow-arrow {
    font-size: 1.5rem;
    color: #4a6fa5;
}

.tax-band {
    padding: 15px;
    margin: 10px 0;
    border-radius: 8px;
}

.tax-band-0 { background: #d4edda; border-left: 4px solid #28a745; }
.tax-band-20 { background: #cce5ff; border-left: 4px solid #007bff; }
.tax-band-40 { background: #fff3cd; border-left: 4px solid #ffc107; }
.tax-band-45 { background: #f8d7da; border-left: 4px solid #dc3545; }

@media (max-width: 768px) {
    .consequence-box {
        grid-template-columns: 1fr;
    }
    .generation {
        flex-direction: column;
        align-items: center;
    }
    .flow-diagram {
        flex-direction: column;
    }
    .flow-arrow {
        transform: rotate(90deg);
    }
}
