/* ====================================
        CUSTOM STYLES & COLOR VARIABLES
        ==================================== */
:root {
    --primary-color: #6200EE;
    --primary-dark: #3700B3;
    --surface-color: #FFFFFF;
    --background-color: #F5F5F5;
    --text-primary: rgba(0, 0, 0, 0.87);
    --text-secondary: rgba(0, 0, 0, 0.60);

    /* THAY ĐỔI: Tăng bóng đổ cho chiều sâu lớn hơn (z-depth 3) */
    --shadow-1: 0 10px 20px rgba(0, 0, 0, 0.19), 0 6px 6px rgba(0, 0, 0, 0.23);

    /* THAY ĐỔI: Tăng bóng đổ cho trạng thái hover/active (z-depth 5) */
    --shadow-2: 0 19px 38px rgba(0, 0, 0, 0.30), 0 15px 12px rgba(0, 0, 0, 0.22);
}

body {
    font-family: 'Roboto', sans-serif;
    display: flex;
    margin: 0;
    background: var(--background-color);
    color: var(--text-primary);
    min-height: 100vh;
    /* Quan trọng cho layout footer */
    flex-direction: column;
    /* Quan trọng cho layout footer */
}

/* Log Panel */
#log-panel {
    width: 30%;
    padding: 15px;
    background: #212121;
    border-right: 8px solid var(--primary-color);
    box-sizing: border-box;
    box-shadow: var(--shadow-2);
    min-height: 100vh;
}

#log-panel.hidden {
    display: none;
}

#log-panel h2 {
    color: #fff;
    margin-top: 0;
    font-weight: 500;
}

#log {
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 0.75em;
    background: #000;
    color: #00FF00;
    padding: 10px;
    height: calc(100vh - 70px);
    overflow-y: scroll;
    box-sizing: border-box;
    border-radius: 4px;
}

/* Responsive cho Log Panel */
@media (max-width: 800px) {
    body {
        flex-direction: column;
    }

    #log-panel {
        width: 100%;
        border-right: none;
        border-bottom: 8px solid var(--primary-color);
    }
}

/* App Container */
#app-container {
    flex-grow: 1;
    padding: 24px;
}

#app-container.full-width {
    padding: 24px;
}

@media (max-width: 800px) {
    #app-container {
        padding: 15px;
    }
}

/* App Header */
#app-panel h1 {
    font-size: 1.8rem;
    font-weight: 500;
    color: var(--primary-dark);
    border-bottom: 2px solid var(--primary-color);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 20px;
}

/* Nav Bar (Type Filters) */
#layout-navbar {
    margin-bottom: 20px;
    background: var(--surface-color);
    box-shadow: var(--shadow-2);
    border-radius: 4px;
}

#layout-navbar b {
    font-weight: 500;
    color: var(--primary-color);
    margin-right: 10px;
}

/* Sidebar Header */
#layout-sidebar b {
    display: block;
    font-weight: 500;
    color: var(--primary-dark);
    margin-bottom: 10px;
    font-size: 1.1rem;
    border-bottom: 1px solid var(--background-color);
    padding-bottom: 5px;
}

/* Sidebar: Card Container */
.sidebar-card {
    background: var(--surface-color);
    border-radius: 4px;
    box-shadow: var(--shadow-2);
    padding: 16px;
    /* Thay thế p-4 của Bootstrap */
}

/* Custom Filter Button Styling (Áp dụng cho thẻ <a>) */
.filter-button {
    display: inline-block;
    text-decoration: none;
    text-align: center;

    padding: 10px 15px;
    margin: 4px;
    cursor: pointer;
    border: none;
    border-radius: 20px;

    background: var(--background-color);
    color: var(--text-secondary);
    transition: background 0.3s, box-shadow 0.3s;
    box-shadow: var(--shadow-1);
}

.filter-button:hover {
    background: #e0e0e0;
}

.filter-button.active {
    background: var(--primary-color);
    color: var(--surface-color);
    box-shadow: var(--shadow-2);
}

/* Nút Back (thẻ <a>) */
.back-button {
    width: fit-content;
    padding: 10px 15px;
    margin: 4px;
    cursor: pointer;
    border: none;
    border-radius: 20px;
    background: var(--primary-color);
    color: var(--surface-color);
    box-shadow: var(--shadow-2);
    text-decoration: none;
    /* **display: inline-block** đã được Bootstrap override, ta dùng d-inline-flex trong JS */
}

/* Sidebar: Custom overrides for vertical alignment on desktop */
@media (min-width: 992px) {
    #layout-sidebar .filter-button {
        display: block;
        width: 100%;
        text-align: left;
        margin: 8px 0;
        padding: 10px 12px;
        border-radius: 4px;
    }
}

/* App Card List View (Grid Item Styling) */
.app-card {
    display: block;
    text-decoration: none;
    color: var(--text-primary);

    border: 1px solid #ddd;
    padding: 16px;
    cursor: pointer;
    border-radius: 8px;
    transition: box-shadow 0.3s, background 0.3s;
    background: var(--surface-color);
    box-shadow: var(--shadow-2);
    /* Bóng đổ mạnh hơn */
    height: 100%;
    box-sizing: border-box;
}

.app-card:hover {
    box-shadow: var(--shadow-2);
    /* Bóng đổ mạnh hơn khi hover */
    background: #fafafa;
}

.app-card h4 {
    font-weight: 500;
    margin-top: 0;
    margin-bottom: 5px;
    color: var(--primary-dark);
}

.app-card p {
    font-size: 0.9rem;
    margin: 0;
}

/* Detail View */
.app-detail {
    border: 1px solid var(--primary-color);
    padding: 30px;
    /* Thay thế padding inline */
    border-radius: 8px;
    background: var(--surface-color);
    box-shadow: var(--shadow-2);
    /* Bóng đổ mạnh hơn */
}

/* ====================================
CUSTOM FOOTER STYLES
==================================== */
#app-footer {
    /* THAY ĐỔI: Sử dụng màu tím primary và bóng đổ cao */
    background-color: var(--surface-color);
    color: var(--text-secondary);
    padding: 15px 0;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 300;
    /* Đẩy footer xuống dưới */
    margin-top: 40px;
    box-shadow: var(--shadow-2);
    width: 100%;
}

#app-footer strong {
    font-weight: 500;
    /* color: var(--primary-color); */
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
}

/* Đảm bảo footer nằm dưới cùng trong flex-box */
#app-panel {
    flex-grow: 1;
    /* ... các thuộc tính khác của app-panel */
}

a.home-link {
    text-decoration: unset;
    color: unset;
}

.download-badge-link {
    /* position: absolute; */
    top: 20px;
    /* right: 20px;
    z-index: 10; */
    line-height: 0;
}

.download-badge {
    width: 250px;
    height: auto;
    border-radius: 4px;
    box-shadow: var(--shadow-1);
    transition: box-shadow 0.3s;
}

.mr-16 {
    margin-right: 16px;
}

.mt-8 {
    margin-top: 8px;
}