/* soulkyn.fail - Dark Theme Chaos */

:root {
    /* Colors */
    --bg-primary: #0a0a0a;
    --bg-secondary: #151515;
    --bg-tertiary: #1f1f1f;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --text-muted: #707070;
    --accent: #ff4081;
    --accent-hover: #ff6b9d;
    --border: #2a2a2a;
    --success: #00e676;
    --error: #ff5252;
    --neon-pink: #ff0080;
    --neon-cyan: #00ffff;
    --neon-purple: #b300ff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
}

@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
}

/* Header */
.header {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 2rem;
}

@media (max-width: 968px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
    }
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    position: relative;
}

.logo img {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 0 8px rgba(255, 64, 129, 0.3));
    transition: all 0.3s ease;
}

.logo:hover img {
    filter: drop-shadow(0 0 12px rgba(255, 64, 129, 0.6));
    transform: rotate(-5deg) scale(1.05);
}

.logo .fail {
    color: var(--accent);
    position: relative;
    display: inline-block;
}

/* Glitch effect on hover */
.logo:hover .fail {
    animation: glitch 0.5s ease;
}

@keyframes glitch {
    0%, 100% {
        transform: translate(0);
        text-shadow: none;
    }
    20% {
        transform: translate(-2px, 2px);
        text-shadow: 2px -2px var(--neon-cyan), -2px 2px var(--neon-pink);
    }
    40% {
        transform: translate(-2px, -2px);
        text-shadow: 2px 2px var(--neon-cyan), -2px -2px var(--neon-pink);
    }
    60% {
        transform: translate(2px, 2px);
        text-shadow: -2px -2px var(--neon-cyan), 2px 2px var(--neon-pink);
    }
    80% {
        transform: translate(2px, -2px);
        text-shadow: -2px 2px var(--neon-cyan), 2px -2px var(--neon-pink);
    }
}

.nav {
    display: flex;
    gap: 1.5rem;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    padding: 0.5rem 0;
}

.nav-link:hover {
    color: var(--text-primary);
}

.nav-link.active {
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
}

.nav-link.soulkyn-link {
    color: var(--neon-cyan);
    font-weight: 600;
}

.nav-link.soulkyn-link:hover {
    color: var(--neon-cyan);
    text-shadow: 0 0 10px rgba(0, 255, 255, 0.5);
    transform: translateX(-2px);
}

/* Main Content */
.main {
    flex: 1;
    padding: 1.5rem 0;
}

/* SEO H1 in navbar */
.page-h1 {
    font-size: 1.5rem;
    font-weight: 700;
    text-align: center;
    margin: 0;
    flex: 1;
    background: linear-gradient(90deg, var(--text-primary), var(--accent), var(--neon-cyan), var(--accent), var(--text-primary));
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradientShift 8s ease infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@media (max-width: 968px) {
    .page-h1 {
        font-size: 1.25rem;
    }
}

/* Filter Tabs */
.filter-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    padding: 0.5rem;
    background: var(--bg-secondary);
    border-radius: 8px;
    border: 1px solid var(--border);
    flex-wrap: wrap;
    align-items: center;
}

.filter-tab {
    flex: 0 0 auto;
    padding: 0.75rem 1.5rem;
    text-align: center;
    text-decoration: none;
    color: var(--text-secondary);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.filter-tab:hover {
    color: var(--text-primary);
    background: var(--bg-tertiary);
}

.filter-tab.active {
    color: var(--text-primary);
    background: var(--bg-primary);
    border-color: var(--accent);
    box-shadow: 0 0 12px rgba(255, 64, 129, 0.3);
}

/* Search Form */
.search-form {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
    flex: 0 0 auto;
}

.search-input {
    padding: 0.75rem 1rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    min-width: 200px;
    transition: all 0.2s ease;
}

.search-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(255, 64, 129, 0.3);
}

.search-input::placeholder {
    color: var(--text-muted);
}

.search-btn {
    padding: 0.75rem 1.25rem;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(255, 64, 129, 0.3);
}

@media (max-width: 768px) {
    .filter-tabs {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .filter-tab {
        flex: 0 0 auto;
    }

    .search-form {
        margin-left: 0;
        width: 100%;
        flex: 1 0 100%;
    }

    .search-input {
        flex: 1;
        min-width: 0;
    }
}

/* Gallery */
.gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.fail-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.fail-card::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, var(--neon-pink), var(--neon-cyan), var(--neon-purple), var(--neon-pink));
    background-size: 300% 300%;
    border-radius: 8px;
    opacity: 0;
    z-index: -1;
    transition: opacity 0.3s ease;
    animation: gradientRotate 6s ease infinite;
}

@keyframes gradientRotate {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.fail-card:hover {
    transform: translateY(-8px) rotate(-1deg);
    border-color: transparent;
}

.fail-card:hover::before {
    opacity: 0.6;
}

.fail-card:nth-child(even):hover {
    transform: translateY(-8px) rotate(1deg);
}

.fail-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.fail-media {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: var(--bg-tertiary);
    overflow: hidden;
}

.fail-image,
.fail-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.fail-card:hover .fail-image,
.fail-card:hover .fail-video {
    transform: scale(1.05) rotate(-0.5deg);
    filter: saturate(1.2) brightness(1.1);
}

.fail-caption {
    padding: 1rem;
    color: var(--text-primary);
    line-height: 1.5;
}

.fail-caption p {
    margin: 0;
}

.caption-link {
    text-decoration: none;
    color: inherit;
    display: block;
    transition: opacity 0.2s ease;
}

.caption-link:hover {
    opacity: 0.7;
    cursor: pointer;
}

.caption-link p {
    margin: 0;
}

.fail-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    border-top: 1px solid var(--border);
}

.fail-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.fail-tags {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.tag-pill {
    padding: 0.25rem 0.5rem;
    background: var(--bg-tertiary);
    color: var(--text-muted);
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 0.75rem;
    text-decoration: none;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.tag-pill:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(255, 64, 129, 0.3);
}

.vote-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 0.5rem 1rem;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 20px rgba(255, 64, 129, 0.5);
    transform: scale(1.05);
}

.vote-btn:active:not(:disabled) {
    transform: scale(0.95);
}

.vote-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vote-btn.voted {
    background: var(--success);
    border-color: var(--success);
    color: white;
    animation: celebrate 0.6s ease;
}

@keyframes celebrate {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 0 0 rgba(0, 230, 118, 0);
    }
    50% {
        transform: scale(1.15);
        box-shadow: 0 0 30px rgba(0, 230, 118, 0.8);
    }
}

.vote-icon {
    font-size: 1.1rem;
}

.vote-count {
    font-weight: 600;
}

.fail-date {
    color: var(--text-muted);
    font-size: 0.85rem;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    padding: 2rem 0;
}

.pagination-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.pagination-link:hover {
    color: var(--accent-hover);
}

.pagination-info {
    color: var(--text-secondary);
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--text-secondary);
}

/* Footer */
.footer {
    background: var(--bg-secondary);
    border-top: 1px solid var(--border);
    padding: 2rem 0;
    margin-top: auto;
}

.footer-text {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

.footer-heart {
    display: block;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.footer-heart .discord-link {
    color: var(--neon-purple);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s;
}

.footer-heart .discord-link:hover {
    color: var(--neon-purple);
    text-shadow: 0 0 8px rgba(179, 0, 255, 0.6);
}

.footer-links {
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.footer-separator {
    color: var(--text-muted);
}

.footer-links a {
    color: var(--accent);
    text-decoration: none;
    transition: all 0.2s;
}

.footer-links a:hover {
    color: var(--accent-hover);
}

.footer-links .zara-link {
    font-weight: 600;
    position: relative;
    display: inline;
    padding: 0;
    margin: 0;
}

.footer-links .zara-link:hover {
    text-shadow: 0 0 8px rgba(255, 64, 129, 0.5);
}

/* NSFW Modal */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
    max-width: 500px;
    width: 90%;
}

.modal-header h2 {
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.modal-body {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
}

.modal-body p {
    margin-bottom: 0.5rem;
}

.modal-footer {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn {
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    cursor: pointer;
    border: none;
    font-size: 1rem;
    transition: all 0.2s;
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    border-color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 768px) {
    .gallery {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }

    .page-title {
        font-size: 2rem;
    }

    .nav {
        gap: 1rem;
    }

    .modal-footer {
        flex-direction: column;
    }

    .btn {
        width: 100%;
    }
}

/* NSFW Badge */
body.nsfw .page-title::after {
    content: " 🔞";
    opacity: 0.6;
}

/* Single Fail View */
.fail-nav {
    margin-bottom: 2rem;
}

.back-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.back-link:hover {
    color: var(--accent);
}

.fail-single {
    max-width: 900px;
    margin: 0 auto;
}

.fail-media-large {
    position: relative;
    width: 100%;
    background: var(--bg-secondary);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 2rem;
}

.fail-image-large {
    width: 100%;
    max-height: 60vh;
    height: auto;
    display: block;
    object-fit: contain;
}

.fail-video-large {
    width: 100%;
    max-height: 60vh;
    height: auto;
    display: block;
}

.fail-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 2rem;
}

.fail-caption-large {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-primary);
    margin-bottom: 2rem;
}

.fail-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1.5rem;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--border);
}

.vote-btn-large {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 0.75rem 1.5rem;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.vote-btn-large:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    transform: scale(1.05);
    box-shadow: 0 0 25px rgba(255, 64, 129, 0.6);
}

.vote-btn-large:active:not(:disabled) {
    transform: scale(0.95);
}

.vote-btn-large:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.vote-btn-large.voted {
    background: var(--success);
    border-color: var(--success);
    color: white;
    animation: celebrateLarge 0.8s ease;
}

@keyframes celebrateLarge {
    0%, 100% {
        transform: scale(1) rotate(0deg);
        box-shadow: 0 0 0 rgba(0, 230, 118, 0);
    }
    25% {
        transform: scale(1.2) rotate(-5deg);
        box-shadow: 0 0 40px rgba(0, 230, 118, 0.9);
    }
    50% {
        transform: scale(1.2) rotate(5deg);
    }
    75% {
        transform: scale(1.2) rotate(-3deg);
    }
}

.fail-share {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.random-link,
.copy-link-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border-radius: 6px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
    position: relative;
    overflow: hidden;
}

.random-link::before,
.copy-link-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 64, 129, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.random-link:hover::before,
.copy-link-btn:hover::before {
    width: 300px;
    height: 300px;
}

.random-link {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.random-link:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: white;
    box-shadow: 0 0 20px rgba(255, 64, 129, 0.4);
    transform: translateY(-2px);
}

.copy-link-btn {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border);
}

.copy-link-btn:hover {
    color: var(--text-primary);
    border-color: var(--text-secondary);
    transform: translateY(-2px);
}

/* Responsive - Single Fail */
@media (max-width: 768px) {
    .fail-content {
        padding: 1.5rem;
    }

    .fail-caption-large {
        font-size: 1.1rem;
    }

    .fail-share {
        flex-direction: column;
    }

    .random-link,
    .copy-link-btn {
        width: 100%;
        justify-content: center;
    }
}

/* Tags - Subtle Minimal Pills */
.fail-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
}

.tag {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.75rem;
    border-radius: 12px;
    transition: all 0.2s ease;
    text-decoration: none;
}

.tag:hover {
    background: var(--bg-primary);
    color: var(--text-primary);
    border-color: var(--accent);
    box-shadow: 0 0 8px rgba(255, 64, 129, 0.3);
}
