
/* ==========================================
   SERVER MESIN - WINDOWS FILE EXPLORER
   MAIN STYLESHEET
========================================== */

:root {
    --primary: #2868d7;
    --primary-hover: #1e56b7;
    --dark: #101d35;
    --text: #1d2939;
    --muted: #8290a5;
    --border: #e4eaf2;
    --panel: #ffffff;
    --background: #f4f7fb;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    background: var(--background);
    color: var(--text);
    font-family: Inter, "Segoe UI", Arial, sans-serif;
}

/* ==========================================
   HEADER
========================================== */

.topbar {
    position: sticky;
    top: 0;
    z-index: 1000;
    height: 68px;
    background: var(--dark);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 25px;
    box-shadow: 0 3px 14px #172b4d20;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    font-size: 30px;
    color: #70a5ff;
}

.brand b {
    display: block;
    font-size: 13px;
    letter-spacing: 1.5px;
}

.brand small {
    display: block;
    color: #a9b8d0;
    font-size: 10px;
    letter-spacing: 2px;
    margin-top: 3px;
}

/* ==========================================
   MAIN CONTAINER
========================================== */

.app-container {
    max-width: 1350px;
    width: 100%;
    margin: 35px auto;
    padding: 0 22px;
    min-height: calc(100vh - 160px);
}

/* ==========================================
   HEADING
========================================== */

.heading,
.explorer-heading {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-bottom: 22px;
}

.eyebrow {
    font-size: 11px;
    letter-spacing: 2px;
    color: #6385b9;
    font-weight: 700;
}

.heading h1,
.explorer-heading h1 {
    font-size: 28px;
    font-weight: 700;
    margin: 7px 0;
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

/* ==========================================
   STORAGE STATUS
========================================== */

.storage-chip {
    background: #e7f8ef;
    color: #16834b;
    border-radius: 30px;
    padding: 9px 15px;
    font-size: 12px;
    font-weight: 600;
}

/* ==========================================
   TOOLBAR
========================================== */

.toolbar,
.explorer-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    margin-bottom: 18px;
}

.explorer-left,
.explorer-right {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
}

.inline-form {
    display: flex;
    align-items: center;
    gap: 7px;
}

.inline-form input {
    width: 190px;
}

/* ==========================================
   BUTTONS
========================================== */

.btn {
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: .15s;
}

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

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

.btn-light {
    background: white;
    color: #34445c;
    border: 1px solid #dce3ed;
}

.btn-light:hover {
    background: #eef4ff;
    color: var(--primary);
}

.logout-btn {
    background: #263957;
    border: 1px solid #405575;
    color: white;
    border-radius: 8px;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
}

.logout-btn:hover {
    background: #354e73;
    color: white;
}

/* ==========================================
   INPUT
========================================== */

input {
    font-family: inherit;
    min-width: 0;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #2868d71a;
}

/* ==========================================
   BREADCRUMB
========================================== */

.pathbar {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 17px;
    background: white;
    border: 1px solid var(--border);
    border-radius: 9px;
    margin-bottom: 15px;
    overflow-x: auto;
    white-space: nowrap;
    font-size: 13px;
}

.pathbar a {
    color: var(--primary);
    text-decoration: none;
}

.pathbar a:hover {
    text-decoration: underline;
}

/* ==========================================
   PANEL
========================================== */

.panel,
.explorer-panel {
    background: white;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 5px 20px #263c5a08;
}

/* ==========================================
   WINDOWS EXPLORER GRID
========================================== */

.folder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 8px;
    padding: 18px;
    min-height: 330px;
    background: white;
}

.folder-card {
    position: relative;
    min-width: 0;
    padding: 17px 9px;
    border: 1px solid transparent;
    border-radius: 9px;
    text-align: center;
    color: #34445c;
    cursor: pointer;
    transition: background .15s, border .15s;
}

.folder-card:hover {
    background: #eff6ff;
    border-color: #bfdbfe;
}

.folder-card.selected {
    background: #dbeafe;
    border-color: #60a5fa;
}

.big-icon {
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    margin-bottom: 8px;
}

.folder-card .filename {
    color: #34445c;
    font-size: 12px;
    font-weight: 600;
    line-height: 1.5;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.folder-card .file-meta {
    font-size: 10px;
    color: #94a3b8;
    margin-top: 5px;
}

/* ==========================================
   FILE ACTIONS
========================================== */

.folder-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    margin-top: 10px;
    opacity: 0;
    transition: opacity .15s;
}

.folder-card:hover .folder-actions {
    opacity: 1;
}

.folder-actions form {
    display: flex;
    gap: 4px;
}

.folder-actions button,
.folder-actions a {
    width: 28px;
    height: 28px;
    border: 1px solid #dce4ef;
    border-radius: 6px;
    background: white;
    color: #475569;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    font-size: 13px;
}

.folder-actions button:hover,
.folder-actions a:hover {
    background: #dbeafe;
    color: var(--primary);
}

.folder-actions .danger {
    color: #dc2626;
}

.folder-actions .danger:hover {
    background: #fee2e2;
    color: #dc2626;
}

/* ==========================================
   TABLE VIEW SUPPORT
========================================== */

.table-head,
.file-row {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) 130px 160px 170px;
    align-items: center;
    gap: 12px;
    padding: 13px 20px;
}

.table-head {
    background: #f8fafd;
    color: #8793a5;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: .7px;
    font-weight: 700;
}

.file-row {
    border-top: 1px solid #f0f2f6;
    font-size: 13px;
    min-height: 58px;
}

.file-name {
    display: flex;
    align-items: center;
    gap: 11px;
    min-width: 0;
    overflow-wrap: anywhere;
}

.file-name a {
    color: #263a58;
    text-decoration: none;
    font-weight: 600;
}

.file-name a:hover {
    color: var(--primary);
}

.folder-icon {
    color: #e2a52d;
    font-size: 19px;
}

.file-icon-small {
    color: #8494a9;
    font-size: 18px;
}

.meta {
    color: var(--muted);
    font-size: 12px;
}

.actions {
    display: flex;
    align-items: center;
    gap: 7px;
}

.actions form {
    display: flex;
    gap: 5px;
}

.action {
    width: 29px;
    height: 29px;
    border: 1px solid #e3e8ef;
    border-radius: 6px;
    background: white;
    color: #50627b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    cursor: pointer;
    font-size: 15px;
}

.action:hover {
    background: #eef4ff;
    color: var(--primary);
}

.action.danger {
    color: #d34c4c;
}

.action.danger:hover {
    background: #fff0f0;
}

/* ==========================================
   UPLOAD SUMMARY
========================================== */

.upload-form {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    width: 100%;
}

.upload-summary {
    flex-basis: 100%;
    max-width: 450px;
    background: white;
    border: 1px solid #dce5f0;
    border-radius: 9px;
    padding: 12px;
    color: #52627b;
    font-size: 12px;
}

.selected-file {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 0;
    border-bottom: 1px solid #edf0f5;
    overflow-wrap: anywhere;
}

.selected-file small {
    color: #8290a5;
    white-space: nowrap;
}

.upload-total {
    font-weight: 700;
    margin-top: 10px;
    color: #263a58;
}

#uploadButton:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ==========================================
   EMPTY FOLDER
========================================== */

.empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 75px 20px;
    color: #94a3b8;
}

.empty div {
    font-size: 55px;
    margin-bottom: 12px;
}

.empty b {
    color: #52627a;
}

/* ==========================================
   PANEL FOOTER
========================================== */

.panel-foot,
.explorer-footer {
    padding: 12px 18px;
    background: #fafbfd;
    border-top: 1px solid #edf0f5;
    color: #8793a5;
    font-size: 11px;
}

/* ==========================================
   NOTICE
========================================== */

.notice {
    margin-top: 16px;
    background: #edf4ff;
    border: 1px solid #dce9ff;
    color: #526c91;
    border-radius: 9px;
    padding: 13px 16px;
    font-size: 12px;
}

/* ==========================================
   LOGIN PAGE
========================================== */

.login-card {
    max-width: 430px;
    width: 100%;
    margin: 65px auto;
    background: white;
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 35px;
    box-shadow: 0 12px 35px #263c5a10;
}

.login-logo {
    width: 65px;
    height: 65px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #eaf2ff;
    color: var(--primary);
    border-radius: 15px;
    font-size: 35px;
    margin-bottom: 22px;
}

.login-card h1 {
    font-size: 25px;
    margin: 0 0 8px;
    color: var(--text);
}

.login-card form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-card label {
    font-size: 12px;
    font-weight: 600;
    color: #52627b;
    margin-top: 7px;
}

.login-card input {
    width: 100%;
    padding: 13px;
    border: 1px solid #dce4ef;
    border-radius: 8px;
    outline: none;
}

.login-card input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px #2868d71a;
}

.login-card .full {
    width: 100%;
    margin-top: 15px;
}

.login-info {
    margin-top: 22px;
    padding-top: 17px;
    border-top: 1px solid #edf0f5;
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
}

/* ==========================================
   FLASH MESSAGE
========================================== */

.flash {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: 9px;
    margin-bottom: 15px;
    font-size: 13px;
}

.flash.success {
    background: #e8f8ef;
    color: #187347;
    border: 1px solid #c9eed9;
}

.flash.error {
    background: #fff0f0;
    color: #b33d3d;
    border: 1px solid #f5d1d1;
}

/* ==========================================
   FOOTER
========================================== */

footer {
    text-align: center;
    border-top: 1px solid #e8edf4;
    margin-top: 35px;
    padding: 22px;
    background: white;
    color: #98a4b5;
    font-size: 11px;
}

/* ==========================================
   RESPONSIVE
========================================== */

@media(max-width:700px) {

    .topbar {
        height: 62px;
        padding: 0 15px;
    }

    .app-container {
        margin: 22px auto;
        padding: 0 12px;
    }

    .heading,
    .explorer-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .toolbar,
    .explorer-toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .explorer-left,
    .explorer-right {
        width: 100%;
    }

    .explorer .upload-form,
    .upload-form {
        width: 100%;
    }

    .folder-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        padding: 10px;
        gap: 5px;
    }

    .folder-actions {
        opacity: 1;
    }

    .folder-card {
        padding: 13px 6px;
    }

    .table-head {
        display: none;
    }

    .file-row {
        grid-template-columns: minmax(0, 1fr) auto;
        gap: 8px;
        padding: 13px;
    }

    .file-row > .meta {
        display: none;
    }

    .actions {
        justify-content: flex-end;
    }

    .inline-form input {
        width: 145px;
    }

    .pathbar {
        padding: 13px;
    }

    .login-card {
        margin: 35px auto;
        padding: 25px;
    }

    footer {
        margin-top: 20px;
    }
}
