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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Arial, sans-serif;
    background: linear-gradient(135deg, #0f0f0f 0%, #1a1a2e 100%);
    color: #fff;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 900px;
    padding: 20px;
    position: relative; /* この行を追加 */
}

/* Header Section */
.header {
    text-align: center;
    margin-bottom: 50px;
    animation: fadeInDown 0.8s ease-out;
}

h1 {
    font-size: 3em;
    margin-bottom: 10px;
    background: linear-gradient(45deg, #ff006e, #8338ec, #3a86ff);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: gradient 3s ease infinite;
    background-size: 200% 200%;
}

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

.subtitle {
    font-size: 1.2em;
    color: #a0a0a0;
    font-weight: 300;
}

/* Input Section */
.input-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 30px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 1s ease-out 0.3s both;
}

.input-group {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

input[type="text"] {
    flex: 1;
    padding: 15px 20px;
    font-size: 1.1em;
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    transition: all 0.3s ease;
}

input[type="text"]:focus {
    outline: none;
    border-color: #8338ec;
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
}

input[type="text"]::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

button {
    padding: 15px 30px;
    font-size: 1.1em;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    background: linear-gradient(45deg, #8338ec, #3a86ff);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

button:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(131, 56, 236, 0.4);
}

button:active {
    transform: translateY(0);
}

/* Result Section */
.result-section {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    min-height: 300px;
    display: none;
    animation: fadeIn 0.5s ease-out;
}

.result-section.show {
    display: block;
}

.kanji-display {
    font-size: 5em;
    margin: 20px 0;
    font-family: 'fot-tsukuardgothic-std', 'Noto Sans JP', sans-serif;
    font-weight: 700;
    background: linear-gradient(45deg, #ff006e, #8338ec);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

.pronunciation {
    font-size: 1.5em;
    color: #8338ec;
    margin-bottom: 10px;
}

.meaning {
    font-size: 1.2em;
    color: #a0a0a0;
    margin-bottom: 30px;
    line-height: 1.6;
}

.kanji-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.detail-card {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 15px;
    padding: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.detail-title {
    font-size: 0.9em;
    color: #8338ec;
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.detail-content {
    font-size: 1.1em;
}

/* Loading State */
.loading {
    display: none;
    font-size: 1.2em;
    color: #8338ec;
}

.loading.show {
    display: block;
}

/* Examples Section */
.examples-section {
    margin-top: 50px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 1s ease-out 0.5s both;
}

.examples-section h3 {
    text-align: center;
    color: #8338ec;
    margin-bottom: 25px;
    font-size: 1.5em;
}

.example-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
}

.example-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    font-size: 1.1em;
}

.example-name {
    color: #fff;
    font-weight: 500;
}

.example-arrow {
    color: #666;
}

.example-pronunciation {
    color: #8338ec;
    font-style: italic;
}

.example-kanji {
    font-family: 'Noto Sans JP', sans-serif;
    font-size: 1.3em;
    background: linear-gradient(45deg, #ff006e, #8338ec);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-left: auto;
}

/* Help Button and Modal */
.help-button {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    font-size: 1.2em;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: float 3s ease-in-out infinite;
    padding: 0;
    box-sizing: border-box;
}

@keyframes float {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
}

.help-button:hover {
    background: rgba(131, 56, 236, 0.3);
    border-color: #8338ec;
    animation: none;
    transform: scale(1.2);
}

.help-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    overflow-y: auto;
    animation: fadeIn 0.3s ease-out;
}

.help-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.help-content {
    background: linear-gradient(135deg, #1a1a2e 0%, #0f0f0f 100%);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 20px;
    padding: 40px;
    max-width: 800px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.help-content h2 {
    color: #8338ec;
    margin-bottom: 30px;
    text-align: center;
}

.help-content h3 {
    color: #ff006e;
    margin-top: 25px;
    margin-bottom: 15px;
}

.close-button {
    position: fixed;
    top: 20px;
    right: 20px;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.8);
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: #fff;
    font-size: 1.5em;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    transition: all 0.3s ease;
}

.close-button:hover {
    color: #ff006e;
    transform: scale(1.2);
}

.help-section {
    margin-bottom: 30px;
}

.sound-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 15px;
}

.sound-grid div {
    background: rgba(255, 255, 255, 0.05);
    padding: 10px;
    border-radius: 8px;
    text-align: center;
    font-family: monospace;
    color: #a0a0a0;
}

.help-content ul {
    list-style: none;
    padding: 0;
}

.help-content li {
    margin: 10px 0;
    padding-left: 20px;
    color: #a0a0a0;
}

.help-content strong {
    color: #8338ec;
}

/* Info Section */
.info-section {
    max-width: 900px;
    margin: 60px auto 40px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    animation: fadeIn 1s ease-out 0.6s both;
}

.info-section h2 {
    text-align: center;
    color: #8338ec;
    font-size: 2em;
    margin-bottom: 30px;
    background: linear-gradient(45deg, #ff006e, #8338ec);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.info-content {
    color: #a0a0a0;
    line-height: 1.8;
}

.info-content h3 {
    color: #ff006e;
    margin: 30px 0 15px;
    font-size: 1.3em;
}

.info-content p {
    margin-bottom: 15px;
}

.info-content ul {
    list-style: none;
    padding-left: 0;
    margin: 15px 0;
}

.info-content li {
    position: relative;
    padding-left: 25px;
    margin-bottom: 10px;
}

.info-content li:before {
    content: "→";
    position: absolute;
    left: 0;
    color: #8338ec;
}

.info-content strong {
    color: #fff;
}

.disclaimer {
    margin-top: 40px;
    padding: 20px;
    background: rgba(255, 0, 110, 0.1);
    border: 1px solid rgba(255, 0, 110, 0.3);
    border-radius: 10px;
}

.disclaimer p {
    margin: 0;
    font-size: 0.9em;
    color: #ff006e;
}

/* Footer */
.footer {
    margin-top: 60px;
    text-align: center;
    padding: 20px;
    color: #888;
    font-size: 0.85em;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.footer p {
    margin: 0;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 600px) {
    h1 {
        font-size: 2em;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .kanji-display {
        font-size: 3.5em;
    }
}

/* Info Section Link Style */
.info-content a {
    color: #8338ec; /* 明るい紫色を指定 */
    font-weight: 600; /* 少し太字にして目立たせる */
    text-decoration: none; /* 下線を消してスッキリさせる */
    transition: color 0.3s ease, text-decoration 0.3s ease;
}

.info-content a:hover {
    color: #ff006e; /* マウスを乗せたらピンク色に変化 */
    text-decoration: underline; /* マウスを乗せたら下線を表示 */
}