/* Import Google Font */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;600;700&display=swap');

/* RESET */
* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Outfit', sans-serif; }

body {
    background: #0f0c29; 
    /* Simpler Dark Background (No Pink/Blue corners) */
    background: linear-gradient(135deg, #0f0c29, #1a163a); 
    min-height: 100vh;
    display: flex;
    justify-content: center;
    color: white;
    overflow-x: hidden;
    padding-bottom: 50px;
}

/* CONTAINER */
.container {
    width: 90%;
    max-width: 1200px;
    margin: 40px auto;
    position: relative;
    z-index: 1;
}

/* --- HEADER --- */
.glass-header {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 24px;
    padding: 50px 20px;
    text-align: center;
    margin-bottom: 50px;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    
    /* FIX: Force Header to be ABOVE the grid */
    position: relative;
    z-index: 1000; 
}

.glass-header h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -1px;
    text-shadow: 0 0 20px rgba(0, 242, 255, 0.3);
}
.glass-header h1 span {
    background: linear-gradient(to right, #00f2ff, #00c3ff);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.glass-header p {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 30px;
}

/* --- CONTROLS LAYOUT --- */
.controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center;
    max-width: 1000px;
    margin: 0 auto;
    align-items: flex-start;
}

/* SEARCH BOX */
.search-box {
    flex: 2;
    min-width: 250px;
    position: relative;
}
.search-box input {
    width: 100%;
    height: 55px;
    padding: 0 50px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
}
.search-box input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: #00f2ff;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}
.search-box i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
}

/* --- SHARED STYLES (Sort Dropdown & Tag Button) --- */
.glass-select, .select-btn {
    flex: 1;
    min-width: 200px;
    height: 55px;
    padding: 0 20px;
    border-radius: 50px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    background: rgba(0, 0, 0, 0.2);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.glass-select:focus, .select-btn:hover {
    background: rgba(0, 0, 0, 0.4);
    border-color: #00f2ff;
    box-shadow: 0 0 15px rgba(0, 242, 255, 0.3);
}

/* Remove default appearance for Sort Select */
.glass-select {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%2300f2ff%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
    background-repeat: no-repeat;
    background-position: right 20px top 50%;
    background-size: 12px auto;
}
.glass-select option { background: #1f1c2c; color: white; }

/* --- MULTI-SELECT DROPDOWN LIST --- */
.multi-select {
    position: relative;
    flex: 1;
    min-width: 200px;
}

.list-items {
    position: absolute;
    top: 65px;
    width: 100%;
    background: rgba(15, 12, 41, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: none;
    
    /* FIX: Ensure Dropdown floats ABOVE everything */
    z-index: 9999; 
    
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
    max-height: 300px;
    overflow-y: auto;
}
.list-items.open { display: block; animation: fadeIn 0.3s ease; }

/* Checkbox Items */
.item {
    display: flex;
    align-items: center;
    height: 40px;
    cursor: pointer;
    transition: 0.2s;
    padding: 0 10px;
    border-radius: 10px;
}
.item:hover { background: rgba(255, 255, 255, 0.1); }
.item-text { font-size: 0.9rem; color: #ddd; margin-left: 10px; }

/* Custom Checkbox */
.checkbox {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 16px;
    width: 16px;
    border-radius: 4px;
    border: 1.5px solid rgba(255, 255, 255, 0.5);
    transition: 0.2s;
}
.item input { display: none; }
.item input:checked + .checkbox {
    background-color: #00f2ff;
    border-color: #00f2ff;
    box-shadow: 0 0 8px rgba(0, 242, 255, 0.5);
}
.item input:checked + .checkbox::after {
    content: '\f00c';
    font-family: "Font Awesome 5 Free";
    font-weight: 900;
    color: #1f1c2c;
    font-size: 10px;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* --- GRID LAYOUT --- */
.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 25px;
    margin-top: 40px;
    
    /* FIX: Lower priority than Header */
    position: relative;
    z-index: 1; 
}

/* --- CARDS --- */
.glass-card {
    background: rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-top: 1px solid rgba(255, 255, 255, 0.15); /* Top highlight */
    border-radius: 20px;
    padding: 30px;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    display: flex;
    flex-direction: column;
}

.glass-card:hover {
    transform: translateY(-8px) scale(1.02);
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4), 
                0 0 20px rgba(0, 242, 255, 0.1); /* Subtle glow */
}

.glass-card h3 {
    font-size: 1.5rem;
    margin: 15px 0 10px;
    font-weight: 600;
}
.glass-card p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1; /* Pushes buttons to bottom */
}

/* BADGES */
.badge {
    position: absolute;
    top: 20px; right: 20px;
    font-size: 0.75rem;
    padding: 6px 12px;
    border-radius: 30px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
.badge.beginner { background: rgba(0, 255, 136, 0.15); color: #00ff88; border: 1px solid rgba(0, 255, 136, 0.3); }
.badge.intermediate { background: rgba(255, 183, 0, 0.15); color: #ffb700; border: 1px solid rgba(255, 183, 0, 0.3); }
.badge.advanced { background: rgba(255, 0, 85, 0.15); color: #ff0055; border: 1px solid rgba(255, 0, 85, 0.3); }

/* TAGS */
.tags span {
    display: inline-block;
    background: rgba(255, 255, 255, 0.05);
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    margin-right: 8px;
    margin-bottom: 8px;
    color: rgba(255, 255, 255, 0.8);
    transition: 0.3s;
}
.glass-card:hover .tags span {
    background: rgba(255, 255, 255, 0.15);
}

/* BUTTONS */
.actions {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}
.btn-view, .btn-copy {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    text-align: center;
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: 0.3s;
    cursor: pointer;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* View Button: White Gradient */
.btn-view {
    background: white;
    color: #1a1a1a;
}
.btn-view:hover {
    background: #00f2ff;
    box-shadow: 0 0 15px #00f2ff;
}

/* Clone Button: Glass */
.btn-copy {
    background: rgba(255, 255, 255, 0.1);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.1);
}
.btn-copy:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: white;
}