/* style.css - Complete Unified Version */

/* 1. Global Reset & Body */
body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    background: #f4f4f4; 
    padding: 20px 0; 
    color: #333;
    margin: 0;
}

/* 2. Primary Container */
.container { 
    max-width: 1000px; 
    background: white; 
    margin: 0 auto; 
    padding: 30px 20px; 
    border-radius: 8px; 
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 95%;
    box-sizing: border-box;
    overflow: hidden; /* Prevents internal elements from hanging out */
}

/* 3. Header Grid System (40:60 Split) */
.header-grid {
    display: grid;
    grid-template-columns: 40% 60%;
    align-items: center; 
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
    box-sizing: border-box;
}

.header-left .logo {
    max-width: 100%;
    height: auto;
    display: block;
}

.header-right {
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 0; /* Prevents flex-item blowout */
    width: 100%;
}

/* 4. Search & Controls */
.search-container {
    width: 100%;
}

.search-container input {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    box-sizing: border-box; 
    display: block;
}

.refresh-container {
    display: flex;
    justify-content: flex-end;
}

.refresh-btn { 
    padding: 8px 14px; 
    background: #f8f8f8; 
    color: #666; 
    text-decoration: none; 
    border-radius: 4px; 
    font-size: 13px; 
    border: 1px solid #ddd;
    transition: all 0.2s ease;
}

.refresh-btn:hover { 
    background: #eee; 
    color: #333; 
    border-color: #bbb; 
}

/* 5. Typography & Navigation */
h2 { 
    border-bottom: 3px solid #ffcc00; 
    padding-bottom: 15px; 
    margin-top: 0;
    word-break: break-all; 
    overflow-wrap: break-word;
}

.back-link { 
    margin-bottom: 20px; 
    display: inline-block; 
    color: #cc0000; 
    text-decoration: none; 
    font-weight: bold;
}

/* 6. Table Styles */
table { 
    width: 100%; 
    border-collapse: collapse; 
    margin-top: 20px; 
}

th { 
    text-align: left; 
    background: #f8f8f8; 
    padding: 12px; 
    border-bottom: 2px solid #ddd;
}

td { 
    padding: 12px; 
    border-bottom: 1px solid #eee; 
}

tr:hover { background: #fdfdfd; }

.folder { font-weight: bold; color: #0056b3; text-decoration: none; }
.file { color: #555; text-decoration: none; }
.file:hover, .folder:hover { text-decoration: underline; }

.folder, .file {
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 7. Responsive Adjustments */
@media (max-width: 768px) {
    .header-grid { 
        grid-template-columns: 100%; 
    }
    .header-left .logo { 
        max-width: 200px; 
        margin: 0 auto 10px; 
    }
    .refresh-container { 
        justify-content: flex-start; 
    }
    .container {
        padding: 20px 15px;
    }
}