/* Voisona-inspired Design - Exact Match */
@charset "UTF-8";

/* Reset */
body {margin: 0; padding: 0;}
div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, p, blockquote, th, td {margin: 0; padding: 0;}
h1, h2, h3, h4, h5, h6 {font-size: 100%; font-weight: normal;}
ol, ul {list-style: none;}
fieldset, img {border: 0;}
table {border-collapse: collapse; border-spacing: 0;}
caption, th {text-align: left;}
address, caption, cite, code, dfn, em, th, var {font-style: normal; font-weight: normal;}
img {vertical-align: bottom;}

/* Base Styles - Voisona Colors */
html {
    margin: 0;
    padding: 0;
    width: 100%;
    font-size: 20px;
}

body {
    width: 100%;
    height: 100vh;
    min-height: 100vh;
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "游ゴシック体", YuGothic, "游ゴシック", "Yu Gothic", "メイリオ", sans-serif;
    font-size: 0.6rem;
    font-weight: 400;
    -webkit-text-size-adjust: 100%;
    -moz-text-size-adjust: 100%;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

#wrapper {
    position: relative;
    width: 100%;
}

.eng {
    font-family: "Raleway", sans-serif;
    font-weight: 500;
}

a {
    color: #ffffff;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
}

a:hover {
    color: #ffffff;
    text-decoration: none;
}

* {
    box-sizing: border-box;
    letter-spacing: 0.01em;
}

/* Header - Voisona Style */
#wrapper header {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 30;
    width: 100%;
    height: 3.7rem;
    background-color: #ffffff;
}

#wrapper header h1.title {
    width: 5rem;
    position: absolute;
    top: 1.15rem;
    left: 1.35rem;
    z-index: 2;
}

#wrapper header h1.title img {
    height: 1.5rem;
    width: auto;
}

#wrapper header #menu_area {
    display: flex;
    align-items: center;
    height: 100%;
    position: relative;
    justify-content: space-between;
}

#wrapper header #menu_area nav {
    height: 100%;
    width: 100%;
}

#wrapper header #menu_area ul#header_nav {
    height: 100%;
    width: calc(100% - 7.3rem);
    margin: 0 0 0 7.3rem;
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

#wrapper header #menu_area ul#header_nav li {
    position: relative;
    height: 100%;
    font-size: 0.85rem;
    padding: 0 1rem;
}

#wrapper header #menu_area ul#header_nav li a {
    color: #1a1a1a;
    height: 100%;
    display: flex;
    align-items: center;
    transition: opacity 0.2s linear;
}

#wrapper header #menu_area ul#header_nav li a:hover {
    opacity: 0.7;
}

/* Container */
#container {
    position: relative;
    width: 100%;
    opacity: 1;
    overflow: hidden;
}

/* Main Content */
main {
    position: relative;
    width: 100%;
    margin: 0 auto;
    min-height: 100vh;
    display: flex;
}

/* Sidebar - Tree View */
.sidebar {
    width: 250px;
    background-color: #252525;
    border-right: 1px solid #333;
    height: 100vh;
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 0;
}

.sidebar-header {
    padding: 1.5rem 1rem;
    border-bottom: 1px solid #333;
}

.sidebar-header h2 {
    font-size: 0.9rem;
    font-weight: 700;
    color: #ff7e00;
    margin-bottom: 1rem;
}

.new-folder-btn {
    width: 100%;
    padding: 0.6rem;
    background-color: #ff7e00;
    color: #ffffff;
    border: none;
    border-radius: 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.new-folder-btn:hover {
    background-color: #FFA44C;
}

/* Tree Structure */
.folder-tree {
    padding: 0.5rem 0;
}

.tree-item {
    display: flex;
    align-items: center;
    padding: 0.6rem 1rem;
    cursor: pointer;
    transition: background-color 0.2s;
    position: relative;
}

.tree-item:hover {
    background-color: #2a2a2a;
}

.tree-item.active {
    background-color: #ff7e00;
    color: #ffffff;
}

.tree-item-indent {
    width: 1rem;
    display: inline-block;
}

.tree-item-icon {
    width: 1rem;
    height: 1rem;
    margin-right: 0.5rem;
    flex-shrink: 0;
}

.tree-item-name {
    font-size: 0.75rem;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Depth-based padding for folder tree. Uses classes depth-0..depth-8 applied to items. */
.tree-item.depth-0 { padding-left: 1rem; }
.tree-item.depth-1 { padding-left: calc(1rem + 1 * 1.1rem); }
.tree-item.depth-2 { padding-left: calc(1rem + 2 * 1.1rem); }
.tree-item.depth-3 { padding-left: calc(1rem + 3 * 1.1rem); }
.tree-item.depth-4 { padding-left: calc(1rem + 4 * 1.1rem); }
.tree-item.depth-5 { padding-left: calc(1rem + 5 * 1.1rem); }
.tree-item.depth-6 { padding-left: calc(1rem + 6 * 1.1rem); }
.tree-item.depth-7 { padding-left: calc(1rem + 7 * 1.1rem); }
.tree-item.depth-8 { padding-left: calc(1rem + 8 * 1.1rem); }

.tree-item-toggle {
    width: 0.8rem;
    height: 0.8rem;
    margin-right: 0.3rem;
    cursor: pointer;
    flex-shrink: 0;
}

.tree-children {
    display: none;
}

.tree-children.expanded {
    display: block;
}

/* Content Area */
.content-area {
    margin-left: 250px;
    width: calc(100% - 250px);
    padding: 2rem;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
    font-size: 0.75rem;
    color: #c2c2c2;
}

.breadcrumb a {
    color: #c2c2c2;
    transition: color 0.2s;
}

.breadcrumb a:hover {
    color: #ff7e00;
}

.breadcrumb-separator {
    margin: 0 0.5rem;
    color: #555;
}

/* File Grid */
.files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.files-header h2 {
    font-size: 1.35rem;
    font-weight: 700;
}

.upload-btn {
    padding: 0.6rem 1.5rem;
    background-color: #ff7e00;
    color: #ffffff;
    border: none;
    border-radius: 0.2rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s;
}

.upload-btn:hover {
    background-color: #FFA44C;
}

.upload-progress-wrapper {
    margin-bottom: 1.5rem;
    background-color: #252525;
    border: 1px solid #333;
    border-radius: 0.3rem;
    padding: 0.9rem 1rem;
    display: none;
}

.upload-progress-wrapper.active {
    display: block;
}

.upload-progress-track {
    width: 100%;
    height: 0.55rem;
    background-color: #1a1a1a;
    border: 1px solid #333;
    border-radius: 0.3rem;
    overflow: hidden;
}

.upload-progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #ff7e00 0%, #ffb347 100%);
    transition: width 0.15s ease-out;
}

.upload-progress-label {
    margin-top: 0.5rem;
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #c2c2c2;
}

.upload-progress-status {
    color: #ffb347;
}

.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
}

.file-item, .folder-item {
    background-color: #252525;
    border: 1px solid #333;
    border-radius: 0.3rem;
    padding: 1.5rem 1rem;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
}

.file-item:hover, .folder-item:hover {
    background-color: #2a2a2a;
    border-color: #ff7e00;
}

.item-icon {
    width: 3rem;
    height: 3rem;
    margin: 0 auto 1rem;
    fill: #ff7e00;
}

.item-name {
    font-size: 0.75rem;
    word-break: break-word;
    margin-bottom: 0.5rem;
}

/* File thumbnail and audio preview styles */
.file-thumb {
    width: 3rem;
    height: 3rem;
    object-fit: cover;
    border-radius: 0.35rem;
    border: 1px solid #333;
}

audio { max-width: 9rem; }

.item-meta {
    font-size: 0.65rem;
    color: #c2c2c2;
}

.item-actions {
    margin-top: 1rem;
    display: flex;
    gap: 0.5rem;
    justify-content: center;
}

.action-btn {
    padding: 0.4rem 0.8rem;
    background-color: #333;
    color: #ffffff;
    border: none;
    border-radius: 0.2rem;
    font-size: 0.65rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.action-btn:hover {
    background-color: #444;
}

.action-btn.delete {
    background-color: #c23616;
}

.action-btn.delete:hover {
    background-color: #e84118;
}

/* Files List (new list-based layout) */
.files-list {
    background-color: #252525;
    border: 1px solid #333;
    border-radius: 0.3rem;
    overflow: hidden;
}
.files-list .list-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    background-color: #1f1f1f;
    border-bottom: 1px solid #333;
    font-size: 0.7rem;
    color: #c2c2c2;
}
.files-list .list-body {
    list-style: none;
    margin: 0;
    padding: 0;
}
.files-list .list-row {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border-bottom: 1px solid #262626;
}
.files-list .list-row:hover {
    background-color: #2a2a2a;
}
.files-list .list-row .item-icon {
    width: 1.4rem;
    height: 1.4rem;
    fill: #ff7e00;
}
.files-list .col-name { display: flex; align-items: center; gap: 0.6rem; flex: 1 1 auto; min-width: 0; }
.files-list .col-meta, .files-list .col-actions { font-size: 0.7rem; color: #c2c2c2; }
.files-list .col-meta { flex: 0 0 110px; text-align: left; }
.files-list .col-actions { flex: 0 0 160px; display: flex; gap: 0.5rem; align-items: center; justify-content: flex-end; }
.files-list .col-actions form { margin: 0; }
.files-list .folder-row .col-meta { color: #888; }
.files-list .folder-row .col-owner { color: #c2c2c2; }
.files-list .list-row .action-btn { font-size: 0.7rem; padding: 0.4rem 0.6rem; }

@media (max-width: 768px) {
    .files-list .list-header,
    .files-list .list-row {
        /* keep flex layout but adjust fixed column sizes */
    }
    .files-list .col-meta { flex: 0 0 90px; }
    .files-list .col-actions { flex: 0 0 120px; }
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #c2c2c2;
}

.empty-state svg {
    width: 4rem;
    height: 4rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 100;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background-color: #252525;
    padding: 2rem;
    border-radius: 0.5rem;
    width: 90%;
    max-width: 400px;
}

.modal-header {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
}

.modal-body {
    margin-bottom: 1.5rem;
}

.modal-body label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.75rem;
}

.modal-body input {
    width: 100%;
    padding: 0.6rem;
    background-color: #1a1a1a;
    border: 1px solid #333;
    color: #ffffff;
    border-radius: 0.2rem;
    font-size: 0.75rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

.modal-btn {
    padding: 0.6rem 1.5rem;
    border: none;
    border-radius: 0.2rem;
    font-size: 0.75rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
}

.modal-btn:hover {
    opacity: 0.8;
}

.modal-btn.primary {
    background-color: #ff7e00;
    color: #ffffff;
}

.modal-btn.secondary {
    background-color: #333;
    color: #ffffff;
}

/* Alerts */
.alert {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    padding: 1rem 1.5rem;
    border-radius: 0.3rem;
    font-size: 0.75rem;
    font-weight: 500;
    min-width: 300px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.alert-success {
    background-color: #27ae60;
    color: #ffffff;
}

.alert-error {
    background-color: #c23616;
    color: #ffffff;
}

.alert-warning {
    background-color: #f39c12;
    color: #ffffff;
}

.alert-info {
    background-color: #3498db;
    color: #ffffff;
}

.alert-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 0;
    line-height: 1;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        top: 0;
    }
    
    .content-area {
        margin-left: 0;
        width: 100%;
        padding: 1rem;
    }
    
    main {
        flex-direction: column;
    }
    
    .files-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

/* Upload modal drop-zone and per-file progress styles */
.drop-zone {
    border: 2px dashed #3a3a3a;
    background: linear-gradient(180deg, rgba(255,126,0,0.03), transparent);
    padding: 1rem;
    text-align: center;
    border-radius: 0.35rem;
    color: #cfcfcf;
    margin-bottom: 1rem;
}
.drop-zone p { margin: 0.35rem 0; }
.drop-zone.drag-over {
    border-color: #ff7e00;
    background: rgba(255,126,0,0.04);
}

.upload-file-list { list-style: none; margin: 0; padding: 0; }
.upload-file-row {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.5rem 0;
    border-bottom: 1px solid #1f1f1f;
}

/* Auth (login/register) - Voisona-like styling */
.auth-container {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}
.auth-card {
    width: 420px;
    background: linear-gradient(180deg, rgba(37,37,37,0.9), rgba(30,30,30,0.95));
    border: 1px solid #333;
    border-radius: 0.75rem;
    padding: 2.2rem;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}
.auth-card h2 {
    margin-bottom: 1.25rem;
    font-size: 1.25rem;
    color: #ffb86b;
    font-weight: 800;
}
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; margin-bottom: 0.35rem; color: #cfcfcf; font-size: 0.8rem; }
.form-control {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: #161616;
    border: 1px solid #2b2b2b;
    color: #fff;
    border-radius: 0.45rem;
    font-size: 0.95rem;
}
.form-control:focus { outline: none; border-color: #ff7e00; box-shadow: 0 0 0 3px rgba(255,126,0,0.06); }
.form-text { color: #9e9e9e; font-size: 0.75rem; margin-top: 0.35rem; }
.auth-footer { margin-top: 1rem; text-align: center; color: #bdbdbd; font-size: 0.85rem; }
.auth-footer a { color: #ffb86b; font-weight: 700; }

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.7rem 1rem;
    border-radius: 0.45rem;
    border: none;
    cursor: pointer;
    font-weight: 700;
    font-size: 0.9rem;
}
.btn-primary {
    background: linear-gradient(90deg,#ff7e00,#ffb347);
    color: #111;
    width: 100%;
}
.btn-primary:hover { opacity: 0.95; }
.btn-block { display: block; }

@media (max-width: 480px) {
    .auth-card { width: 100%; padding: 1.25rem; border-radius: 0.5rem; }
}
.upload-file-name { color: #ffffff; font-size: 0.85rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; }
.upload-file-track { background: #1a1a1a; border: 1px solid #2b2b2b; height: 0.6rem; border-radius: 0.3rem; overflow: hidden; flex: 0 0 160px; }
.upload-file-bar { height: 100%; width: 0%; background: linear-gradient(90deg,#ff7e00,#ffb347); transition: width 0.12s ease; }
.upload-file-status { font-size: 0.75rem; color: #c2c2c2; text-align: right; flex: 0 0 80px; }

/* Make sure the progress track doesn't overflow; allow the middle column to shrink */
.upload-file-row .upload-file-track { min-width: 0; }
.upload-file-row { width: 100%; box-sizing: border-box; }

@media (max-width: 768px) {
    .upload-file-track { flex: 0 0 120px; }
    .upload-file-status { flex: 0 0 70px; }
}
