/* Reset e configurações básicas */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #E53E3E;
    --secondary-color: #2D3748;
    --accent-color: #FED7D7;
    --text-dark: #1A202C;
    --text-light: #4A5568;
    --bg-light: #F7FAFC;
    --bg-white: #FFFFFF;
    --border-color: #E2E8F0;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --gradient: linear-gradient(135deg, #E53E3E 0%, #C53030 100%);
}

body {
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: var(--bg-light);
}

/* Header */
.header {
    background: var(--bg-white);
    box-shadow: var(--shadow);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.logo a {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: var(--text-dark);
    font-weight: bold;
    font-size: 1.2rem;
}

.logo svg {
    margin-right: 10px;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-dark);
}

.nav-menu {
    display: flex;
    list-style: none;
    align-items: center;
    gap: 30px;
}

.nav-menu a {
    text-decoration: none;
    color: var(--text-dark);
    font-weight: 500;
    transition: color 0.3s ease;
    display: flex;
    align-items: center;
    gap: 5px;
}

.nav-menu a:hover {
    color: var(--primary-color);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-white);
    box-shadow: var(--shadow);
    border-radius: 8px;
    min-width: 200px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1001;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    padding: 0;
}

.dropdown-menu a {
    padding: 12px 20px;
    display: block;
    border-bottom: 1px solid var(--border-color);
}

.dropdown-menu a:hover {
    background-color: var(--accent-color);
}

.arrow {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown:hover .arrow {
    transform: rotate(180deg);
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Hero Section */
.hero {
    background: var(--gradient);
    color: white;
    padding: 120px 0 80px;
    text-align: center;
}

.hero h1 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 20px;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 40px;
    opacity: 0.9;
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

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

.search-container input {
    width: 100%;
    padding: 15px 50px 15px 20px;
    font-size: 1.1rem;
    border: none;
    border-radius: 50px;
    box-shadow: var(--shadow);
    outline: none;
}

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: var(--text-light);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.clear-btn.show {
    opacity: 1;
}

/* Names Section */
.names-section {
    padding: 60px 0;
    background: var(--bg-white);
}

.alphabet-nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 40px;
}

.alphabet-btn {
    background: var(--bg-light);
    border: 2px solid var(--border-color);
    padding: 8px 15px;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    color: var(--text-dark);
}

.alphabet-btn:hover,
.alphabet-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.name-card {
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.name-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
    border-color: var(--primary-color);
}

.name-card h3 {
    color: var(--primary-color);
    font-size: 1.3rem;
    margin-bottom: 8px;
    font-weight: bold;
}

.name-card .japanese {
    color: var(--text-light);
    font-size: 1.1rem;
    margin-bottom: 10px;
    font-family: 'MS Gothic', monospace;
}

.name-card .meaning {
    color: var(--text-dark);
    font-size: 0.95rem;
    line-height: 1.5;
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-light);
    font-size: 1.1rem;
}

/* Content Section */
.content-section {
    padding: 60px 0;
    background: var(--bg-light);
}

.content-section h2 {
    color: var(--text-dark);
    font-size: 2.2rem;
    margin-bottom: 30px;
    text-align: center;
}

.content-section h3 {
    color: var(--primary-color);
    font-size: 1.5rem;
    margin: 40px 0 20px;
}

.content-section p {
    margin-bottom: 20px;
    font-size: 1.1rem;
    line-height: 1.7;
    text-align: justify;
}

.content-section a {
    color: var(--primary-color);
    text-decoration: none;
    border-bottom: 1px solid transparent;
    transition: border-color 0.3s ease;
}

.content-section a:hover {
    border-bottom-color: var(--primary-color);
}

.highlight-box {
    background: var(--accent-color);
    border-left: 4px solid var(--primary-color);
    padding: 25px;
    margin: 30px 0;
    border-radius: 8px;
}

.highlight-box h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.info-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    background: var(--bg-white);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: var(--shadow);
}

.info-table th,
.info-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.info-table th {
    background: var(--primary-color);
    color: white;
    font-weight: bold;
}

.info-table tr:nth-child(even) {
    background: var(--bg-light);
}

blockquote {
    background: var(--bg-white);
    border-left: 4px solid var(--primary-color);
    padding: 25px;
    margin: 30px 0;
    font-style: italic;
    font-size: 1.1rem;
    border-radius: 8px;
    box-shadow: var(--shadow);
}

blockquote cite {
    display: block;
    margin-top: 15px;
    font-weight: bold;
    color: var(--primary-color);
    font-style: normal;
}

.sources {
    background: var(--bg-white);
    padding: 25px;
    border-radius: 8px;
    margin-top: 40px;
    box-shadow: var(--shadow);
}

.sources li {
    margin-bottom: 10px;
    line-height: 1.6;
}

/* Footer */
.footer {
    background: var(--secondary-color);
    color: white;
    padding: 50px 0 20px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-section h4 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 1.2rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 10px;
}

.footer-section a {
    color: white;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    border-top: 1px solid #4A5568;
    padding-top: 20px;
    text-align: center;
    color: #A0AEC0;
}

/* Back to Top */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    font-size: 1.5rem;
    cursor: pointer;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

.back-to-top.show {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #C53030;
    transform: translateY(-2px);
}

/* GDPR Consent */
.gdpr-consent {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background: var(--bg-white);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    max-width: 350px;
    box-shadow: var(--shadow);
    z-index: 1000;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
}

.gdpr-consent.show {
    transform: translateX(0);
}

.gdpr-content p {
    margin-bottom: 15px;
    font-size: 0.9rem;
    line-height: 1.5;
}

.gdpr-accept {
    background: var(--primary-color);
    color: white;
    border: none;
    padding: 8px 20px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 500;
    transition: background-color 0.3s ease;
}

.gdpr-accept:hover {
    background: #C53030;
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-white);
        box-shadow: var(--shadow);
        flex-direction: column;
        padding: 20px;
        gap: 15px;
    }

    .nav-menu.active {
        display: flex;
    }

    .dropdown-menu {
        position: static;
        box-shadow: none;
        background: var(--bg-light);
        margin-top: 10px;
        border-radius: 4px;
    }

    .hero h1 {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1.1rem;
    }

    .alphabet-nav {
        gap: 5px;
    }

    .alphabet-btn {
        padding: 6px 12px;
        font-size: 0.9rem;
    }

    .names-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .content-section h2 {
        font-size: 1.8rem;
    }

    .content-section p {
        font-size: 1rem;
    }

    .gdpr-consent {
        left: 10px;
        right: 10px;
        max-width: none;
    }

    .back-to-top {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }

    .hero {
        padding: 100px 0 60px;
    }

    .hero h1 {
        font-size: 1.7rem;
    }

    .names-section {
        padding: 40px 0;
    }

    .content-section {
        padding: 40px 0;
    }

    .info-table {
        font-size: 0.9rem;
    }

    .info-table th,
    .info-table td {
        padding: 10px;
    }
}

/* Performance optimizations */
.name-card,
.alphabet-btn,
.back-to-top,
.gdpr-consent {
    will-change: transform;
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Focus styles for keyboard navigation */
button:focus,
input:focus,
a:focus {
    outline: 2px solid var(--primary-color);
    outline-offset: 2px;
}

/* Print styles */
@media print {
    .header,
    .back-to-top,
    .gdpr-consent {
        display: none;
    }

    .hero {
        background: none;
        color: var(--text-dark);
    }

    .content-section {
        background: none;
    }
}
