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

:root {

    --bg-color: #121212;
    --text-color: #eee;
    --card-bg: #1f1f1f;
    --primary-color: #ffcc00;
    --texto: #15839C;
    --sombra: #BAE46D;

    /* Light Theme Colors */
    --bg-primary: #f0f4f8;
    --bg-secondary: #ffffff;
    --bg-card: #ffffff;
    --text-primary: #1a202c;
    --text-secondary: #4a5568;
    --accent-neon: #00ff9c;
    --accent-blue: #2196f3;
    --accent-pink: #e91e63;
    --accent-yellow: #ffc107;
    --accent-green: #00ff9c;
    --border-color: #e2e8f0;
    --shadow: rgba(0, 0, 0, 0.1);
    --overlay: rgba(0, 0, 0, 0.7);

    /* Status Colors */
    --status-alive: #4ade80;
    --status-dead: #ef4444;
    --status-unknown: #94a3b8;

    /* Gender Colors */
    --gender-male: #60a5fa;
    --gender-female: #f472b6;
    --gender-other: #fbbf24;
}

.dark-theme {
    --bg-primary: #0a0e1a;
    --bg-secondary: #121826;
    --bg-card: #1a2332;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --border-color: #2d3748;
    --shadow: rgba(0, 255, 156, 0.2);
    --overlay: rgba(0, 0, 0, 0.9);
}

body {
    font-family: "Roboto", sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    transition: background 0.3s ease, color 0.3s ease;
}

html,
body {
    height: 100%;
}

/* Header Styles */
.header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--bg-secondary);
    border-bottom: 2px solid var(--accent-neon);
    box-shadow: 0 4px 20px var(--shadow);
    padding: 1rem 2rem;
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-circle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-neon), var(--accent-blue));
    padding: 3px;
    animation: rotate 10s linear infinite;
}

.logo-circle-footer {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent-neon), var(--accent-blue));
    padding: 3px;
}

.logo-circle img, .logo-circle-footer img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.site-title {
    font-family: "Orbitron", sans-serif;
    font-size: 1.8rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 2px;
    display: flex;
    flex-direction: column;
    line-height: 1.2;
    color: var(--texto);
    text-shadow: 2px 2px 4px var(--sombra);
}

.subtitle {
    font-size: 0.6rem;
    font-weight: 400;
    color: var(--text-secondary);
    letter-spacing: 3px;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.search-container {
    position: relative;
}

.search-input {
    padding: 0.75rem 2.5rem 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 50px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    width: 250px;
    transition: all 0.3s ease;
}

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

.search-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.btn-random {
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--accent-neon), var(--accent-blue));
    color: var(--bg-primary);
    border: none;
    border-radius: 50px;
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-random:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 156, 0.4);
}

.portal-icon {
    animation: spin 2s linear infinite;
}

.portal-icon img {
    width: 24px;
}


@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.btn-theme {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 2px solid var(--border-color);
    background: var(--bg-card);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    transition: all 0.3s ease;
}

.btn-theme:hover {
    transform: scale(1.1);
    border-color: var(--accent-neon);
    box-shadow: 0 0 20px rgba(0, 255, 156, 0.3);
}

/* Introduction Section */
.intro-section {
    background: var(--bg-secondary);
    padding: 3rem 2rem;
    margin-bottom: 2rem;
    color: var(--text-primary);
}

.intro-content {
    display: flex;
    flex-direction: row;
    max-width: 1200px;
    margin: 0 auto;
}

.intro-banner {
    text-align: center;
    margin-bottom: 2rem;
}

.banner-gif {
    max-width: 600px;
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: 0 10px 40px var(--shadow);
}

.intro-text {
    text-align: center;
    margin: 0 50px;
}

.intro-title {
    font-family: "Orbitron", sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--texto);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-shadow: 2px 2px 4px var(--sombra);
}

.intro-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 800px;
    margin: 0 auto 2rem;
    line-height: 1.8;
}

.random-info {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 2rem;
    background: var(--bg-primary);
    border-radius: 50px;
    max-width: 600px;
    margin: 0 auto;
    border: 2px solid var(--accent-neon);
    transition: all 0.3s ease;
    cursor: pointer;
}

.random-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 255, 156, 0.4);
}

.portal-emoji {
    font-size: 2rem;
    animation: pulse 2s ease-in-out infinite;
}

.portal-emoji img {
    width: 100px;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }
}

/* Main Container */
.main-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    display: flex;
    gap: 2rem;
}

/* Sidebar */
.sidebar {
    position: sticky;
    top: 120px;
    width: 280px;
    height: fit-content;
    background: var(--bg-secondary);
    border-radius: 20px;
    padding: 1.5rem;
    box-shadow: 0 4px 20px var(--shadow);
    transition: transform 0.3s ease;
}

.sidebar-toggle {
    display: none;
    position: absolute;
    top: 1rem;
    right: -50px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-neon);
    border: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--bg-primary);
}

.bi {
    font-size: 1.5rem;
    color: var(--accent-green);
}

.filter-title {
    font-family: "Orbitron", sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--texto);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 2px 2px 4px var(--sombra);
}

.filter-group {
    margin-bottom: 2rem;
}

.filter-subtitle {
    font-family: "Orbitron", sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.filter-option:hover {
    background: var(--bg-primary);
}

.filter-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    cursor: pointer;
}

.checkmark {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.filter-option input[type="checkbox"]:checked~.checkmark {
    background: var(--accent-neon);
    border-color: var(--accent-neon);
}

.filter-option input[type="checkbox"]:checked~.checkmark::after {
    content: "";
    position: absolute;
    color: var(--bg-primary);
    font-weight: bold;
    left: 4px;
    top: -2px;
}

.filter-label {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

.species-select {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 10px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.species-select:focus {
    outline: none;
    border-color: var(--accent-neon);
}

.btn-clear {
    width: 100%;
    padding: 0.75rem;
    background: transparent;
    border: 2px solid var(--accent-pink);
    border-radius: 10px;
    color: var(--accent-pink);
    font-family: "Orbitron", sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-clear:hover {
    background: var(--accent-pink);
    color: white;
    transform: translateY(-2px);
}

/* Content Area */
.content {
    flex: 1;
}

.loading-spinner {
    text-align: center;
    padding: 4rem 2rem;
}

.spinner {
    width: 60px;
    height: 60px;
    border: 4px solid var(--border-color);
    border-top-color: var(--accent-neon);
    border-radius: 50%;
    margin: 0 auto 1rem;
    animation: spin 1s linear infinite;
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

/* Character Card */
.character-card {
    background: var(--bg-card);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px var(--shadow);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    border: 2px solid transparent;
}

.character-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 255, 156, 0.3);
    border-color: var(--accent-neon);
}

.character-card.male {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(96, 165, 250, 0.1) 100%);
}

.character-card.female {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(244, 114, 182, 0.1) 100%);
}

.character-card.genderless,
.character-card.unknown {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(251, 191, 36, 0.1) 100%);
}

.card-id {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 40px;
    height: 40px;
    background: var(--accent-neon);
    color: var(--bg-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.card-image-container {
    position: relative;
    width: 100%;
    height: 280px;
}

.card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.character-card:hover .card-image {
    transform: scale(1.1);
}

.status-badge {
    position: absolute;
    bottom: 10px;
    right: 10px;
    width: 35px;
    height: 35px;
    background: var(--bg-secondary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.card-info {
    padding: 1.5rem;
}

.card-name {
    font-family: "Orbitron", sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--texto);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 0.5rem;
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.card-detail {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 0.25rem;
}

.card-detail strong {
    color: var(--text-primary);
}

/* Load More */
.load-more-container {
    display: flex;
    justify-content: center;
    text-align: center;
    padding: 2rem 0;
}

.btn-load-more {
    padding: 1rem 3rem;
    background: linear-gradient(135deg, var(--accent-blue), var(--accent-neon));
    color: white;
    border: none;
    border-radius: 50px;
    font-family: "Orbitron", sans-serif;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.btn-load-more:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(33, 150, 243, 0.4);
}

.btn-load-more:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal.active {
    display: flex;
}

.modal-content {
    padding: 2rem;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    background-color: var(--bg-secondary);
    border-radius: 30px;
    width: 80%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 255, 156, 0.3);
    border: 3px solid var(--accent-neon);
    opacity: 0;
    transition: all 0.3s ease;
    background-image: url("imagens/rickpaper.jpeg");
    background-size: cover;
    background-position: center;
}

.modal.active .modal-content {
    transform: translate(-50%, -50%) scale(1);
    opacity: 1;
}

.modal-close {
    position: absolute;
    top: 32px;
    right: 32px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-pink);
    color: white;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
}

.modal-close:hover {
    transform: rotate(90deg) scale(1.1);
}

.modal-body {
    display: flex;
    gap: 1.5rem;
    padding: 1rem 1.5rem;
    height: 100%;
}

.modal-image-container {
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-info {
    flex: 1;
}

.modal-image {
    width: 400px;
    height: 400px;
    border-radius: 20px;
    object-fit: cover;
    animation: modalPulse 3s ease-in-out infinite;
    padding: 12px 12px;
}

@keyframes modalPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.modal-info {
    flex: 1;
}

.modal-name {
    font-family: "Orbitron", sans-serif;
    font-size: 2rem;
    font-weight: 900;
    color: var(--texto);
    text-shadow: 2px 2px 4px var(--sombra);
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.modal-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.detail-item {
    padding: 1rem;
    background: var(--bg-primary);
    border-radius: 10px;
    border-left: 4px solid var(--accent-neon);
}

.detail-label {
    font-family: "Orbitron", sans-serif;
    font-weight: 600;
    color: var(--text-secondary);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: block;
    margin-bottom: 0.25rem;
}

.detail-value {
    font-size: 0.9rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* Footer */
.footer {
    background: linear-gradient(135deg, var(--bg-secondary) 0%, rgba(0, 255, 156, 0.1) 100%);
    padding-left: 2rem;
    padding-right: 2rem;
    padding-top: 3rem;
    margin-top: 4rem;
    border-top: 2px solid var(--accent-neon);
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 2rem;
}

.footer-info {
    text-align: center;
    gap: 2rem;
}

.footer-text {
    font-size: 1rem;
    color: var(--text-primary);
    margin: 0.5rem 0;
    text-align: center;
    padding: 1rem 0;
}

.footer-subtext {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.version-tag {
    font-family: "Orbitron", sans-serif;
    font-size: 0.8rem;
    color: var(--accent-neon);
    font-weight: 700;
    letter-spacing: 2px;
}

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

.social-link {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: var(--bg-primary);
    color: var(--text-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    border: 2px solid var(--border-color);
}

.social-link:hover {
    background: var(--accent-neon);
    color: var(--bg-primary);
    transform: translateY(-5px) rotate(360deg);
    border-color: var(--accent-neon);
    box-shadow: 0 10px 25px rgba(0, 255, 156, 0.4);
}

/* Responsive Design */
@media (max-width: 1024px) {
    .main-container {
        flex-direction: column;
    }

    .sidebar {
        position: relative;
        width: 100%;
        top: 0;
    }

    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

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

    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
    }

    .search-input {
        width: 200px;
    }

    .site-title {
        font-size: 1.5rem;
    }

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

    .character-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 1rem;
    }

    .modal-body {
        flex-direction: column;
        align-items: center;
    }

    .modal-image {
        width: 250px;
        height: 250px;
    }

    .footer-content {
        flex-direction: column;
        text-align: center;
    }
}

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

    .character-grid {
        grid-template-columns: 1fr;
    }

    .btn-random {
        font-size: 0.8rem;
        padding: 0.6rem 1rem;
    }
}