/* ============================================
   DOWNLOAD / MATERI — Material Styles
   ============================================ */

/* Stats bar */
.dl-stats-bar {
    display: inline-flex;
    align-items: center;
    gap: 28px;
    padding: 14px 28px;
    border-radius: 18px;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.05);
    position: relative;
    overflow: hidden;
  }
  .dl-stats-bar::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
  }
  .dl-stat-value {
    font-size: 14px; font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  .dl-stat-label {
    font-size: 10px;
    color: rgba(255,255,255,.3);
    margin-top: 2px;
  }
  .dl-stat-divider {
    width: 1px; height: 32px;
    background: rgba(255,255,255,.06);
  }
  
  /* Category heading */
  .dl-category {
    font-family: 'DM Sans', sans-serif;
    font-size: 20px; font-weight: 300;
    letter-spacing: -0.02em;
    display: flex; align-items: center; gap: 10px;
    margin-bottom: 24px;
  }
  
  /* Download card */
  .dl-card {
    background: rgba(23,23,23,.5);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255,255,255,.06);
    border-radius: 20px;
    padding: 22px;
    transition: all 400ms cubic-bezier(.4,0,.2,1);
    position: relative;
    overflow: hidden;
  }
  .dl-card::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,.08), transparent);
    pointer-events: none;
  }
  .dl-card:hover {
    border-color: rgba(16,185,129,.2);
    box-shadow: 0 0 0 1px rgba(16,185,129,.1), 0 12px 48px -8px rgba(16,185,129,.12);
    transform: translateY(-6px);
  }
  .dl-card-icon {
    width: 48px; height: 48px;
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    flex-shrink: 0;
    transition: transform 300ms;
  }
  .dl-card:hover .dl-card-icon { transform: scale(1.1) rotate(-3deg); }
  .dl-card-meta {
    display: flex; align-items: center; gap: 14px;
    font-size: 11px;
    color: rgba(255,255,255,.25);
    margin-bottom: 16px;
  }
  .dl-card-meta span {
    display: flex; align-items: center; gap: 4px;
  }
  
  /* Download button */
  .dl-btn {
    position: relative;
    overflow: hidden;
    width: 100%;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 11px;
    border-radius: 14px;
    font-size: 12px; font-weight: 500;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,.08);
    background: rgba(255,255,255,.03);
    color: rgba(255,255,255,.5);
    transition: all 250ms cubic-bezier(.4,0,.2,1);
  }
  .dl-btn:hover {
    background: #fff; color: #000;
    border-color: #fff;
    box-shadow: 0 0 20px rgba(255,255,255,.1);
  }
  .dl-btn .dl-progress {
    position: absolute;
    bottom: 0; left: 0;
    width: 100%; height: 0;
    border-radius: 0 0 14px 14px;
    transition: height 300ms ease;
  }
  .dl-btn.downloading { pointer-events: none; }
  .dl-btn.downloading .dl-progress { height: 3px; }
  
  /* Delete button on download cards */
  .dl-delete-btn {
    position: absolute;
    top: 14px; right: 14px;
    width: 26px; height: 26px;
    border-radius: 8px;
    background: rgba(239,68,68,.06);
    border: 1px solid rgba(239,68,68,.1);
    color: rgba(239,68,68,.4);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: 0; transform: scale(.8);
    transition: all 200ms;
    z-index: 5;
  }
  .dl-card:hover .dl-delete-btn { opacity: 1; transform: scale(1); }
  .dl-delete-btn:hover {
    background: rgba(239,68,68,.2);
    border-color: rgba(239,68,68,.4);
    color: #f87171;
  }
  
  /* FAB add button */
  .fab-add {
    position: fixed;
    bottom: 32px; right: 32px;
    width: 56px; height: 56px;
    border-radius: 18px;
    background: linear-gradient(135deg, #10b981, #059669);
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; z-index: 50;
    border: none; outline: none;
    box-shadow: 0 0 0 1px rgba(16,185,129,.3), 0 8px 24px rgba(16,185,129,.25), 0 0 60px rgba(16,185,129,.1);
    transition: all 300ms cubic-bezier(.4,0,.2,1);
  }
  .fab-add:hover {
    transform: scale(1.08) rotate(90deg);
    box-shadow: 0 0 0 1px rgba(16,185,129,.5), 0 12px 32px rgba(16,185,129,.35);
  }
  .fab-add:active { transform: scale(.95) rotate(90deg); }
  
  /* Modal for adding materi */
  .modal-overlay {
    position: fixed; inset: 0; z-index: 200;
    background: rgba(0,0,0,.8);
    backdrop-filter: blur(12px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
    opacity: 0; pointer-events: none;
    transition: opacity 300ms;
  }
  .modal-overlay.open { opacity: 1; pointer-events: auto; }
  .modal-box {
    background: rgba(15,15,15,.95);
    backdrop-filter: blur(24px);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 24px;
    padding: 32px;
    width: 100%; max-width: 480px;
    transform: scale(.9) translateY(20px);
    transition: transform 400ms cubic-bezier(.34,1.56,.64,1);
    position: relative; overflow: hidden;
  }
  .modal-overlay.open .modal-box { transform: scale(1) translateY(0); }
  .modal-box::before {
    content: '';
    position: absolute; top: 0; left: 0; right: 0; height: 1px;
    background: linear-gradient(90deg, transparent, rgba(16,185,129,.3), transparent);
  }
  .modal-input {
    width: 100%;
    background: rgba(255,255,255,.03);
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 11px 14px;
    color: #fff; font-size: 13px;
    outline: none;
    transition: all 300ms;
    margin-bottom: 16px;
  }
  .modal-input::placeholder { color: rgba(255,255,255,.15); }
  .modal-input:focus {
    border-color: rgba(16,185,129,.4);
    box-shadow: 0 0 0 3px rgba(16,185,129,.08);
  }
  .modal-select {
    width: 100%;
    appearance: none;
    background: rgba(255,255,255,.03) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.3)' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center;
    border: 1px solid rgba(255,255,255,.08);
    border-radius: 12px;
    padding: 11px 14px;
    color: rgba(255,255,255,.5);
    font-size: 13px;
    outline: none;
    transition: all 300ms;
    margin-bottom: 16px;
    cursor: pointer;
  }
  .modal-select option { background: #1a1a1a; color: #fff; }
  .modal-select:focus {
    border-color: rgba(16,185,129,.4);
    box-shadow: 0 0 0 3px rgba(16,185,129,.08);
  }
  .modal-label {
    display: block;
    font-size: 11px; font-weight: 500;
    color: rgba(255,255,255,.4);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: .05em;
  }
  .modal-actions { display: flex; gap: 10px; margin-top: 24px; }
  .modal-btn {
    flex: 1; padding: 12px; border-radius: 14px;
    font-size: 13px; font-weight: 500;
    cursor: pointer; transition: all 200ms;
    border: none; outline: none;
  }
  .modal-btn-cancel {
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.5);
  }
  .modal-btn-cancel:hover { background: rgba(255,255,255,.08); }
  .modal-btn-submit {
    background: #10b981; color: #000; font-weight: 600;
  }
  .modal-btn-submit:hover {
    background: #34d399;
    box-shadow: 0 0 20px rgba(16,185,129,.3);
  }
  
  /* Confirm delete popup */
  .confirm-popup {
    position: absolute;
    top: 44px; right: 14px;
    background: rgba(15,15,15,.95);
    backdrop-filter: blur(16px);
    border: 1px solid rgba(239,68,68,.2);
    border-radius: 14px;
    padding: 14px 16px;
    z-index: 10;
    min-width: 180px;
    opacity: 0; pointer-events: none;
    transform: translateY(-4px);
    transition: all 200ms;
    box-shadow: 0 12px 32px rgba(0,0,0,.4);
  }
  .confirm-popup.show { opacity: 1; pointer-events: auto; transform: translateY(0); }
  .confirm-popup p { font-size: 11px; color: rgba(255,255,255,.6); margin-bottom: 10px; }
  .confirm-actions { display: flex; gap: 6px; }
  .confirm-yes {
    flex: 1; padding: 7px; border-radius: 8px;
    font-size: 11px; font-weight: 500;
    background: rgba(239,68,68,.15);
    border: 1px solid rgba(239,68,68,.3);
    color: #f87171; cursor: pointer; transition: all 200ms;
  }
  .confirm-yes:hover { background: #ef4444; color: #fff; }
  .confirm-no {
    flex: 1; padding: 7px; border-radius: 8px;
    font-size: 11px; font-weight: 500;
    background: rgba(255,255,255,.05);
    border: 1px solid rgba(255,255,255,.08);
    color: rgba(255,255,255,.5); cursor: pointer; transition: all 200ms;
  }
  .confirm-no:hover { background: rgba(255,255,255,.08); }
  
  /* Card animations */
  .card-removing {
    animation: cardRemove 400ms cubic-bezier(.4,0,.2,1) forwards;
  }
  @keyframes cardRemove {
    to { opacity: 0; transform: scale(.9) translateY(-10px); height: 0; padding: 0; margin: 0; overflow: hidden; }
  }
  .card-adding {
    animation: cardAdd 500ms cubic-bezier(.34,1.56,.64,1) forwards;
  }
  @keyframes cardAdd {
    from { opacity: 0; transform: scale(.8) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
  }