* {
    box-sizing: border-box;
}

:root {
    --bg: #071018;
    --panel: #0b1822;
    --panel2: #10212d;
    --panel3: #132936;
    --line: #183b50;
    --line-soft: rgba(40,169,255,.10);

    --blue: #28a9ff;
    --blue-soft: rgba(40,169,255,.10);
    --blue-soft2: rgba(40,169,255,.16);

    --text: #e8f3fa;
    --muted: #7892a4;
    --danger: #ff5266;
}

html,
body {
    margin: 0;
    width: 100%;
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: Arial, Helvetica, sans-serif;
}

body {
    min-height: 100vh;
}

button,
input {
    font: inherit;
}

button {
    color: var(--text);
}

.hidden {
    display: none !important;
}


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

.login-view {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 25px;
}

.login-box {
    width: 100%;
    max-width: 390px;
}

.brand {
    text-align: center;
    margin-bottom: 45px;
}

.brand-icon {
    width: 72px;
    height: 72px;
    margin: 0 auto 15px;

    border: 2px solid var(--blue);
    border-radius: 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: var(--blue);
    font-size: 38px;
    font-weight: bold;

    box-shadow:
        0 0 25px rgba(40,169,255,.20),
        inset 0 0 18px rgba(40,169,255,.03);
}

.brand h1 {
    margin: 0;
    letter-spacing: 4px;
    font-size: 28px;
}

.brand span {
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 3px;
}

label {
    display: block;
    color: var(--muted);
    margin: 18px 0 7px;
    font-size: 13px;
}

input {
    width: 100%;
    padding: 15px;

    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;

    color: white;
    outline: none;
}

input:focus {
    border-color: var(--blue);
    box-shadow: 0 0 10px rgba(40,169,255,.15);
}

.primary-button {
    width: 100%;
    margin-top: 28px;
    padding: 15px;

    border: 1px solid var(--blue);
    border-radius: 8px;

    background: rgba(40,169,255,.12);
    color: var(--blue);

    font-weight: bold;
    letter-spacing: 1px;

    cursor: pointer;
}

.primary-button:hover {
    background: rgba(40,169,255,.18);
}

.error {
    min-height: 20px;
    margin-top: 10px;

    color: var(--danger);
    font-size: 13px;
}


/* =========================================================
   CLOUD
========================================================= */

.cloud-view {
    width: 100%;
    max-width: 1440px;
    min-height: 100vh;

    margin: 0 auto;

    padding-bottom: 74px;

    background: rgba(7,16,24,.70);

    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);
}


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

header {
    height: 72px;

    padding: 0 22px;

    border-bottom: 1px solid var(--line);

    background: rgba(11,24,34,.96);

    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-brand {
    color: var(--blue);

    font-weight: bold;
    letter-spacing: 2px;
}

.user-name {
    color: var(--muted);

    font-size: 12px;
    margin-top: 4px;
}

.icon-button {
    width: 44px;
    height: 44px;

    border: 1px solid var(--line);
    border-radius: 9px;

    background: transparent;

    cursor: pointer;

    transition:
        color .15s ease,
        border-color .15s ease,
        background .15s ease;
}

.icon-button:hover {
    color: var(--blue);
    border-color: var(--blue);
    background: var(--blue-soft);
}


/* =========================================================
   PATH BAR
========================================================= */

.path-bar {
    height: 54px;

    padding: 0 20px;

    display: flex;
    align-items: center;
    gap: 12px;

    border-bottom: 1px solid var(--line);

    background: rgba(7,17,25,.92);

    color: #a9c2d2;
}

.back-button {
    width: 36px;
    height: 36px;

    background: transparent;
    border: 0;
    border-radius: 8px;

    color: var(--blue);

    font-size: 30px;
    line-height: 1;

    cursor: pointer;
}

.back-button:hover {
    background: var(--blue-soft);
}

#currentPath {
    min-width: 0;

    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;

    font-size: 14px;
}


/* =========================================================
   FILE AREA
========================================================= */

main {
    padding: 14px 18px;
}

.file-list {
    width: 100%;
}

.file-item {
    min-height: 68px;

    display: flex;
    align-items: center;
    gap: 14px;

    padding: 9px 12px;

    border-bottom: 1px solid var(--line-soft);
    border-radius: 7px;

    cursor: pointer;

    transition:
        background .15s ease,
        border-color .15s ease;
}

.file-item:hover {
    background: rgba(40,169,255,.035);
}

.file-item:active {
    background: var(--panel2);
}

.file-icon {
    width: 44px;
    min-width: 44px;

    text-align: center;

    font-size: 27px;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    color: var(--text);

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-meta {
    margin-top: 4px;

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

.file-menu {
    width: 42px;
    height: 42px;

    border: 0;
    border-radius: 8px;

    background: transparent;
    color: var(--muted);

    font-size: 22px;

    cursor: pointer;

    transition:
        color .15s ease,
        background .15s ease;
}

.file-menu:hover {
    color: var(--blue);
    background: var(--blue-soft);
}

.empty-state {
    padding: 90px 20px;

    text-align: center;
    color: var(--muted);
}


/* =========================================================
   BOTTOM BAR
========================================================= */

.bottom-bar {
    position: fixed;

    left: 50%;
    bottom: 0;

    transform: translateX(-50%);

    width: min(1440px, 100%);
    height: 68px;

    display: flex;

    background: rgba(9,20,29,.97);

    border-top: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-right: 1px solid var(--line);

    backdrop-filter: blur(12px);

    z-index: 30;
}

.bottom-bar button {
    flex: 1;

    border: 0;

    background: transparent;
    color: var(--muted);

    cursor: pointer;

    font-size: 12px;

    transition:
        color .15s ease,
        background .15s ease;
}

.bottom-bar button:hover {
    color: var(--blue);
    background: rgba(40,169,255,.04);
}

.bottom-bar span {
    display: block;

    color: var(--blue);

    font-size: 23px;
    line-height: 22px;

    margin-bottom: 4px;
}


/* =========================================================
   OVERLAY
========================================================= */

.overlay {
    position: fixed;
    inset: 0;

    z-index: 100;

    background: rgba(0,0,0,.72);

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 18px;

    backdrop-filter: blur(5px);
}

.dialog {
    width: 100%;
    max-width: 440px;
    max-height: 85vh;

    overflow: auto;

    background: var(--panel);

    border: 1px solid var(--line);
    border-radius: 12px;

    box-shadow: 0 20px 70px rgba(0,0,0,.5);
}

.dialog-header {
    padding: 15px 18px;

    border-bottom: 1px solid var(--line);

    display: flex;
    justify-content: space-between;
    align-items: center;

    color: var(--blue);

    font-weight: bold;
}

.dialog-header button {
    width: 38px;
    height: 38px;

    border: 0;
    border-radius: 7px;

    background: transparent;

    font-size: 26px;

    cursor: pointer;
}

.dialog-header button:hover {
    color: var(--blue);
    background: var(--blue-soft);
}

.dialog-body {
    padding: 18px;
}

.dialog-actions {
    margin-top: 20px;

    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.dialog-actions button {
    padding: 11px 16px;

    border: 1px solid var(--line);
    border-radius: 7px;

    background: var(--panel2);

    cursor: pointer;
}

.dialog-actions button:hover {
    border-color: var(--blue);
}

.dialog-actions .confirm {
    border-color: var(--blue);
    color: var(--blue);
}


/* =========================================================
   TRASH
========================================================= */

.trash-item {
    padding: 13px 0;

    border-bottom: 1px solid var(--line);
}

.trash-name {
    font-weight: bold;
}

.trash-path {
    color: var(--muted);

    font-size: 12px;

    margin: 4px 0 10px;

    overflow-wrap: anywhere;
}

.trash-actions {
    display: flex;
    gap: 8px;
}

.trash-actions button {
    padding: 8px 10px;

    border: 1px solid var(--line);
    border-radius: 6px;

    background: transparent;

    cursor: pointer;
}

.trash-actions button:hover {
    border-color: var(--blue);
}


/* =========================================================
   DESKTOP
========================================================= */

@media (min-width: 900px) {

    main {
        padding: 18px 26px;
    }

    .file-item {
        padding-left: 14px;
        padding-right: 14px;
    }

    .bottom-bar {
        height: 64px;
    }

    .bottom-bar button {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 9px;

        font-size: 13px;
    }

    .bottom-bar span {
        display: inline;
        margin: 0;

        font-size: 20px;
    }
}


/* =========================================================
   PHONE
========================================================= */

@media (max-width: 600px) {

    .cloud-view {
        border-left: 0;
        border-right: 0;

        padding-bottom: calc(68px + env(safe-area-inset-bottom));
    }

    header {
        height: 64px;
        padding: 0 15px;
    }

    .path-bar {
        padding: 0 12px;
    }

    main {
        padding: 8px;
    }

    .file-item {
        min-height: 66px;

        padding-left: 5px;
        padding-right: 3px;
    }

    .file-icon {
        width: 40px;
        min-width: 40px;
    }

    .bottom-bar {
        border-left: 0;
        border-right: 0;

        height: calc(68px + env(safe-area-inset-bottom));

        padding-bottom: env(safe-area-inset-bottom);
    }

    .dialog {
        max-width: 100%;
    }
}
/* =========================================================
   FIX2 - FILE TYPE ICONS
========================================================= */

.file-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.file-icon svg {
    width: 28px;
    height: 28px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.file-icon.type-folder { color: var(--blue); }
.file-icon.type-image { color: #4dc6ff; }
.file-icon.type-pdf { color: #ff6978; }
.file-icon.type-text { color: #9bc9e4; }
.file-icon.type-archive { color: #d8a7ff; }
.file-icon.type-audio { color: #62d9bd; }
.file-icon.type-video { color: #62c8ff; }
.file-icon.type-file { color: #7e9daf; }


/* =========================================================
   FIX2 - BREADCRUMBS
========================================================= */

#currentPath {
    display: flex;
    align-items: center;
    min-width: 0;
    overflow-x: auto;
    overflow-y: hidden;
    text-overflow: clip;
    white-space: nowrap;
    scrollbar-width: none;
}

#currentPath::-webkit-scrollbar {
    display: none;
}

.breadcrumb-item {
    flex: 0 0 auto;
    padding: 6px 8px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: #a9c2d2;
    font-size: 13px;
    cursor: pointer;
}

.breadcrumb-item:hover {
    color: var(--blue);
    background: var(--blue-soft);
}

.breadcrumb-item:last-child {
    color: var(--text);
}

.breadcrumb-separator {
    flex: 0 0 auto;
    margin: 0 1px;
    color: #42677e;
    font-size: 18px;
}


/* =========================================================
   FIX2 - FILE METADATA
========================================================= */

.file-meta {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (min-width: 900px) {
    .file-icon svg {
        width: 30px;
        height: 30px;
    }

    .file-item {
        min-height: 70px;
    }

    .file-name {
        font-size: 15px;
    }
}

@media (max-width: 600px) {
    .breadcrumb-item {
        padding-left: 5px;
        padding-right: 5px;
    }

    .file-meta {
        font-size: 11px;
    }

    .file-icon svg {
        width: 27px;
        height: 27px;
    }
}
