/* ============ CSS STYLING FOR TUGAS MANDIRI 7 ============ */
:root {
    --primary-green: #2ecc71;
    --primary-dark: #27ae60;
    --text-primary: #333333;
    --text-secondary: #666666;
    --bg-main: #f9f9f9;
    --bg-card: #ffffff;
    --sidebar-bg: #ffffff;
    --sidebar-text: #333333;
    --sidebar-active: #27ae60;
    --border-color: #e0e0e0;
    --transition: all 0.3s ease;
}

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

html {
    scroll-behavior: smooth;
}

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

h1, h2, h3, h4, h5, h6 {
    font-family: 'Outfit', sans-serif;
    color: var(--text-primary);
    font-weight: 700;
}

/* ============ APP LAYOUT ============ */
.app-container {
    display: flex;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 280px;
    background-color: var(--sidebar-bg);
    color: var(--sidebar-text);
    padding: 30px 20px;
    position: fixed;
    height: 100vh;
    left: 0;
    top: 0;
    display: flex;
    flex-direction: column;
    z-index: 10;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.05);
    border-right: 1px solid var(--border-color);
}

.sidebar-header {
    margin-bottom: 30px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--text-primary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary-green);
    transform: translateX(-3px);
}

.student-profile {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #e8f5e9;
    border-radius: 12px;
    margin-bottom: 30px;
}

.avatar {
    width: 44px;
    height: 44px;
    background: var(--primary-green);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
}

.profile-info h4 {
    color: var(--text-primary);
    font-size: 14px;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 170px;
}

.profile-info .role {
    font-size: 11px;
    color: var(--primary-dark);
    font-weight: 700;
}

.profile-info .subject {
    font-size: 11px;
    color: var(--text-secondary);
}

.sidebar-menu {
    flex: 1;
}

.menu-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 15px;
    font-weight: 600;
}

.sidebar-menu ul {
    list-style: none;
}

.sidebar-menu li {
    margin-bottom: 8px;
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-secondary);
    text-decoration: none;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    transition: var(--transition);
}

.menu-item i {
    font-size: 16px;
    width: 20px;
    text-align: center;
}

.menu-item:hover, .menu-item.active {
    color: var(--primary-dark);
    background: #e8f5e9;
}

.menu-item.active {
    border-left: 3px solid var(--primary-green);
    border-radius: 0 8px 8px 0;
    background: #e8f5e9;
    color: var(--primary-dark);
    font-weight: 600;
}

.sidebar-footer {
    font-size: 12px;
    color: var(--text-secondary);
    text-align: center;
    border-top: 1px solid var(--border-color);
    padding-top: 15px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    margin-left: 280px;
    flex: 1;
    padding: 40px;
    max-width: 1000px;
}

/* Top Bar */
.top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}

.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 600;
}

.breadcrumb i {
    font-size: 10px;
}

.theme-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background-color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-color);
}

.theme-badge i {
    font-size: 14px;
}

.text-green {
    color: var(--primary-green);
}

/* Document Hero */
.doc-hero {
    background: linear-gradient(135deg, var(--primary-green) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 40px;
    border-radius: 16px;
    margin-bottom: 40px;
    box-shadow: 0 10px 25px rgba(46, 204, 113, 0.15);
}

.doc-hero-badge {
    background: white;
    color: var(--primary-dark);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    display: inline-block;
    margin-bottom: 20px;
}

.doc-title {
    color: white;
    font-size: 32px;
    line-height: 1.3;
    margin-bottom: 15px;
}

.doc-subtitle {
    color: white;
    opacity: 0.9;
    font-size: 16px;
    margin-bottom: 30px;
    max-width: 800px;
}

/* Meta Cards Grid */
.meta-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.meta-card {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.meta-card .card-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    background: rgba(255, 255, 255, 0.25);
    color: white;
}

.card-details {
    display: flex;
    flex-direction: column;
}

.card-label {
    font-size: 10px;
    letter-spacing: 0.5px;
    color: white;
    opacity: 0.85;
    font-weight: 600;
}

.card-value {
    font-size: 13px;
    font-weight: 700;
    color: white;
}

/* ============ DOCUMENT SECTIONS ============ */
.doc-section {
    background: var(--bg-card);
    border-radius: 16px;
    padding: 35px;
    margin-bottom: 30px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02), 0 10px 30px rgba(0, 0, 0, 0.02);
    border: 1px solid var(--border-color);
}

.section-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 25px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.section-num {
    background: #e8f5e9;
    color: var(--primary-dark);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 14px;
}

.section-header h2 {
    font-size: 22px;
    color: var(--text-primary);
}

.section-body p {
    color: var(--text-primary);
    margin-bottom: 20px;
    font-size: 15px;
    text-align: justify;
}

.section-body p:last-child {
    margin-bottom: 0;
}

/* Callout Box */
.callout-box {
    background-color: #e8f5e9;
    border-left: 4px solid var(--primary-green);
    padding: 20px;
    border-radius: 0 12px 12px 0;
    display: flex;
    gap: 15px;
    margin: 25px 0;
}

.callout-icon {
    font-size: 20px;
    color: var(--primary-dark);
}

.callout-text {
    font-size: 14px;
    color: #1b5e20;
    line-height: 1.6;
}

.callout-text strong {
    display: block;
    margin-bottom: 4px;
    font-weight: 700;
}

/* Lists */
.list-styled {
    margin-bottom: 20px;
    padding-left: 20px;
}

.list-styled li {
    margin-bottom: 8px;
    font-size: 14px;
    color: var(--text-secondary);
}

.list-styled li strong {
    color: var(--text-primary);
}

/* ============ INTERACTIVE TABS ============ */
.interactive-tabs-container {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    margin: 25px 0;
    overflow: hidden;
}

.tab-headers {
    display: flex;
    overflow-x: auto;
    border-bottom: 1px solid var(--border-color);
    background: #eeeeee;
}

.tab-btn {
    flex: 1;
    min-width: 130px;
    padding: 15px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    white-space: nowrap;
}

.tab-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.5);
}

.tab-btn.active {
    color: var(--primary-dark);
    background: white;
    box-shadow: 0 -2px 0 var(--primary-green) inset;
}

.tab-badge-num {
    background: #e8f5e9;
    color: var(--primary-dark);
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    transition: var(--transition);
}

.tab-btn.active .tab-badge-num {
    background: var(--primary-green);
    color: white;
}

.tab-contents {
    padding: 25px;
    background: white;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.4s ease;
}

.tab-pane h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: var(--text-primary);
}

.tab-pane p {
    font-size: 14px;
    color: var(--text-secondary);
}

/* ============ FLOWCHART ============ */
.flowchart-container {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    margin: 25px 0;
    text-align: center;
}

.flowchart-container h4 {
    font-size: 16px;
    margin-bottom: 20px;
    color: var(--text-primary);
}

.flowchart-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.flow-step {
    background: white;
    border: 1px dashed var(--primary-green);
    border-radius: 10px;
    padding: 12px 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    min-width: 110px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.02);
}

.flow-step .step-icon {
    font-size: 20px;
    color: var(--primary-dark);
}

.flow-step span {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
}

.flow-arrow {
    color: var(--text-secondary);
    font-size: 16px;
}

/* ============ STRENGTHS & WEAKNESSES GRID ============ */
.strengths-weaknesses-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
    margin: 25px 0;
}

.sw-column h3 {
    font-size: 16px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.strength-col h3 { color: #27ae60; }
.weakness-col h3 { color: #e74c3c; }

.sw-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    transition: var(--transition);
}

.sw-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.03);
}

.strength-col .sw-card { border-left: 4px solid #2ecc71; }
.weakness-col .sw-card { border-left: 4px solid #e74c3c; }

.sw-card h5 {
    font-size: 14px;
    margin-bottom: 8px;
    color: var(--text-primary);
}

.sw-card p {
    font-size: 12.5px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.5;
}

/* ============ RECOMMENDATIONS ============ */
.recom-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.recom-card {
    background: var(--bg-main);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 25px 20px;
    position: relative;
    transition: var(--transition);
}

.recom-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary-green);
    box-shadow: 0 5px 15px rgba(46, 204, 113, 0.05);
}

.recom-num {
    font-size: 32px;
    font-weight: 800;
    color: rgba(46, 204, 113, 0.15);
    position: absolute;
    top: 15px;
    right: 20px;
    line-height: 1;
}

.recom-card h4 {
    font-size: 15px;
    margin-bottom: 10px;
    color: var(--text-primary);
    padding-right: 30px;
}

.recom-card p {
    font-size: 13px;
    color: var(--text-secondary);
    margin: 0;
    line-height: 1.6;
}

/* ============ BIBLIOGRAPHY (DAFTAR PUSTAKA) ============ */
.pustaka-note {
    font-size: 13px;
    color: var(--text-secondary);
    background: #eeeeee;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.pustaka-list {
    list-style: none;
}

.pustaka-list li {
    font-size: 14px;
    color: var(--text-primary);
    margin-bottom: 15px;
    padding-left: 20px;
    text-indent: -20px;
    line-height: 1.6;
}

.pustaka-list li a {
    color: var(--primary-dark);
    text-decoration: none;
    word-break: break-all;
}

.pustaka-list li a:hover {
    text-decoration: underline;
}

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

/* ============ RESPONSIVE BREAKPOINTS ============ */
@media (max-width: 992px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        box-shadow: none;
        padding: 20px;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
    }
    
    .app-container {
        flex-direction: column;
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .doc-hero {
        padding: 25px;
    }

    .doc-title {
        font-size: 26px;
    }

    .strengths-weaknesses-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 576px) {
    .top-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .meta-cards-grid {
        grid-template-columns: 1fr;
    }

    .doc-section {
        padding: 20px;
    }

    .tab-btn {
        padding: 12px 8px;
        font-size: 12px;
    }

    .tab-contents {
        padding: 15px;
    }

    .recom-grid {
        grid-template-columns: 1fr;
    }
}
