@import url('https://fonts.googleapis.com/css2?family=Bangers&family=Russo+One&family=Teko:wght@300;400;500;700&display=swap');

:root {
    --bg-dark: #0a0a0a;
    --text-main: #ffffff;
    --accent-red: #ff2e63;
    --accent-blue: #08d9d6;
    --accent-yellow: #f9ed69;
    --glass: rgba(20, 20, 20, 0.95);
    --glass-light: rgba(255, 255, 255, 0.05);
    --border-color: #333;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Teko', sans-serif;
    font-size: 1.2rem;
    overflow-x: hidden;
    line-height: 1.4;
    width: 100%;
}

/* --- ANIMATED BACKGROUND --- */
.bg-animation {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: -1;
    background: 
        radial-gradient(circle at 15% 50%, rgba(8, 217, 214, 0.08), transparent 25%), 
        radial-gradient(circle at 85% 30%, rgba(255, 46, 99, 0.08), transparent 25%);
    animation: pulseBg 10s infinite alternate;
}

.bg-grid {
    position: fixed;
    width: 200%; height: 200%;
    background-image: linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 40px 40px;
    transform: rotateX(45deg) translateY(-10%);
    animation: moveGrid 20s linear infinite;
    z-index: -2;
    pointer-events: none;
}

/* --- TYPOGRAPHY --- */
h1, h2, h3, .brand { 
    font-family: 'Russo One', sans-serif; 
    text-transform: uppercase; 
    letter-spacing: 1px;
}

/* --- HEADER & NAV --- */
nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 5%;
    background: rgba(0,0,0,0.95);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}
.logo { font-size: 1.8rem; color: #fff; text-decoration: none; }
.logo span { color: var(--accent-red); }

/* --- HERO SECTION --- */
.hero {
    min-height: 50vh;
    padding: 4rem 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.hero h1 {
    font-size: clamp(3rem, 10vw, 6rem); 
    line-height: 0.9;
    margin-bottom: 1rem;
    font-family: 'Bangers', cursive;
    text-shadow: 3px 3px 0px var(--accent-red);
    transform: skew(-3deg);
    line-height: 60%;
}

.hero p {
    font-size: clamp(0.9rem, 2vw, 1.2rem);
    letter-spacing: 3px;
    opacity: 0.8;
}

/* --- FILTERS --- */
.filter-bar {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 2rem 0;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.filter-btn {
    background: transparent;
    border: 2px solid var(--border-color);
    color: #fff;
    padding: 0.6rem 1.5rem;
    font-family: 'Russo One';
    font-size: 1rem;
    cursor: pointer;
    flex-grow: 1;
    max-width: 200px;
    transition: 0.3s;
    text-decoration: none;
    text-align: center;
    display: inline-block;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--text-main);
    color: #000;
    border-color: #fff;
}

/* --- CARD GRID --- */
.container { 
    max-width: 1400px; 
    margin: 0 auto; 
    padding: 0 1.5rem 5rem; 
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
}

/* --- CARD STYLES --- */
.card {
    background: var(--glass);
    border: 1px solid var(--border-color);
    position: relative;
    transition: 0.3s ease;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-img {
    width: 100%;
    aspect-ratio: 3/4; 
    position: relative;
    overflow: hidden;
    background: #111;
}

.card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: 0.5s;
}

/* Holographic sheen */
.card-img::after {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 50%; height: 100%;
    background: linear-gradient(to right, transparent, rgba(255,255,255,0.4), transparent);
    transform: skewX(-25deg);
    transition: 0.5s;
    pointer-events: none;
}

.card:hover .card-img::after { left: 150%; transition: 0.7s; }
.card:hover img { transform: scale(1.1); }
.card:hover { border-color: var(--accent-blue); transform: translateY(-5px); box-shadow: 0 0 15px rgba(8, 217, 214, 0.3); }

.card-content {
    padding: 1rem;
    background: linear-gradient(to top, #000, rgba(0,0,0,0.5));
    position: absolute;
    bottom: 0;
    width: 100%;
}
.card-title { font-size: 1.3rem; margin-bottom: 0.2rem; }
.card-price { font-size: 1.5rem; color: var(--accent-yellow); font-weight: bold; }

/* --- PRODUCT DETAIL PAGE (RESPONSIVE) --- */
.detail-wrapper {
    display: flex;
    flex-direction: row;
    gap: 3rem;
    margin-top: 3rem;
    align-items: flex-start;
}

.detail-img-box {
    flex: 1;
    max-width: 500px;
    width: 100%;
    border: 2px solid var(--border-color);
    padding: 10px;
    background: var(--glass-light);
    animation: floatCard 6s ease-in-out infinite;
}
.detail-img-box img { width: 100%; display: block; border-radius: 4px; }

.detail-info {
    flex: 1.5;
    width: 100%;
}

.detail-cat {
    background: var(--accent-red); 
    padding: 5px 10px; 
    color: white; 
    font-family: 'Russo One';
    display: inline-block;
    margin-bottom: 1rem;
    transform: skew(-10deg);
}

.detail-title { 
    font-size: clamp(2.5rem, 5vw, 4rem); 
    line-height: 1; 
    margin-bottom: 0.5rem; 
    font-family: 'Bangers'; 
}

.detail-price {
    font-size: 2rem; 
    color: var(--accent-blue); 
    font-weight: bold;
}

.detail-desc {
    color: #ccc; 
    line-height: 1.6; 
    margin-bottom: 2rem;
    border-left: 3px solid var(--accent-red);
    padding-left: 1rem;
}

.buy-btn-lg {
    display: block;
    width: 100%;
    text-align: center;
    background: #fff;
    color: #000;
    padding: 1rem;
    font-family: 'Russo One';
    font-size: 1.5rem;
    text-decoration: none;
    margin-top: 2rem;
    transition: 0.3s;
    text-transform: uppercase;
    clip-path: polygon(5% 0, 100% 0, 100% 70%, 95% 100%, 0 100%, 0 30%);
}
.buy-btn-lg:hover { 
    background: var(--accent-red); 
    color: white; 
    box-shadow: 0 0 20px rgba(255, 46, 99, 0.4);
}

/* --- ADMIN PANEL UI (CYBER COMMAND) --- */
.admin-wrapper {
    max-width: 1200px;
    margin: 4rem auto;
    padding: 0 1rem;
}

.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid #333;
    padding-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.admin-card {
    background: rgba(10, 10, 10, 0.95);
    border: 1px solid #333;
    padding: 2rem;
    border-radius: 8px;
    box-shadow: 0 0 20px rgba(0,0,0,0.5);
    margin-bottom: 3rem;
}

.admin-title { font-family: 'Bangers'; font-size: 2.5rem; color: var(--accent-blue); letter-spacing: 1px; }

/* Admin Forms */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}
.full-width { grid-column: span 2; }

.form-group label {
    display: block;
    color: #888;
    margin-bottom: 0.5rem;
    font-family: 'Russo One';
    font-size: 0.9rem;
}

.form-control {
    width: 100%;
    padding: 1rem;
    background: #000;
    border: 1px solid #333;
    color: #fff;
    font-family: 'Teko';
    font-size: 1.2rem;
    outline: none;
    transition: 0.3s;
}

.form-control:focus {
    border-color: var(--accent-red);
    box-shadow: 0 0 10px rgba(255, 46, 99, 0.2);
}

textarea.form-control { resize: vertical; min-height: 120px; }

/* Admin Table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    min-width: 600px; /* Force scroll on small screens */
}

.data-table th {
    text-align: left;
    padding: 1rem;
    color: #888;
    border-bottom: 2px solid #333;
    font-family: 'Russo One';
}

.data-table td {
    padding: 1rem;
    border-bottom: 1px solid #222;
    vertical-align: middle;
}

.data-table tr:hover { background: rgba(255,255,255,0.02); }

.thumb-img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 1px solid #444;
    border-radius: 4px;
}

.action-btn {
    background: #222;
    color: #fff;
    border: 1px solid #444;
    padding: 0.5rem 1rem;
    cursor: pointer;
    transition: 0.3s;
    font-family: 'Russo One';
}
.action-btn.delete:hover { background: var(--accent-red); border-color: var(--accent-red); }

/* =========================================
   REALISTIC CYBERPUNK GLITCH EFFECT
========================================= */
.glitch {
    position: relative;
    color: #fff;
    /* Responsive font sizing */
    font-size: clamp(4rem, 12vw, 7rem);
    font-family: 'Bangers', cursive;
    text-transform: uppercase;
    /* Main text subtle shake */
    animation: glitch-skew 0.5s infinite linear alternate-reverse;
    /* Hard shadow for depth */
    text-shadow: 4px 4px 0px #000;
}

/* Hides the original text slightly so the layers pop */
.glitch::before,
.glitch::after {
    content: attr(data-text);
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-dark); /* Matches background to create "tears" */
    opacity: 0.8;
}

/* Layer 1: Red/Magenta Shift & Hard Tearing */
.glitch::before {
    left: 3px;
    text-shadow: -3px 0 #ff0055; /* Strong Red/Pink */
    clip: rect(44px, 450px, 56px, 0);
    /* Very fast, chaotic animation */
    animation: glitch-anim-hard 2s infinite linear alternate-reverse;
    z-index: -1;
}

/* Layer 2: Cyan/Blue Shift & Wide Tearing */
.glitch::after {
    left: -3px;
    text-shadow: 3px 0 #00ddff; /* Strong Cyan */
    clip: rect(44px, 450px, 56px, 0);
    /* Different speed and keyframes for desync */
    animation: glitch-anim-wide 2.5s infinite linear alternate-reverse;
    z-index: -2;
}

/* --- ANIMATIONS --- */

/* Subtly skews the main text back and forth */
@keyframes glitch-skew {
    0% { transform: skew(1deg); }
    20% { transform: skew(-1deg); }
    40% { transform: skew(2deg); }
    60% { transform: skew(-2deg); }
    80% { transform: skew(1deg); }
    100% { transform: skew(-1deg); }
}

/* Highly aggressive, random tearing for the Red layer */
@keyframes glitch-anim-hard {
    0% { clip: rect(38px, 9999px, 74px, 0); transform: skew(0.72deg); }
    5% { clip: rect(98px, 9999px, 83px, 0); transform: skew(0.3deg); }
    10% { clip: rect(79px, 9999px, 91px, 0); transform: skew(0.77deg); }
    15% { clip: rect(29px, 9999px, 15px, 0); transform: skew(0.77deg); }
    20% { clip: rect(47px, 9999px, 91px, 0); transform: skew(0.61deg); }
    25% { clip: rect(74px, 9999px, 64px, 0); transform: skew(0.41deg); }
    30% { clip: rect(22px, 9999px, 100px, 0); transform: skew(0.43deg); }
    35% { clip: rect(14px, 9999px, 13px, 0); transform: skew(0.9deg); }
    40% { clip: rect(33px, 9999px, 95px, 0); transform: skew(0.63deg); }
    45% { clip: rect(78px, 9999px, 16px, 0); transform: skew(0.57deg); }
    50% { clip: rect(93px, 9999px, 19px, 0); transform: skew(0.48deg); }
    55% { clip: rect(55px, 9999px, 75px, 0); transform: skew(0.12deg); }
    60% { clip: rect(79px, 9999px, 69px, 0); transform: skew(0.02deg); }
    65% { clip: rect(36px, 9999px, 17px, 0); transform: skew(0.06deg); }
    70% { clip: rect(12px, 9999px, 24px, 0); transform: skew(0.81deg); }
    75% { clip: rect(51px, 9999px, 50px, 0); transform: skew(0.93deg); }
    80% { clip: rect(32px, 9999px, 24px, 0); transform: skew(0.14deg); }
    85% { clip: rect(86px, 9999px, 66px, 0); transform: skew(0.62deg); }
    90% { clip: rect(53px, 9999px, 91px, 0); transform: skew(0.48deg); }
    95% { clip: rect(52px, 9999px, 43px, 0); transform: skew(0.42deg); }
    100% { clip: rect(100px, 9999px, 65px, 0); transform: skew(0.36deg); }
}

/* Broader, slower tearing for the Cyan layer */
@keyframes glitch-anim-wide {
    0% { clip: rect(33px, 9999px, 27px, 0); transform: skew(0.99deg); }
    5% { clip: rect(21px, 9999px, 71px, 0); transform: skew(0.89deg); }
    10% { clip: rect(79px, 9999px, 26px, 0); transform: skew(0.94deg); }
    15% { clip: rect(81px, 9999px, 42px, 0); transform: skew(0.91deg); }
    20% { clip: rect(62px, 9999px, 98px, 0); transform: skew(0.03deg); }
    25% { clip: rect(16px, 9999px, 9px, 0); transform: skew(0.17deg); }
    30% { clip: rect(78px, 9999px, 98px, 0); transform: skew(0.21deg); }
    35% { clip: rect(64px, 9999px, 92px, 0); transform: skew(0.7deg); }
    40% { clip: rect(46px, 9999px, 54px, 0); transform: skew(0.48deg); }
    45% { clip: rect(29px, 9999px, 46px, 0); transform: skew(0.73deg); }
    50% { clip: rect(85px, 9999px, 78px, 0); transform: skew(0.44deg); }
    55% { clip: rect(8px, 9999px, 13px, 0); transform: skew(0.12deg); }
    60% { clip: rect(99px, 9999px, 46px, 0); transform: skew(0.02deg); }
    65% { clip: rect(57px, 9999px, 76px, 0); transform: skew(0.89deg); }
    70% { clip: rect(44px, 9999px, 50px, 0); transform: skew(0.52deg); }
    75% { clip: rect(7px, 9999px, 79px, 0); transform: skew(0.04deg); }
    80% { clip: rect(31px, 9999px, 40px, 0); transform: skew(0.6deg); }
    85% { clip: rect(28px, 9999px, 41px, 0); transform: skew(0.82deg); }
    90% { clip: rect(85px, 9999px, 41px, 0); transform: skew(0.67deg); }
    95% { clip: rect(42px, 9999px, 30px, 0); transform: skew(0.79deg); }
    100% { clip: rect(45px, 9999px, 20px, 0); transform: skew(0.12deg); }
}

/* --- ANIMATION KEYFRAMES --- */
@keyframes moveGrid { 0% { background-position: 0 0; } 100% { background-position: 0 500px; } }
@keyframes pulseBg { 0% { opacity: 0.5; } 100% { opacity: 1; } }
@keyframes floatCard { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-15px); } }

/* --- MOBILE MEDIA QUERIES --- */
@media (max-width: 900px) {
    .detail-wrapper {
        flex-direction: column;
        align-items: center;
    }
    .detail-img-box { max-width: 100%; }
    .detail-info { text-align: center; }
    .detail-desc { text-align: left; }
    
    .form-grid { grid-template-columns: 1fr; }
    .full-width { grid-column: span 1; }
}

@media (max-width: 600px) {
    .grid {
        grid-template-columns: 1fr; /* Single column on phones */
        gap: 1.5rem;
    }
    
    .filter-bar { gap: 0.5rem; }
    .filter-btn { padding: 0.5rem 1rem; font-size: 0.9rem; }
    
    .hero { padding: 3rem 1rem; min-height: 40vh; }
    
    .admin-card { padding: 1.5rem 1rem; }
    .admin-header { flex-direction: column; text-align: center; }
    
    /* Responsive Table Wrapper */
    .admin-card > div { overflow-x: auto; }
}