:root {
    --primary-color: #2c3e50;
    --accent-color: #c0392b;
    /* Deep red/burgundy */
    --gold-accent: #d4af37;
    --bg-color: #fdfbf7;
    /* Off-white, paper-like */
    --text-color: #333;
    --table-header-bg: #34495e;
    --table-header-text: #ecf0f1;
    --row-hover: #fcf3cf;
}

body {
    font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.6;
}

header {
    background-color: #1a1a1a;
    color: #fff;
    text-align: center;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.pagination-controls {
    margin-top: 1.5rem;
    text-align: center;
}

.pagination-controls button {
    background-color: white;
    border: 1px solid #ccc;
    color: var(--primary-color);
    padding: 8px 12px;
    margin: 0 4px;
    cursor: pointer;
    border-radius: 4px;
    font-family: inherit;
}

.pagination-controls button:hover:not(:disabled) {
    background-color: #eee;
}

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

.pagination-controls button:disabled {
    color: #ccc;
    cursor: default;
}



.header-content {
    padding: 1rem;
    background: linear-gradient(to bottom, #1a1a1a 0%, #2c3e50 100%);
    border-bottom: 4px solid var(--gold-accent);
}

h1 {
    margin: 0;
    font-family: 'Arial', sans-serif;
    font-weight: bold;
    font-size: 2.5rem;
    color: var(--gold-accent);
    text-shadow: 1px 1px 2px black;
}

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
    background: white;
    box-shadow: 0 0 15px rgba(0, 0, 0, 0.05);
    border-radius: 4px;
    min-height: 600px;
    padding-bottom: 2rem;
}

.admin-link {
    display: inline-block;
    margin-top: 1rem;
    text-decoration: none;
    color: var(--primary-color);
    font-size: 0.9rem;
    border: 1px solid var(--primary-color);
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.admin-link:hover {
    background-color: var(--primary-color);
    color: white;
}

/* Controls Section */
.controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding: 1rem 0;
    border-bottom: 1px solid #eee;
}

.search-box input {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1rem;
    width: 250px;
}

/* Table Style */
.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

th,
td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

th {
    background-color: var(--table-header-bg);
    color: var(--table-header-text);
    cursor: pointer;
    user-select: none;
    font-family: 'Arial', sans-serif;
    letter-spacing: 0.5px;
}

th:hover {
    background-color: #2c3e50;
}

th i {
    margin-left: 5px;
    font-size: 0.8rem;
    opacity: 0.7;
}

tr:hover {
    background-color: var(--row-hover);
}

.file-icon {
    color: var(--accent-color);
    margin-right: 8px;
}

a.file-link {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: bold;
}

a.file-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

.file-size,
.file-date {
    font-size: 0.9rem;
    color: #7f8c8d;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    margin-top: 2rem;
    color: #777;
    font-size: 0.9rem;
    border-top: 1px solid #eee;
}

/* Responsive Design */

/* Tablet & Smaller Laptops (max-width: 1024px) */
@media (max-width: 1024px) {
    .container {
        width: 95%;
        margin: 1rem auto;
    }
}

/* Tablets & Large Phones (max-width: 768px) */
@media (max-width: 768px) {
    .controls {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .search-box input {
        width: 100%;
        box-sizing: border-box;
        /* Ensure padding doesn't affect width */
    }

    .admin-link {
        display: block;
        text-align: center;
        margin-top: 0;
    }

    h1 {
        font-size: 1.8rem;
    }

    .header-image {
        max-height: 200px;
    }
}

/* Mobile Phones (max-width: 480px) */
@media (max-width: 480px) {

    th,
    td {
        padding: 8px 5px;
        font-size: 0.9rem;
    }

    /* Hide Date and Size on very small screens to save space */
    .file-date,
    .file-size {
        display: none;
    }

    /* Show them as block if needed or keep hidden - simplified view for mobile */
    /* Alternatively, stack the content */

    th:nth-child(2),
    td:nth-child(2),
    /* Date column */
    th:nth-child(3),
    td:nth-child(3) {
        /* Size column */
        display: none;
    }

    /* Make name column take more space */
    td:first-child {
        white-space: normal;
        word-break: break-word;
    }

    .container {
        padding: 0.5rem;
        /* Reduce padding */
    }
}

/* Admin & Login Styles */
.admin-panel {
    background: white;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    margin-bottom: 2rem;
}

.upload-form {
    background: #fdfbf7;
    padding: 1.5rem;
    border: 1px dashed #ccc;
    border-radius: 4px;
    margin-bottom: 2rem;
    text-align: center;
}

.upload-form input[type="file"] {
    margin: 10px 0;
    padding: 10px;
    max-width: 100%;
}

.btn-upload,
.login-container button {
    background-color: var(--primary-color);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.3s;
}

.btn-upload:hover,
.login-container button:hover {
    background-color: #34495e;
}

.alert {
    padding: 10px;
    margin-bottom: 1rem;
    border-radius: 4px;
}

.success {
    background-color: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
}

.error {
    background-color: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
}

.delete-btn {
    color: #c0392b;
    text-decoration: none;
    font-size: 0.9rem;
}

.delete-btn:hover {
    text-decoration: underline;
}

.logout-btn {
    float: right;
    padding: 5px 15px;
    background-color: #7f8c8d;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
    margin-left: 10px;
}

.logout-btn:hover {
    background-color: #95a5a6;
}

/* Login Specific */
.login-container {
    max-width: 400px;
    width: 90%;
    margin: 5rem auto;
    text-align: center;
    padding: 2rem;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
}

.login-container input[type="password"] {
    width: 80%;
    padding: 10px;
    margin: 10px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

/* Responsive adjustments for admin elements */
@media (max-width: 600px) {
    .logout-btn {
        float: none;
        display: block;
        margin: 10px 0;
        text-align: center;
        width: 100%;
        box-sizing: border-box;
    }

    .container>div[style*="overflow: hidden"] {
        display: flex;
        flex-direction: column;
        gap: 10px;
    }

    .container>div[style*="overflow: hidden"] span {
        text-align: center;
        display: block;
        margin-bottom: 10px;
    }
}