@import url('https://fonts.googleapis.com/css2?family=Bitter:wght@400;500;600;700&display=swap');

*,
*::before,
*::after{
  box-sizing:border-box;
  margin:0;
  padding:0;
}

body{
  background:#0b1120;
  color:#fff;
  font-family:'Bitter','Georgia',serif;
  overflow-x:hidden;
}

/* APP */
.app{
  display:flex;
  min-height:100vh;
}

/* SIDEBAR */
.sidebar{
  width:260px;
  background:#111827;
  border-right:1px solid #1e293b;
  padding:20px;
  position:sticky;
  top:0;
  height:100vh;
  overflow-y:auto;
  flex-shrink:0;
}

.logo{
  font-size:28px;
  margin-bottom:24px;
  font-weight:700;
  color:#fff;
}

/* BUTTONS */
.new-folder-btn,
.folder-btn,
.upload-btn,
.copy-btn,
.delete-btn{
  border:none;
  outline:none;
  cursor:pointer;
  transition:0.2s ease;
  font-weight:600;
}

/* BLUE BUTTONS */
.new-folder-btn,
.upload-btn,
.copy-btn{
  background:#2563eb;
  color:#fff;
}

.new-folder-btn:hover,
.upload-btn:hover,
.copy-btn:hover{
  background:#3b82f6;
}

/* DELETE BUTTON */
.delete-btn{
  background:#b91c1c;
  color:#fff;
}

.delete-btn:hover{
  background:#dc2626;
}

/* FOLDER BUTTON */
.folder-btn{
  width:100%;
  background:#1e293b;
  color:#e2e8f0;
  padding:14px 16px;
  border-radius:14px;
  margin-bottom:12px;
  text-align:left;
  font-size:15px;
}

.folder-btn:hover{
  background:#334155;
}

.folder-btn.active{
  background:#2563eb;
  color:#fff;
}

/* NEW FOLDER */
.new-folder-btn{
  width:100%;
  padding:14px;
  border-radius:14px;
  font-size:15px;
  margin-bottom:20px;
}

/* MAIN */
.main{
  flex:1;
  display:flex;
  flex-direction:column;
  min-width:0;
}

/* TOPBAR */
.topbar{
  display:flex;
  align-items:center;
  gap:14px;
  padding:18px 20px;
  background:#0f172a;
  border-bottom:1px solid #1e293b;
  position:sticky;
  top:0;
  z-index:100;
  flex-wrap:wrap;
}

/* SEARCH */
.search{
  flex:1;
  min-width:180px;
  background:#1e293b;
  border:1px solid #334155;
  color:#fff;
  padding:15px 18px;
  border-radius:16px;
  font-size:15px;
}

.search::placeholder{
  color:#94a3b8;
}

.search:focus{
  border-color:#3b82f6;
}

/* UPLOAD BUTTON */
.upload-btn{
  padding:15px 22px;
  border-radius:16px;
  font-size:15px;
}

/* TITLE */
.title{
  padding:24px 24px 0;
  font-size:28px;
  font-weight:700;
}

/* GRID */
.grid{
  padding:24px;
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(240px,1fr));
  gap:20px;
}

/* CARD */
.card{
  background:#111827;
  border:1px solid #1e293b;
  border-radius:20px;
  overflow:hidden;
  transition:0.2s ease;
  position:relative;
}

.card:hover{
  transform:translateY(-4px);
  border-color:#334155;
}

/* IMAGE */
.image{
  width:100%;
  height:300px;
  object-fit:cover;
  display:block;
  background:#1e293b;
  cursor:pointer;
}

/* CARD CONTENT */
.card-content{
  padding:14px;
}

.filename{
  font-size:13px;
  color:#cbd5e1;
  line-height:1.6;
  word-break:break-word;
  margin-bottom:14px;
}

/* ACTION BUTTONS */
.actions{
  display:flex;
  gap:10px;

  /* HIDDEN BY DEFAULT */
  opacity:0;
  max-height:0;
  overflow:hidden;

  transition:
    opacity .25s ease,
    max-height .25s ease,
    margin-top .25s ease;
}

/* SHOW AFTER LONG PRESS */
.card.show-actions .actions{
  opacity:1;
  max-height:120px;
  margin-top:12px;
}

/* COPY + DELETE */
.copy-btn,
.delete-btn{
  flex:1;
  padding:12px;
  border-radius:12px;
  font-size:14px;
}

/* PREVIEW */
.preview{
  position:fixed;
  inset:0;
  background:#000000e8;
  display:flex;
  justify-content:center;
  align-items:center;
  z-index:999;
  padding:20px;
}

.preview img{
  max-width:100%;
  max-height:100%;
  border-radius:16px;
}

/* TOAST */
.toast{
  position:fixed;
  bottom:20px;
  left:50%;
  transform:translateX(-50%);
  background:#2563eb;
  color:#fff;
  padding:14px 18px;
  border-radius:14px;
  z-index:1000;
  font-size:14px;
}

/* MOBILE */
@media(max-width:768px){

  .app{
    flex-direction:column;
  }

  .sidebar{
    width:100%;
    height:auto;
    position:relative;
    border-right:none;
    border-bottom:1px solid #1e293b;
    padding:14px;
  }

  .logo{
    font-size:22px;
    margin-bottom:16px;
  }

  .folder-btn,
  .new-folder-btn{
    font-size:14px;
    padding:13px;
  }

  .topbar{
    padding:14px;
    gap:10px;
  }

  .search{
    width:100%;
    padding:14px;
    font-size:14px;
  }

  .upload-btn{
    width:100%;
    text-align:center;
    padding:14px;
    font-size:14px;
  }

  .title{
    font-size:22px;
    padding:18px 14px 0;
  }

  .grid{
    grid-template-columns:repeat(2,1fr);
    gap:14px;
    padding:14px;
  }

  .image{
    height:220px;
  }

  .actions{
    flex-direction:column;
  }
}

/* EXTRA SMALL DEVICES */
@media(max-width:480px){

  .grid{
    grid-template-columns:1fr;
  }

  .image{
    height:260px;
  }

  .title{
    font-size:20px;
  }
  }
