/* Brutal Layout - Clean Row-Based Design */

.brutal-container {
    position: relative;
    min-height: 100vh;
    background: 
        url('/static/img/cards-back.png') center/cover,
        radial-gradient(ellipse at center, rgba(26, 10, 10, 0.8) 0%, rgba(0, 0, 0, 0.9) 70%);
    background-blend-mode: overlay;
    color: #fff;
    font-family: 'Courier New', monospace;
}

/* Animated Background */
.brutal-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: -1;
}

.scanlines {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: repeating-linear-gradient(
        0deg,
        transparent,
        transparent 2px,
        rgba(139, 0, 0, 0.03) 2px,
        rgba(139, 0, 0, 0.03) 4px
    );
    animation: scanlines 0.1s linear infinite;
}

@keyframes scanlines {
    0% { transform: translateY(0); }
    100% { transform: translateY(4px); }
}

/* Header */
.brutal-header {
    text-align: center;
    padding: 50px 20px 45px;
    border-bottom: 3px solid var(--brutal-red, #8B0000);
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    backdrop-filter: blur(20px);
    position: relative;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
}

.brutal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        var(--brutal-red, #8B0000) 50%, 
        transparent 100%);
    opacity: 0.5;
}

/* Social Links */
.social-links {
    position: absolute;
    top: 20px;
    right: 30px;
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.6));
}

.social-link svg {
    width: 28px;
    height: 28px;
}

.social-link:hover {
    color: var(--brutal-red, #FF0000);
    transform: translateY(-3px) scale(1.15);
    filter: drop-shadow(0 5px 15px rgba(139, 0, 0, 0.8));
}

.social-link:active {
    transform: translateY(-1px) scale(1.1);
}

.logo-container {
    margin-bottom: 30px;
    position: relative;
}

.logo-container::after {
    content: '';
    position: absolute;
    bottom: -15px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--brutal-red, #8B0000), transparent);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.8);
}

.brutality-logo {
    max-width: 400px;
    height: auto;
    filter: drop-shadow(0 0 20px rgba(139, 0, 0, 0.8));
    transition: all 0.5s cubic-bezier(0.4, 0.0, 0.2, 1);
}

.brutality-logo:hover {
    transform: scale(1.05) translateY(-5px);
    filter: drop-shadow(0 0 35px rgba(255, 0, 0, 1));
}

.brutal-title {
    font-size: 4rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    margin: 30px 0 10px 0;
    text-shadow: 
        0 0 15px var(--brutal-red, #8B0000),
        0 0 30px var(--brutal-red, #8B0000),
        0 0 50px var(--brutal-red, #8B0000),
        3px 3px 6px rgba(0, 0, 0, 0.9);
    color: #fff;
    line-height: 1.1;
    position: relative;
    display: inline-block;
}

.brutal-title::after {
    content: attr(data-text);
    position: absolute;
    left: 0;
    top: 0;
    z-index: -1;
    text-shadow: 
        2px 2px 0 var(--brutal-red, #8B0000),
        4px 4px 0 rgba(139, 0, 0, 0.5);
}

.brutal-subtitle {
    font-size: 0.9rem;
    color: #999;
    margin: 0 0 25px 0;
    font-style: italic;
    opacity: 0.7;
    letter-spacing: 0.05em;
}

.brutal-tagline {
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    text-shadow: 
        0 0 10px rgba(139, 0, 0, 0.8),
        0 0 5px rgba(255, 0, 0, 0.5);
    letter-spacing: 0.25em;
    padding: 15px 35px;
    background: linear-gradient(135deg, 
        rgba(139, 0, 0, 0.2) 0%, 
        rgba(139, 0, 0, 0.3) 100%);
    border: 2px solid rgba(139, 0, 0, 0.5);
    border-radius: 8px;
    display: inline-block;
    margin-top: 5px;
    text-transform: uppercase;
    position: relative;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4);
}

.brutal-tagline::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, 
        transparent 30%, 
        rgba(255, 0, 0, 0.1) 50%, 
        transparent 70%);
    animation: shine 3s infinite;
}

@keyframes shine {
    0% { transform: translateX(-100%) translateY(-100%) rotate(45deg); }
    100% { transform: translateX(100%) translateY(100%) rotate(45deg); }
}

/* Controls */
.controls-section {
    padding: 35px 20px;
    background: rgba(0, 0, 0, 0.4);
    border-bottom: 2px solid rgba(139, 0, 0, 0.4);
    backdrop-filter: blur(15px);
}

.search-container {
    max-width: 500px;
    margin: 0 auto 25px auto;
    position: relative;
}

.brutal-search {
    width: 100%;
    padding: 15px 25px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--brutal-red, #8B0000);
    border-radius: 8px;
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    transition: all 0.3s ease;
}

.brutal-search:focus {
    outline: none;
    border-color: #FF0000;
    box-shadow: 0 0 20px rgba(255, 0, 0, 0.6);
    transform: translateY(-2px);
}

.brutal-search::placeholder {
    color: #666;
}

.filter-buttons {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 12px;
    max-width: 800px;
    margin: 0 auto;
}

.filter-btn {
    padding: 10px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--brutal-red, #8B0000);
    border-radius: 6px;
    color: #ccc;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0.0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.filter-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(139, 0, 0, 0.3), transparent);
    transition: left 0.5s;
}

.filter-btn:hover::before {
    left: 100%;
}

.filter-btn:hover {
    background: rgba(139, 0, 0, 0.3);
    color: #fff;
    border-color: #FF0000;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(139, 0, 0, 0.4);
}

.filter-btn.active {
    background: var(--brutal-red, #8B0000);
    color: #fff;
    border-color: #FF0000;
    box-shadow: 0 0 20px rgba(139, 0, 0, 0.8);
    transform: translateY(-2px);
}

/* Main Content */
.cards-main {
    max-width: 1500px;
    margin: 0 auto;
    padding: 50px 20px;
}

.card-section {
    margin-bottom: 70px;
    padding: 40px 35px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(139, 0, 0, 0.4);
    border-radius: 15px;
    backdrop-filter: blur(10px);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
}

.card-section:hover {
    border-color: rgba(139, 0, 0, 0.6);
    box-shadow: 0 12px 40px rgba(139, 0, 0, 0.3);
}

.showcase-section {
    background: rgba(139, 0, 0, 0.1);
    border: 2px solid var(--brutal-red, #8B0000);
}

.section-title {
    font-size: 2.3rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 0 20px 0;
    color: var(--brutal-red, #FF0000);
    text-shadow: 
        0 0 15px rgba(139, 0, 0, 0.8),
        0 0 25px rgba(139, 0, 0, 0.5),
        2px 2px 4px rgba(0, 0, 0, 0.7);
    padding-bottom: 15px;
    border-bottom: 2px solid rgba(139, 0, 0, 0.4);
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 80px;
    height: 2px;
    background: var(--brutal-red, #FF0000);
    box-shadow: 0 0 10px rgba(139, 0, 0, 0.8);
}

.section-description {
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 0 0 35px 0;
    color: #ddd;
    padding-top: 10px;
}

.section-description mark {
    background: rgba(139, 0, 0, 0.4);
    color: #fff;
    padding: 3px 6px;
    border-radius: 4px;
    font-weight: 600;
}

/* Card Rows */
.card-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 35px;
    justify-items: center;
    padding: 10px 0;
}

.showcase-card {
    display: flex;
    justify-content: center;
    margin: 25px 0;
}

/* Card Styling */
.card {
    width: 220px;
    height: 308px;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.4s cubic-bezier(0.4, 0.0, 0.2, 1);
    cursor: pointer;
    filter: drop-shadow(0 8px 20px rgba(0, 0, 0, 0.4));
}

.card:hover {
    filter: drop-shadow(0 12px 30px rgba(139, 0, 0, 0.5));
    transform: translateY(-8px);
}

/* Card faces positioning */
.card__front, .card__back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    border-radius: 8px;
}

.card__back {
    transform: rotateY(180deg);
}

/* Flipped state - card stays at 360deg (showing back) bigger */
.card.flipped .card__rotator {
    transform: rotateY(360deg) scale(1.3);
}

/* Flip forward animation - full 360 to land on back */
.card.flipping-forward .card__rotator {
    animation: flipForward360 1s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

/* Flip back animation - full 360 to return to front */
.card.flipping-back .card__rotator {
    animation: flipBack360 1s cubic-bezier(0.4, 0.0, 0.2, 1) forwards;
}

@keyframes flipForward360 {
    0% {
        transform: rotateY(0deg) scale(1) translateZ(0px);
    }
    10% {
        transform: rotateY(36deg) scale(1.03) translateZ(10px);
    }
    20% {
        transform: rotateY(72deg) scale(1.07) translateZ(20px);
    }
    30% {
        transform: rotateY(108deg) scale(1.12) translateZ(30px);
    }
    40% {
        transform: rotateY(144deg) scale(1.18) translateZ(40px);
    }
    50% {
        transform: rotateY(180deg) scale(1.23) translateZ(50px);
    }
    60% {
        transform: rotateY(216deg) scale(1.26) translateZ(50px);
    }
    70% {
        transform: rotateY(252deg) scale(1.28) translateZ(45px);
    }
    80% {
        transform: rotateY(288deg) scale(1.29) translateZ(40px);
    }
    90% {
        transform: rotateY(324deg) scale(1.295) translateZ(30px);
    }
    100% {
        transform: rotateY(360deg) scale(1.3) translateZ(20px);
    }
}

@keyframes flipBack360 {
    0% {
        transform: rotateY(360deg) scale(1.3) translateZ(20px);
    }
    10% {
        transform: rotateY(396deg) scale(1.295) translateZ(30px);
    }
    20% {
        transform: rotateY(432deg) scale(1.29) translateZ(40px);
    }
    30% {
        transform: rotateY(468deg) scale(1.28) translateZ(45px);
    }
    40% {
        transform: rotateY(504deg) scale(1.26) translateZ(50px);
    }
    50% {
        transform: rotateY(540deg) scale(1.23) translateZ(50px);
    }
    60% {
        transform: rotateY(576deg) scale(1.18) translateZ(40px);
    }
    70% {
        transform: rotateY(612deg) scale(1.12) translateZ(30px);
    }
    80% {
        transform: rotateY(648deg) scale(1.07) translateZ(20px);
    }
    90% {
        transform: rotateY(684deg) scale(1.03) translateZ(10px);
    }
    100% {
        transform: rotateY(720deg) scale(1) translateZ(0px);
    }
}

/* Global button reset */
button, .back-btn {
    outline: none !important;
    -webkit-outline: none !important;
    -moz-outline: none !important;
    -webkit-tap-highlight-color: transparent !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
}

button:focus, button:focus-visible, button:active,
.back-btn:focus, .back-btn:focus-visible, .back-btn:active {
    outline: none !important;
    -webkit-outline: none !important;
    -moz-outline: none !important;
    box-shadow: none !important;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.back-btn {
    padding: 12px 20px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid var(--brutal-red, #8B0000);
    color: #fff;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    outline: none !important;
    -webkit-outline: none !important;
    -moz-outline: none !important;
    -webkit-tap-highlight-color: transparent;
}

.back-btn:focus,
.back-btn:focus-visible,
.back-btn:active {
    outline: none !important;
    -webkit-outline: none !important;
    -moz-outline: none !important;
    border-color: var(--brutal-red, #FF0000);
    box-shadow: 
        0 4px 15px rgba(0, 0, 0, 0.5),
        0 0 15px rgba(139, 0, 0, 0.6);
}

.back-btn:hover {
    background: rgba(139, 0, 0, 0.4);
    border-color: var(--brutal-red, #FF0000);
    transform: translateY(-3px);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.6),
        0 0 20px rgba(139, 0, 0, 0.5);
}

.back-btn:active {
    transform: translateY(-1px);
}

/* Responsive Design */
@media (max-width: 768px) {
    .brutal-header {
        padding: 40px 15px 35px;
    }
    
    .brutal-title {
        font-size: 2.5rem;
        letter-spacing: 0.15em;
    }
    
    .section-title {
        font-size: 1.8rem;
    }
    
    .brutality-logo {
        max-width: 300px;
    }
    
    .social-links {
        position: static;
        margin: 0 auto 25px;
        justify-content: center;
        gap: 12px;
    }
    
    .social-link svg {
        width: 24px;
        height: 24px;
    }
    
    .brutal-tagline {
        font-size: 1rem;
        padding: 12px 25px;
        letter-spacing: 0.15em;
    }
    
    .card-section {
        padding: 30px 25px;
        margin-bottom: 50px;
    }
    
    .card-row {
        grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
        gap: 25px;
    }
    
    .card {
        width: 180px;
        height: 252px;
    }
    
    .filter-buttons {
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 15px;
        font-size: 0.75rem;
    }
}

@media (max-width: 480px) {
    .brutal-header {
        padding: 30px 10px 25px;
    }
    
    .brutal-title {
        font-size: 1.8rem;
        letter-spacing: 0.1em;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .brutality-logo {
        max-width: 240px;
    }
    
    .social-links {
        gap: 10px;
        margin-bottom: 20px;
    }
    
    .social-link svg {
        width: 22px;
        height: 22px;
    }
    
    .brutal-tagline {
        font-size: 0.85rem;
        padding: 10px 20px;
        letter-spacing: 0.12em;
    }
    
    .card-section {
        padding: 25px 20px;
        margin-bottom: 40px;
    }
    
    .card-row {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
        gap: 20px;
    }
    
    .card {
        width: 120px;
        height: 168px;
    }
    
    .cards-main {
        padding: 20px 10px;
    }
    
    .card-section {
        padding: 20px 15px;
    }
}
