/* RESET */
*{
    box-sizing:border-box;
    margin:0;
    padding:0;
}

body{
    font-family:'Segoe UI',sans-serif;
    background:#eef1f7;
}

/* =====================
   DASHBOARD
===================== */

/* CONTAINER */
.container{
    max-width:900px;
    margin:40px auto;
    background:#fff;
    padding:25px;
    border-radius:16px;
    box-shadow:0 12px 35px rgba(0,0,0,.12);
}

/* TOP BAR */
.top-bar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-bottom:20px;
}

.user-info{
    font-size:14px;
    color:#555;
}

.title{
    font-size:22px;
    font-weight:700;
}

/* STORAGE */
.storage{
    margin-bottom:20px;
    font-size:14px;
}

.bar{
    margin-top:6px;
    background:#e5e7eb;
    border-radius:20px;
    overflow:hidden;
    height:22px;
}

.fill{
    background:#4f46e5;
    height:100%;
    color:#fff;
    font-size:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:600;
}

/* UPLOAD */
.upload{
    display:flex;
    gap:12px;
    margin-bottom:25px;
}

.upload input{
    flex:1;
    padding:10px;
}

.upload button{
    background:#4f46e5;
    color:#fff;
    border:none;
    padding:14px 26px;
    border-radius:12px;
    font-size:17px;
    font-weight:600;
    cursor:pointer;
    min-width:140px;
}

.upload button:hover{
    opacity:.9;
    transform:scale(1.03);
}

/* GRID FILES */
.grid{
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(180px,1fr));
    gap:20px;
    margin-top:20px;
}

/* CARD */
.card{
    background:#fff;
    border:1px solid #e5e7eb;
    border-radius:16px;
    padding:12px;
    text-align:center;
    box-shadow:0 6px 18px rgba(0,0,0,.08);
}

/* PREVIEW (FINAL) */
.preview-box{
    width:100%;
    height:140px;
    border:2px dashed #d1d5db;
    border-radius:12px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    margin-bottom:10px;
    background:#f5f5f5;
}

.preview-box img{
    max-width:100%;
    max-height:100%;
    object-fit:contain;
    cursor:pointer;
    transition:.2s;
}

.preview-box img:hover{
    transform:scale(1.05);
}

.file-icon{
    font-size:52px;
    color:#777;
}

/* FILE NAME */
.filename{
    font-size:13px;
    margin-bottom:10px;
    word-break:break-all;
}

/* ACTIONS */
.actions{
    display:flex;
    justify-content:center;
    gap:10px;
    flex-wrap:wrap;
}

.actions .btn{
    padding:12px 16px;
    font-size:20px;
    border-radius:12px;
    text-decoration:none;
    color:#fff;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    min-width:48px;
    min-height:48px;
}

.download{ background:#22c55e; }
.rename{ background:#3b82f6; }
.delete{ background:#ef4444; }

.actions .btn:hover{
    transform:scale(1.1);
    opacity:.9;
}

/* LOGOUT */
.logout{
    display:block;
    text-align:center;
    margin-top:30px;
    color:#444;
    text-decoration:none;
    font-weight:600;
}

/* FULLSCREEN PREVIEW */
#preview{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.85);
    justify-content:center;
    align-items:center;
    z-index:999;
}

#preview img{
    max-width:90%;
    max-height:90%;
    border-radius:16px;
}

/* RESPONSIVE */
@media(max-width:600px){
    .top-bar{
        flex-direction:column;
        gap:8px;
        align-items:flex-start;
    }

    .preview-box{
        height:120px;
    }
}

/* =====================
   LOGIN PAGE
===================== */

.login-page{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    background:#eef1f7;
}

.login-box{
    width:320px;
    background:#fff;
    padding:26px 22px;
    border-radius:16px;
    border:1px solid #e5e7eb;
    box-shadow:0 10px 30px rgba(0,0,0,.12);
    text-align:center;
}

.login-logo{
    width:52px;
    margin-bottom:10px;
}

.login-box h1{
    font-size:19px;
    font-weight:600;
    margin-bottom:16px;
    color:#111827;
}

.login-box form{
    display:flex;
    flex-direction:column;
    align-items:center;
}

.login-box input{
    width:100%;
    padding:11px 14px;
    margin-bottom:11px;
    border-radius:12px;
    border:1px solid #d1d5db;
    font-size:14px;
    text-align:center;
}

.login-box input:focus{
    outline:none;
    border-color:#4f46e5;
}

.login-box button{
    width:100%;
    margin-top:4px;
    background:#4f46e5;
    color:#fff;
    border:none;
    padding:11px;
    border-radius:14px;
    font-size:15px;
    font-weight:600;
    cursor:pointer;
}

.login-box button:hover{
    opacity:.9;
}

.login-error{
    background:#fee2e2;
    color:#b91c1c;
    padding:8px;
    border-radius:10px;
    margin-bottom:12px;
    font-size:13px;
}
