/* ຮູບແບບສຳລັບລະບົບຈັດການເອກະສານ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #4a90e2;
    --secondary-color: #50c878;
    --danger-color: #e74c3c;
    --warning-color: #f39c12;
    --dark-color: #2c3e50;
    --light-color: #ecf0f1;
    --border-color: #ddd;
    --shadow: 0 2px 10px rgba(0,0,0,0.1);
    --shadow-hover: 0 4px 20px rgba(0,0,0,0.15);
}

body {
    font-family: 'Noto Sans Lao Looped', sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: var(--dark-color);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    overflow: hidden;
}

/* ຫົວຂໍ້ */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

/* ແຖບຄົ້ນຫາ */
.search-bar {
    display: flex;
    gap: 12px;
    padding: 25px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-bottom: 2px solid var(--border-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.search-input {
    flex: 1;
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Noto Sans Lao Looped', sans-serif;
    font-size: 1em;
    transition: all 0.3s;
}

.search-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.category-select {
    padding: 12px 20px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Noto Sans Lao Looped', sans-serif;
    font-size: 1em;
    background: white;
    cursor: pointer;
}

/* ປຸ່ມ */
.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 10px;
    font-family: 'Noto Sans Lao Looped', sans-serif;
    font-size: 1em;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

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

.btn-primary:hover {
    background: #357abd;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-upload {
    background: var(--secondary-color);
    color: white;
    font-size: 1.1em;
    padding: 15px 40px;
}

.btn-upload:hover {
    background: #45b869;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
    padding: 8px 20px;
    font-size: 0.9em;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-download {
    background: var(--primary-color);
    color: white;
    padding: 8px 20px;
    font-size: 0.9em;
}

.btn-download:hover {
    background: #357abd;
}

/* ສ່ວນການຈັດການ */
.action-bar {
    display: flex;
    gap: 15px;
    padding: 25px;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border-bottom: 2px solid var(--border-color);
    flex-wrap: wrap;
    justify-content: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.btn-folder {
    background: #9b59b6;
    color: white;
}

.btn-folder:hover {
    background: #8e44ad;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-category {
    background: #3498db;
    color: white;
}

.btn-category:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.btn-filetype {
    background: #16a085;
    color: white;
}

.btn-filetype:hover {
    background: #138d75;
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

/* Breadcrumb */
.breadcrumb {
    padding: 15px 30px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-bottom: 2px solid var(--border-color);
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.breadcrumb-link {
    color: var(--primary-color);
    text-decoration: none;
    padding: 5px 10px;
    border-radius: 5px;
    transition: all 0.3s;
    font-weight: 500;
}

.breadcrumb-link:hover {
    background: var(--primary-color);
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
}

.breadcrumb > span {
    color: #7f8c8d;
}

/* ສ່ວນເອກະສານ */
.documents-section {
    padding: 30px;
    background: white;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.section-header h2 {
    color: white;
    margin: 0;
    font-size: 1.5em;
}

.stats {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1em;
}

.stats strong {
    color: white;
    font-size: 1.3em;
    background: rgba(255, 255, 255, 0.2);
    padding: 5px 15px;
    border-radius: 20px;
}


/* ຕາຕະລາງເອກະສານ */
.documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.document-card {
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 15px;
    padding: 25px;
    transition: all 0.3s;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.document-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    transform: scaleX(0);
    transition: transform 0.3s;
}

.document-card:hover::before {
    transform: scaleX(1);
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-color);
}

.folder-card {
    border-color: #9b59b6;
    background: linear-gradient(135deg, #ffffff 0%, #f8f0ff 100%);
}

.folder-card::before {
    background: linear-gradient(90deg, #9b59b6, #8e44ad);
}

.folder-card:hover {
    border-color: #8e44ad;
    transform: translateY(-5px) scale(1.02);
}

.document-icon {
    font-size: 4em;
    text-align: center;
    margin-bottom: 15px;
    filter: drop-shadow(0 2px 5px rgba(0,0,0,0.1));
    transition: transform 0.3s;
}

.document-card:hover .document-icon {
    transform: scale(1.1) rotate(5deg);
}

.document-name {
    font-weight: 600;
    font-size: 1.15em;
    margin-bottom: 12px;
    color: var(--dark-color);
    word-break: break-word;
    line-height: 1.4;
    min-height: 2.8em;
}

.document-info {
    color: #7f8c8d;
    font-size: 0.9em;
    margin-bottom: 15px;
    line-height: 1.6;
}

.document-info div {
    margin-bottom: 6px;
    padding: 3px 0;
    border-left: 3px solid transparent;
    padding-left: 8px;
    transition: all 0.3s;
}

.document-card:hover .document-info div {
    border-left-color: var(--primary-color);
    padding-left: 12px;
}

.document-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--border-color);
}

.document-actions .btn {
    flex: 1;
    justify-content: center;
    font-size: 0.95em;
    padding: 10px 15px;
    transition: all 0.3s;
}

.document-actions .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background: white;
    margin: 5% auto;
    padding: 30px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
    position: relative;
    animation: slideDown 0.3s;
}

@keyframes slideDown {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 2em;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    transition: color 0.3s;
}

.close:hover {
    color: var(--danger-color);
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--dark-color);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    font-family: 'Noto Sans Lao Looped', sans-serif;
    font-size: 1em;
    transition: all 0.3s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.1);
}

.form-actions {
    display: flex;
    gap: 10px;
    margin-top: 25px;
}

.form-actions .btn {
    flex: 1;
}

/* ຄວາມຄືບໜ້າການອັບໂຫຼດ */
.upload-progress {
    margin-top: 20px;
}

.progress-bar {
    width: 100%;
    height: 25px;
    background: var(--light-color);
    border-radius: 15px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-color), var(--secondary-color));
    width: 0%;
    transition: width 0.3s;
    border-radius: 15px;
}

#progressText {
    text-align: center;
    color: var(--dark-color);
    font-size: 0.9em;
}

/* ການແບ່ງໜ້າ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    padding: 10px 20px;
    border: 2px solid var(--border-color);
    background: white;
    border-radius: 8px;
    cursor: pointer;
    font-family: 'Noto Sans Lao Looped', sans-serif;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.pagination button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination .active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Loading */
.loading {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
    font-size: 1.2em;
    grid-column: 1 / -1;
}

.empty-state {
    text-align: center;
    padding: 80px 20px;
    color: #7f8c8d;
    grid-column: 1 / -1;
    background: linear-gradient(135deg, #f5f7fa 0%, #ffffff 100%);
    border-radius: 15px;
    border: 2px dashed var(--border-color);
}

.empty-state-icon {
    font-size: 6em;
    margin-bottom: 25px;
    opacity: 0.5;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px);
    }
    50% {
        transform: translateY(-10px);
    }
}

.empty-state h3 {
    font-size: 1.8em;
    margin-bottom: 15px;
    color: var(--dark-color);
    font-weight: 600;
}

.empty-state p {
    font-size: 1.1em;
    color: #95a5a6;
}

/* ການຕອບສະໜອງ */
@media (max-width: 768px) {
    .header h1 {
        font-size: 1.8em;
    }
    
    .search-bar {
        flex-direction: column;
    }
    
    .action-bar {
        flex-direction: column;
    }
    
    .action-bar .btn {
        width: 100%;
    }
    
    .documents-grid {
        grid-template-columns: 1fr;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
        padding: 15px;
    }
    
    .breadcrumb {
        padding: 12px 20px;
        font-size: 0.85em;
    }
    
    .modal-content {
        width: 95%;
        margin: 10% auto;
        padding: 20px;
    }
    
    .document-card {
        padding: 20px;
    }
}

/* ຂໍ້ຄວາມສຳເລັດ */
.success-message {
    background: var(--secondary-color);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    animation: slideDown 0.3s;
}

.error-message {
    background: var(--danger-color);
    color: white;
    padding: 15px;
    border-radius: 10px;
    margin-bottom: 20px;
    text-align: center;
    animation: slideDown 0.3s;
}

