/* Japanese Traditional Style CSS */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Serif+JP:wght@400;600;700&display=swap');

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

body {
    font-family: 'Noto Sans JP', 'Hiragino Kaku Gothic ProN', 'Hiragino Sans', Meiryo, sans-serif;
    line-height: 1.8;
    color: #2c2c2c;
    background: #f5f0e8;
    background-image: 
        repeating-linear-gradient(90deg, rgba(255,255,255,0.03) 0px, transparent 1px, transparent 40px, rgba(255,255,255,0.03) 41px),
        repeating-linear-gradient(0deg, rgba(255,255,255,0.03) 0px, transparent 1px, transparent 40px, rgba(255,255,255,0.03) 41px);
}

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

/* Header - Japanese style */
header {
    background: linear-gradient(135deg, #8b4513 0%, #d2691e 100%);
    padding: 25px 0;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    border-bottom: 3px solid #c41e3a;
    position: sticky;
    top: 0;
    z-index: 100;
}

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

.logo {
    font-family: 'Noto Serif JP', serif;
    font-size: 32px;
    font-weight: 700;
    color: #fff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
    letter-spacing: 2px;
    z-index: 102;
    position: relative;
}

.nav-links {
    display: flex;
    gap: 25px;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: #fff;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s;
    padding: 8px 16px;
    border-radius: 4px;
    border: 1px solid transparent;
}

.nav-links a:hover {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.3);
}

/* Mobile Menu Toggle Button - Hidden by default on desktop */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 40px;
    height: 32px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px;
    z-index: 102;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.mobile-menu-toggle span {
    display: block;
    width: 100%;
    height: 4px;
    background: #fff;
    border-radius: 2px;
    transition: all 0.3s ease;
    transform-origin: center;
    pointer-events: none;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: translateY(12px) rotate(45deg);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: translateY(-12px) rotate(-45deg);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 80px 20px;
    background: linear-gradient(180deg, #c41e3a 0%, #8b1538 100%);
    color: white;
    position: relative;
    overflow: hidden;
}

.hero h1 {
    font-family: 'Noto Serif JP', serif;
    font-size: 52px;
    margin-bottom: 20px;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.4);
    font-weight: 700;
    letter-spacing: 4px;
    position: relative;
    z-index: 1;
}

.hero p {
    font-size: 20px;
    margin-bottom: 40px;
    opacity: 0.95;
    position: relative;
    z-index: 1;
    letter-spacing: 2px;
}

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

.search-box button {
    padding: 18px 45px;
    background: linear-gradient(135deg, #fff 0%, #f5f0e8 100%);
    color: #c41e3a;
    border: 3px solid #c41e3a;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    font-family: 'Noto Sans JP', sans-serif;
    border-radius: 8px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    letter-spacing: 1px;
    width: 100%;
    max-width: 400px;
}

.search-box button:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

/* Categories */
.categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 60px;
}

.category-card {
    background: linear-gradient(135deg, #fff 0%, #fef5e7 100%);
    border-radius: 12px;
    padding: 35px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
    transition: all 0.3s;
    cursor: pointer;
    border: 2px solid #d4a574;
}

.category-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(196,30,58,0.2);
    border-color: #c41e3a;
}

.category-icon {
    font-size: 55px;
    margin-bottom: 18px;
}

.category-card h3 {
    font-family: 'Noto Serif JP', serif;
    font-size: 22px;
    margin-bottom: 12px;
    color: #8b4513;
    font-weight: 700;
}

.category-card p {
    color: #666;
    font-size: 15px;
}

/* Content Section */
.content-section {
    background: linear-gradient(135deg, #fff 0%, #fef9f3 100%);
    border-radius: 16px;
    padding: 50px;
    margin-bottom: 40px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    border: 3px solid #d4a574;
    position: relative;
}

.content-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(90deg, #c41e3a 0%, #ff6b9d 50%, #c41e3a 100%);
}

.content-section h2 {
    font-family: 'Noto Serif JP', serif;
    font-size: 36px;
    margin-bottom: 25px;
    color: #8b4513;
    text-align: center;
    font-weight: 700;
    letter-spacing: 2px;
}

.names-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
    margin-top: 40px;
}

.name-card {
    background: linear-gradient(135deg, #fff8f0 0%, #fff 100%);
    border-radius: 12px;
    padding: 28px;
    transition: all 0.3s;
    border: 2px solid #e8d5c4;
    box-shadow: 0 4px 12px rgba(0,0,0,0.06);
    position: relative;
}

.name-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(196,30,58,0.15);
    border-color: #c41e3a;
}

.name-card h4 {
    font-family: 'Noto Serif JP', serif;
    font-size: 24px;
    color: #8b4513;
    margin-bottom: 10px;
    font-weight: 700;
}

.name-card .kanji {
    font-family: 'Noto Serif JP', serif;
    font-size: 38px;
    margin: 12px 0;
    color: #c41e3a;
    font-weight: 600;
}

.name-card .hiragana {
    color: #666;
    margin-bottom: 12px;
    font-size: 16px;
}

.name-card .meaning {
    color: #555;
    font-size: 14px;
    font-style: italic;
}

/* Buttons */
.speak-btn {
    background: #c41e3a;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Noto Sans JP', sans-serif;
}

.speak-btn:hover {
    background: #a01828;
    transform: scale(1.05);
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.favorite-btn, .copy-btn {
    background: white;
    color: #c41e3a;
    border: 2px solid #c41e3a;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: 'Noto Sans JP', sans-serif;
}

.favorite-btn:hover, .copy-btn:hover {
    background: #c41e3a;
    color: white;
    transform: scale(1.05);
}

.favorite-btn.favorited {
    background: #ff6b9d;
    border-color: #ff6b9d;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background: linear-gradient(135deg, #fff 0%, #fef9f3 100%);
    margin: 5% auto;
    padding: 40px;
    border-radius: 16px;
    width: 90%;
    max-width: 900px;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    border: 3px solid #d4a574;
}

.close {
    color: #8b4513;
    float: right;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
}

.close:hover {
    color: #c41e3a;
}

.favorites-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.empty-favorites {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-favorites-icon {
    font-size: 80px;
    margin-bottom: 20px;
}

/* Footer */
footer {
    background: linear-gradient(135deg, #8b4513 0%, #d2691e 100%);
    padding: 45px 20px;
    text-align: center;
    margin-top: 60px;
    border-top: 4px solid #c41e3a;
    color: #fff;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s;
    padding: 5px 10px;
    border-bottom: 2px solid transparent;
}

.footer-links a:hover {
    border-bottom-color: #fff;
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 36px;
    }
    .hero p {
        font-size: 18px;
    }
    
    .logo {
        font-size: 24px;
    }
    
    /* Show mobile menu toggle button */
    .mobile-menu-toggle {
        display: flex !important;
    }
    
    /* Hide desktop navigation, show mobile version */
    .nav-links {
        position: fixed;
        top: 82px;
        right: -100%;
        width: 280px;
        height: calc(100vh - 82px);
        background: linear-gradient(180deg, #8b4513 0%, #d2691e 100%);
        flex-direction: column;
        padding: 30px 20px;
        gap: 0;
        box-shadow: -5px 0 20px rgba(0,0,0,0.3);
        transition: right 0.4s ease-in-out;
        overflow-y: auto;
        border-left: 3px solid #c41e3a;
        z-index: 99;
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .nav-links li {
        width: 100%;
        margin-bottom: 5px;
    }
    
    .nav-links a {
        display: block;
        padding: 15px 20px;
        width: 100%;
        text-align: left;
        font-size: 16px;
        border-radius: 8px;
        border: 2px solid transparent;
    }
    
    .nav-links a:hover,
    .nav-links a:active {
        background: rgba(255,255,255,0.2);
        border-color: rgba(255,255,255,0.4);
    }
    
    .content-section {
        padding: 30px 20px;
    }
    .categories {
        grid-template-columns: 1fr;
    }
}

/* Hide mobile menu button on desktop */
@media (min-width: 769px) {
    .mobile-menu-toggle {
        display: none !important;
    }
}
