/* Custom CSS for K-8 Worksheet Project */

/* From header.php */
body {
    background-color: #f8f9fa;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}
/* Navbar Toggler Customization (No Frame) */
.navbar-toggler {
    border: none !important;
    padding: 0;
}
.navbar-toggler:focus {
    box-shadow: none !important;
    outline: none !important;
}

/* From admin/index.php */
.hover-card {
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
}
.hover-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 .5rem 1rem rgba(0,0,0,.15)!important;
}
.icon-box {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

/* From admin/login.php */
.login-wrapper {
    min-height: 80vh;
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-card {
    width: 100%;
    max-width: 400px;
}

/* From view.php */
.viewer-container {
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 10px;
}
.viewer-header {
    background: #fff;
    padding: 10px 15px;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: nowrap;
    overflow: hidden;
}
.title-group {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    margin-right: 15px;
    position: relative;
    min-width: 0;
    max-width: 100%;
}
.nav-group {
    flex-shrink: 0;
}
@keyframes marquee {
    0% { transform: translate(0, 0); }
    100% { transform: translate(-100%, 0); }
}
.viewer-body {
    background: #333;
    padding: 0;
    text-align: center;
    width: 100%;
    height: 50vh;
    min-height: 600px;
    position: relative;
    overflow: hidden;
}
.viewer-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #fff;
}
.viewer-footer {
    background: #fff;
    padding: 0;
    border-top: 1px solid #dee2e6;
}
.action-btn {
    border-radius: 0;
    padding: 15px;
    font-weight: bold;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    transition: all 0.2s;
}
.btn-download-action {
    background-color: #0d6efd;
    color: white;
}
.btn-download-action:hover {
    background-color: #0b5ed7;
    color: white;
}
.btn-share-action {
    background-color: #6c757d;
    color: white;
}
.btn-share-action:hover {
    background-color: #5c636a;
    color: white;
}
.btn-favorite-action {
    background-color: #ffc107;
    color: #000;
}
.btn-favorite-action:hover {
    background-color: #ffca2c;
    color: #000;
}
.nav-btn {
    border: 1px solid #dee2e6;
    color: #6c757d;
    padding: 5px 15px;
    border-radius: 4px;
    text-decoration: none;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
}
.nav-btn:hover {
    background-color: #f8f9fa;
    color: #000;
}
.nav-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}
.file-badge {
    background-color: #198754;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    margin-left: 8px;
}
@media (max-width: 992px) {
    .viewer-body {
        height: 60vh;
        min-height: 350px;
    }
    .viewer-header {
        flex-direction: row; 
        gap: 10px;
    }
    .btn-text {
        display: none;
    }
}

/* From index.php */
.hero-section {
    background: linear-gradient(135deg, #4da9ff, #0d6efd);
    color: white;
    padding: 2.5rem 0;
    margin-bottom: 1.5rem;
    text-align: center;
    border-bottom-left-radius: 10px;
    border-bottom-right-radius: 10px;
}
@media (max-width: 576px) {
    .hero-section {
        padding: 1.5rem 0;
    }
}
@media (max-width: 991.98px) {
    .sidebar-col {
        width: 100% !important;
    }
}
.search-container {
    max-width: 700px;
    margin: 0 auto;
    position: relative;
}
.search-input {
    border-radius: 5px;
    padding: 10px 50px 10px 20px;
    border: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    height: 45px;
    font-size: 1rem;
}
.search-btn {
    position: absolute;
    right: 4px;
    top: 4px;
    height: 37px;
    width: 37px;
    border-radius: 4px;
    background-color: #0d6efd;
    color: white;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}
.search-spinner {
    position: absolute;
    right: 50px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    display: none;
}
.level-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    overflow: hidden;
    height: 100%;
}
.level-card-header {
    padding: 10px 15px;
    background: #fff;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.level-title {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
    display: flex;
    align-items: center;
}
.file-count-badge {
    background-color: #f0f2f5;
    color: #555;
    padding: 4px 8px;
    border-radius: 5px;
    font-size: 0.8rem;
    display: flex;
    align-items: center;
    gap: 5px;
}
.year-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.year-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 15px;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.2s;
    position: relative;
}
.year-item:last-child {
    border-bottom: none;
}
.year-item:hover {
    background-color: #f8f9fa;
}
.year-icon {
    color: #0d6efd;
    font-size: 1.1rem;
    margin-right: 12px;
    width: 20px;
    text-align: center;
}
.year-name {
    color: #495057;
    font-weight: 500;
    flex-grow: 1;
    font-size: 0.95rem;
}
.year-count-badge {
    background-color: #0d6efd;
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 12px;
    min-width: 32px;
    text-align: center;
}

.file-results-card {
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: #fff;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.file-results-header {
    background: #f8f9fa;
    padding: 8px 12px;
    border-bottom: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.file-list-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 5px;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}
.file-list-row:last-child {
    border-bottom: none;
}
.file-list-row:hover {
    background-color: #f8f9fa;
    color: #0d6efd;
}
.file-row-left {
    display: flex;
    align-items: center;
    flex: 1;
    min-width: 0;
    padding-right: 10px;
}
.file-row-icon {
    font-size: 1.2rem;
    margin-right: 12px;
    color: #6c757d;
    width: 24px;
    text-align: center;
}
.file-row-title {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.file-row-right {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.stat-pill {
    background-color: #f0f2f5;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.75rem;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Sidebar Styling (Matches File Results Card) */
.sidebar-col .card {
    border: 1px solid #e0e0e0 !important;
    border-radius: 8px !important;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05) !important;
}
.sidebar-col .card-header {
    background-color: #fff !important;
    border-bottom: 1px solid #e0e0e0 !important;
    padding: 10px 15px !important;
}
.sidebar-col .list-group-item {
    border-color: #f0f0f0 !important;
    padding: 10px 15px;
}
.sidebar-col .list-group-item:last-child {
    border-bottom: none !important;
}
