:root{
      --bg: #070447;
      --card: #0f1c5a;
      --muted: #a5acc7;
      --text: #e6e9f5;
      --accent: #338cc0;
      --accent-2:#20e3b2;
      --danger:#ff6b6b;
      --shadow: rgba(0,0,0,.25);
      --ring: 0 0 0 4px rgba(40, 126, 163, 0.274);
      --radius: 18px;
    }
    *{
      box-sizing: border-box;
    }
    body{
      margin:0;
      font-family: Poppins, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji","Segoe UI Emoji";
      color: var(--text);
      background:radial-gradient(1000px 600px at 110% -10%, rgba(23, 76, 174, 0.25), transparent 60%),radial-gradient(1000px 600px at -10% 110%, rgba(10, 158, 136, 0.15), transparent 60%),var(--bg);
      min-height:100dvh;
    }
    ::-webkit-scrollbar {
    display: none;
}   
    .container{
      max-width:1200px;
      margin:0 auto;
      padding:24px;
    }
    header{
      position: sticky; 
      top:0; 
      z-index: 10;
      backdrop-filter: blur(10px);
      background: linear-gradient(180deg, rgba(15,18,32,.9), rgba(15,18,32,.6) 70%, transparent);
  
    }
    .head-wrap{
      display:flex;
      gap:18px;
      align-items:center;
      justify-content:space-between;
      padding:14px 0;
    }
    .brand{
      display:flex;
      align-items:center;
      gap:14px;
      text-decoration:none;
      color:inherit;
    }
    .logo{
      width:70px;
      height:60px;
      border-radius:12px;
     margin-left: 25px;
    }
    .title{
      font-family:"Playfair Display", serif;
      font-weight:700;
      font-size:1.6rem;
      letter-spacing:.3px;
    }
    .subtitle{
      font-size:.85rem;
      color:var(--muted);
    }

    .controls{
      display:flex;
      gap:12px;
      flex-wrap:wrap;
      justify-content: center;
    }
    .search{
      position:relative;
    }
    .search .icon{
      position:absolute;
      left:14px;
      top:50%;
      transform:translateY(-50%);
      pointer-events:none;
      color:var(--muted);
      font-size:15px;
    }
    .search input{
      background:rgba(13, 64, 146, 0.296);
      border:1px solid rgba(14, 114, 139, 0.2);
      border-radius:999px;
      padding:10px 16px 10px 40px;
      color:var(--text);
      width:255px;
      transition:border .3s, box-shadow .3s;
      outline:none;
    }
    .search input:focus{
      border-color:var(--accent);
      box-shadow:var(--ring);
    }
    .search input::placeholder{
      color:var(--muted);
    }

    .btn{
      padding:10px 14px;
      border-radius:999px;
      border: none;
      background:linear-gradient(180deg, rgba(255,255,255,.08), rgba(255,255,255,.04));
      color:var(--text);
      cursor:pointer;
      display:inline-flex;
      gap:8px;
      align-items:center;
      transition: transform .05s ease, background .2s, border-color .2s;
      user-select:none;
    } .btn:hover{
      transform:translateY(-2px);
    }
    .btn.btn-ghost{
      background:transparent;
      color:var(--text);
    }
        .btn.btn-ghost:hover{
      background:rgba(13, 64, 146, 0.296);
    }
    .btn.pill{
      border-radius:999px;
      display:flex;
      align-items:center;
      gap:6px;
    }
    .btn .icon{
      font-size:18px;
    }
    .btn .text{
      display:none;
        font-size: 15px;

    }
    @media(min-width:640px){
      .btn .text{
        display:inline;
        font-size: 15px;
      }
    }
    .filters{
      display:flex;
      width: 45.1rem;
      flex-wrap:wrap;
      gap:8px;
      background:var(--card);
      padding:6px;
      border-radius:999px;
      box-shadow:0 0 0 1px rgba(255,255,255,.1);
    }
    .filters button{
      border:none;
      background:transparent;
      color:var(--muted);
      padding:8px 18px;
      border-radius:999px;
      cursor:pointer;
      font-weight:600;
      transition:background .3s, color .3s;
    }
   .filters button[data-active="true"]{
      background:var(--accent);
      color:var(--text);
    }.filters{
      display:flex;
      flex-wrap:wrap;
      gap:8px;
      background:var(--card);
      padding:6px;
      border-radius:999px;
      box-shadow:0 0 0 1px rgba(255,255,255,.1);
    }
    .filters button{
      border:none;
      background:transparent;
      color:var(--muted);
      padding:8px 18px;
      border-radius:999px;
      cursor:pointer;
      font-weight:600;
      transition:background .3s, color .3s;
    }
    .filters button[aria-selected="true"]{
      background:var(--accent);
      color:var(--text);
    }

    main{
      padding:16px 0 40px;
    }
    .grid{
      display:grid;
      grid-template-columns: repeat(12, 1fr);
      gap:16px;
    }
    @media (max-width:1100px){
      .grid{
        grid-template-columns: repeat(8,1fr);
      }}
    @media (max-width:720px){
      .grid{
        grid-template-columns: repeat(4,1fr);
      }}

    .card{
      grid-column: span 3;
      background: linear-gradient(180deg, rgba(24, 70, 125, 0.06), rgba(16, 139, 166, 0.347));
      border-radius: var(--radius);
      overflow:hidden;
      box-shadow: 0 10px 30px -18px var(--shadow);
      display:flex;
      flex-direction:column;
      transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
    }
    .card:hover{
      transform: translateY(-4px); 
      box-shadow: 0 20px 40px -18px rgba(0,0,0,.45);
       border-color: rgba(255,255,255,.16);
      }
    .card .media{
      position: relative; 
      aspect-ratio: 16/11;
       overflow:hidden;
      background: radial-gradient(120% 120% at 20% 10%, rgba(124,92,255,.18), transparent),
                  radial-gradient(120% 120% at 80% 90%, rgba(32,227,178,.12), transparent);
    }
    .card img{
      width:100%;
      height:100%;
      object-fit:cover; /* Ensure proper aspect ratio */
      display:block;
      border-radius:4px;
      filter:saturate(1.05) contrast(1.05);
    }
    .badge{
      position:absolute;
      z-index:1;
      left:10px;
      top:10px;
      font-size:.75rem;
      padding:6px 10px;
      border-radius:999px;
      background: rgba(0,0,0,.45);
      backdrop-filter: blur(6px); 
      border:1px solid rgba(255,255,255,.15);
    }
    .fav{
      position:absolute;
      z-index: 1;
      right:10px;
      top:10px;
      font-size:20px;
      line-height:1;
      width:36px;
      height:36px;
      border-radius:999px;
      display:grid;
      place-items:center;
      cursor:pointer;
      border:1px solid rgba(255,255,255,.15);
      background: rgba(0,0,0,.4)
    }
    .fav[data-on="true"]{
      background: rgba(255,107,107,.15);
       border-color: rgba(255,107,107,.5);
      }
    .content{
      padding:14px 14px 16px;
      min-height: 227px;
      display:flex;
      flex-direction:column;
      gap:10px;
    }
    .name{
      font-weight:700;
      font-size:1.05rem;
    }
    .desc{
      font-size:.9rem;
      color:var(--muted);
      line-height:1.45;
    }
    .tags{
      display:flex; 
      gap:6px;
      flex-wrap:wrap;
    }
    .tag{
      font-size:.72rem;
      padding:5px 8px;
      border-radius:999px;
      background:rgba(255,255,255,.06);
      border:1px solid rgba(255,255,255,.08);
      color:#cdd3ee;
    }
    .tag.more{
      background: transparent;
      border: 1px dashed rgba(255,255,255,.25);
      font-style: italic;
      color: var(--muted);
    }
    .actions{
      display:flex;
      gap:8px;
      justify-content: center;
      /* min-height: 100px; */
      align-items: flex-end;
    }
    .btn-primary{
      background: linear-gradient(135deg, #6789d8, #2a54b9);
      border: none;
    }
    .btn-outline{
      background: transparent;
      border:1px solid rgba(255,255,255,.18);
    }

    .empty{
      text-align:center;
      color:var(--muted);
      padding:40px 10px;
    }

    /* Modal */
    dialog{
      width:min(860px, 96vw);
      max-height:95dvh;
      border:none; 
      border-radius: 22px;
       padding:0; 
       overflow:hidden;
      background: linear-gradient(180deg, rgba(22,26,46,.98), rgba(22,26,46,.94));
      color:var(--text);
      box-shadow: 0 40px 120px -30px rgba(0,0,0,.7);
    }
    dialog::backdrop{
      background: rgba(0,0,0,.55);
       backdrop-filter: blur(2px)}
    .modal-head{
      display:flex;
      align-items:center;
      justify-content:space-between;
      padding:18px 20px;
      border-bottom:1px solid rgba(255,255,255,.08);
    }
    .modal-title{
      font-family:"Playfair Display", serif;
      font-weight:700;
      font-size:1.5rem;
    }
    .modal-body{
      display:grid;
      grid-template-columns: 1fr 1fr;
       gap:0; 
       max-height:80vh; /* Responsive max height */
    }
    .modal-media{
      position:relative;
      max-height:80vh; /* Ensures image doesn't overflow */
    }
    .modal-media img{
      width:100%;
      height:100%;
      max-height:80vh;
      object-fit:cover; /* Ensure modal image keeps aspect ratio */
      border-radius:8px;
      display:block;
    }
    .modal-info{
      padding:18px 20px;
      display:flex;
      flex-direction:column;
      gap:12px;
      overflow-y:auto; /* Allow scrolling if content too tall */
    }
    .meta{
      display:flex;
      gap:8px;
      flex-wrap:wrap;
    }
    .meta .tag{
      background:rgba(124,92,255,.15);
      border-color:rgba(124,92,255,.35);
    }
    .list{
      margin:0 0 8px 18px; 
      line-height:1.55;
    }
    .close{
      cursor:pointer;
      border:none;
      background:transparent;
      color:var(--muted);font-size:22px;
    }
    .foot{
      display:flex;
      justify-content:flex-end;
      gap:8px;
      padding:14px 20px;
      border-top:1px solid rgba(255,255,255,.08);
    }
    @media (max-width:820px){ 
      .modal-body{
        grid-template-columns: 1fr;
        max-height:none;
      } 
      .modal-media{
        aspect-ratio:16/10; 
        max-height:50vh;
      }}

    /* Helpers */
    .sr{
      position:absolute;
      width:1px;
      height:1px;
      margin:-1px;
      border:0;
      padding:0;
      clip:rect(0 0 0 0);
      overflow:hidden}
