/* Basic Reset & Body */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', 'Segoe UI', Arial, sans-serif; /* UPDATED FONT */
    font-size: 14px;
    line-height: 1.6; /* UPDATED LINE HEIGHT */
    color: #212529; /* UPDATED TEXT COLOR */
    background-color: #f8f9fa; /* Light background */
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

a {
    color: var(--theme-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Theme Colors defined in index.php <style> block */

/* Header */
.app-header {
    display: flex;
    align-items: center;
    padding: 10px 25px; /* Increased padding slightly */
    background-color: #fff;
    border-bottom: 1px solid var(--border-color);
    height: 64px; /* Slightly taller header */
    box-shadow: 0 1px 3px rgba(0,0,0,0.05); /* Subtle shadow */
}

.app-header .logo {
    display: flex;
    align-items: center;
    margin-right: 40px;
}

.app-header .logo img {
    height: 38px; /* Slightly larger logo */
    margin-right: 12px;
}

.app-header .logo span {
    font-size: 20px;
    font-weight: 500; /* Medium weight */
    color: #495057;
}

.search-bar {
    flex-grow: 1;
    display: flex;
    max-width: 720px;
    margin: 0 auto;
}

.search-bar input {
    flex-grow: 1;
    padding: 10px 15px;
    border: 1px solid transparent;
    border-radius: 8px 0 0 8px;
    background-color: #f1f3f4;
    font-size: 16px;
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}
.search-bar input:focus {
     background-color: #fff;
     border: 1px solid var(--border-color);
     box-shadow: 0 1px 3px rgba(0,0,0,0.08);
     outline: none;
     z-index: 10; /* Ensure focus stays above */
}


.search-bar button {
    padding: 10px 15px;
    border: none;
    background-color: #f1f3f4;
    border-radius: 0 8px 8px 0;
    color: #5f6368;
    border-left: none;
    transition: background-color 0.2s ease;
    cursor: pointer;
}
.search-bar button:hover {
     background-color: #e8eaed;
}

.user-actions {
    margin-left: auto;
}
.user-actions .action-button {
    background: none;
    border: none;
    font-size: 22px; /* Slightly larger icon */
    color: #5f6368;
    padding: 5px;
    cursor: pointer;
    transition: color 0.2s ease;
}
.user-actions .action-button:hover {
    color: var(--theme-color);
}

/* Main Layout */
.app-container {
    display: flex;
    flex-grow: 1;
    overflow: hidden;
}

/* Sidebar */
.sidebar {
    width: 250px; /* Slightly wider sidebar */
    background-color: #fff; /* Changed sidebar background */
    padding: 15px 0;
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* --- ENHANCED NEW BUTTON --- */
.sidebar .new-button {
    background: var(--theme-color);
    color: var(--text-color-light);
    border: none;
    border-radius: 25px; /* Fully rounded */
    padding: 12px 25px; /* Increased padding */
    margin: 15px 25px; /* Increased margin */
    font-size: 15px;
    font-weight: 500; /* Medium weight */
    box-shadow: 0 3px 6px rgba(103, 61, 230, 0.3); /* Subtle shadow */
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}
.sidebar .new-button:hover {
    background: #5630c0; /* Slightly darker shade on hover */
    box-shadow: 0 4px 8px rgba(103, 61, 230, 0.4);
}
.sidebar .new-button i {
    margin-right: 8px;
}
/* --- END ENHANCED NEW BUTTON --- */

.sidebar ul {
    list-style: none;
    margin-top: 20px;
}

.sidebar ul li a {
    display: flex;
    align-items: center;
    padding: 12px 25px; /* UPDATED PADDING */
    color: #495057; /* UPDATED TEXT COLOR */
    border-radius: 0 25px 25px 0;
    margin-right: 15px;
    transition: background-color 0.2s ease, color 0.2s ease;
    font-weight: 400;
}
.sidebar ul li a i {
    margin-right: 18px; /* Increased icon spacing */
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.sidebar ul li.active a,
.sidebar ul li a:hover {
    background-color: rgba(103, 61, 230, 0.08); /* Lighter theme background */
    color: var(--theme-color);
    font-weight: 500; /* Medium weight when active/hover */
}

.storage-info {
    margin-top: auto;
    padding: 25px; /* Increased padding */
    font-size: 13px; /* Slightly larger font */
    color: #5f6368;
}
.storage-info progress {
    width: 100%;
    height: 8px;
    margin-bottom: 8px; /* Increased spacing */
    accent-color: var(--theme-color);
    border-radius: 4px;
    overflow: hidden; /* Ensure border-radius applies */
}
/* Style progress bar appearance (optional, browser support varies) */
.storage-info progress::-webkit-progress-bar {
    background-color: #e9ecef;
    border-radius: 4px;
}
.storage-info progress::-webkit-progress-value {
    background-color: var(--theme-color);
    border-radius: 4px;
}
.storage-info progress::-moz-progress-bar {
    background-color: var(--theme-color);
    border-radius: 4px;
}


/* Main Content Area */
.main-content {
    flex-grow: 1;
    padding: 25px; /* Increased padding */
    overflow-y: auto;
    background-color: #fff;
}

.breadcrumb {
    margin-bottom: 25px; /* Increased spacing */
    font-size: 18px; /* Slightly larger */
    color: #5f6368;
}
.breadcrumb a {
    color: var(--theme-color);
    font-weight: 500;
}
.breadcrumb i {
    font-size: 14px;
    margin: 0 10px; /* Increased spacing */
    color: #adb5bd; /* Lighter chevron */
    vertical-align: middle;
}
.breadcrumb span {
    font-weight: 500;
    color: #343a40; /* Darker color for current location */
}


.action-bar {
    margin-bottom: 25px; /* Increased spacing */
    display: flex;
    gap: 12px;
}

/* --- ENHANCED STANDARD BUTTON --- */
button, .upload-button {
    background-color: #fff;
    border: 1px solid var(--border-color); /* Use theme border color */
    color: #495057; /* Use updated text color */
    padding: 10px 18px; /* UPDATED PADDING */
    border-radius: 6px; /* Slightly more rounded */
    font-size: 14px;
    font-weight: 500; /* Medium weight */
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    display: inline-flex; /* Align icon and text */
    align-items: center;
}
button:hover, .upload-button:hover {
     background-color: #f8f9fa; /* Subtle background */
     border-color: #adb5bd;
}
button i, .upload-button i {
    margin-right: 6px;
}
/* --- END ENHANCED STANDARD BUTTON --- */

/* Example: Style 'Create Folder' button differently */
.action-bar button:first-child {
    background-color: rgba(103, 61, 230, 0.08);
    border-color: rgba(103, 61, 230, 0.3);
    color: var(--theme-color);
}
 .action-bar button:first-child:hover {
     background-color: rgba(103, 61, 230, 0.15);
     border-color: rgba(103, 61, 230, 0.4);
 }

/* File List */
.file-list-header {
    display: flex;
    padding: 12px 20px; /* Adjusted padding */
    border-bottom: 2px solid var(--border-color); /* Slightly heavier border */
    font-weight: 500;
    color: #495057; /* Updated text color */
    font-size: 13px;
    text-transform: uppercase; /* Optional: Uppercase headers */
    letter-spacing: 0.5px; /* Optional: spacing */
}

.item-list {
    list-style: none;
}

.item {
    display: flex;
    align-items: center;
    padding: 15px 20px; /* UPDATED PADDING */
    border-bottom: 1px solid #f1f3f4;
    cursor: default;
    transition: background-color 0.15s ease; /* Add hover transition */
}
.item:hover {
    background-color: #f8f9fa; /* Subtle hover background */
}

/* Column Widths & Styles */
.item .icon {
    width: 45px; /* Increased width */
    text-align: center;
    color: var(--theme-color);
    font-size: 18px; /* Larger icons */
}
.item .name {
    flex-grow: 1;
    padding: 0 15px; /* Increased padding */
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500; /* Medium weight for names */
}
.item .name a {
    color: #343a40; /* Darker link color */
    font-weight: 500;
}
.item .name a:hover {
    color: var(--theme-color);
    text-decoration: none;
}
.item .modified {
    width: 160px; /* Wider column */
    text-align: left;
    padding: 0 15px; /* Increased padding */
    color: #5f6368; /* Lighter text */
    font-size: 13px;
}
.item .size {
    width: 110px; /* Wider column */
    text-align: right;
    padding: 0 15px; /* Increased padding */
    color: #5f6368; /* Lighter text */
    font-size: 13px;
}
.item .actions {
    width: 130px; /* Wider actions column */
    text-align: right;
    padding: 0 10px; /* Adjusted padding */
    display: flex;
    justify-content: flex-end;
    gap: 8px; /* Increased gap */
}
.item .actions button {
    background: none;
    border: none;
    color: #6c757d; /* Slightly darker icon color */
    padding: 6px; /* Slightly larger padding */
    font-size: 18px; /* Larger icons */
    visibility: hidden;
    border-radius: 50%; /* Round buttons */
    line-height: 1; /* Prevent extra space */
    width: 32px; /* Fixed width */
    height: 32px; /* Fixed height */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s ease, background-color 0.2s ease;
}
.item:hover .actions button {
    visibility: visible;
}
.item .actions button:hover {
    color: var(--theme-color);
    background-color: #e9ecef; /* Light background on hover */
}


.empty-message {
    padding: 50px 20px; /* Increased padding */
    text-align: center;
    color: #6c757d; /* Updated text color */
    font-size: 16px; /* Larger font */
}

/* Footer */
.app-footer {
    padding: 20px 25px; /* Increased padding */
    text-align: center;
    font-size: 13px; /* Slightly larger */
    color: #6c757d;
    background-color: #f8f9fa;
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}


/* Modal Basic Styles */
.modal {
    position: fixed;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 35px; /* Increased padding */
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.15); /* Softer shadow */
    z-index: 1000;
    min-width: 350px; /* Wider modal */
}

.modal h2 {
    margin-top: 0;
    margin-bottom: 25px; /* Increased spacing */
    font-size: 20px; /* Larger title */
    font-weight: 500;
    color: #343a40;
}

.modal input[type="text"],
.modal input[type="password"] {
    width: 100%;
    padding: 12px 15px; /* Increased padding */
    margin-bottom: 18px; /* Increased spacing */
    border: 1px solid #ced4da;
    border-radius: 6px;
    font-size: 15px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.modal input[type="text"]:focus,
.modal input[type="password"]:focus {
    border-color: var(--theme-color);
    box-shadow: 0 0 0 2px rgba(103, 61, 230, 0.2);
    outline: none;
}


.modal button {
    margin-right: 10px;
    padding: 10px 20px; /* Increased padding */
}
/* Style primary modal button */
.modal button:first-of-type {
     background-color: var(--theme-color);
     border-color: var(--theme-color);
     color: white;
}
.modal button:first-of-type:hover {
    background-color: #5630c0;
    border-color: #5630c0;
}

.modal .cancel-btn {
    background-color: #f8f9fa;
    border-color: #ced4da;
    color: #495057;
}
.modal .cancel-btn:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
}

.modal label {
    display: inline-flex;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    cursor: pointer;
}
.modal input[type="checkbox"] {
    margin-right: 8px;
    width: 16px;
    height: 16px;
    accent-color: var(--theme-color);
}

#share-password-input {
    margin-top: 10px;
    margin-bottom: 18px;
}