﻿/* Hiragana Stroke Order - Complete CSS Styles */

/* CSS Variables - Design System */
:root {
    /* Light theme colors */
    --background: hsl(52, 30%, 98%);
    --foreground: hsl(43, 96%, 15%);
    --card: hsl(50, 20%, 96%);
    --card-foreground: hsl(43, 96%, 15%);
    --primary: hsl(48, 96%, 53%);
    --primary-foreground: hsl(43, 96%, 15%);
    --secondary: hsl(51, 50%, 88%);
    --secondary-foreground: hsl(43, 96%, 15%);
    --muted: hsl(50, 30%, 92%);
    --muted-foreground: hsl(43, 30%, 35%);
    --accent: hsl(45, 86%, 62%);
    --accent-foreground: hsl(43, 96%, 15%);
    --border: hsl(50, 40%, 85%);
    /* Custom gradients */
    --gradient-primary: linear-gradient(135deg, hsl(48, 96%, 53%) 0%, hsl(51, 96%, 53%) 90%, hsl(51, 50%, 88%) 100%);
    --gradient-subtle: linear-gradient(180deg, hsl(52, 30%, 98%), hsl(50, 20%, 96%));
    --gradient-card: linear-gradient(145deg, hsl(50, 20%, 96%), hsl(51, 50%, 88%));
    /* Shadows */
    --shadow-soft: 0 4px 20px -5px hsl(48, 96%, 53%, 0.15);
    --shadow-hover: 0 8px 30px -8px hsl(48, 96%, 53%, 0.25);
    /* Border radius */
    --radius: 0.5rem;
}

/* Dark theme colors */
@media (prefers-color-scheme: dark) {
    :root {
        --background: hsl(43, 96%, 8%);
        --foreground: hsl(52, 30%, 95%);
        --card: hsl(43, 96%, 10%);
        --card-foreground: hsl(52, 30%, 95%);
        --secondary: hsl(43, 20%, 20%);
        --secondary-foreground: hsl(52, 30%, 95%);
        --muted: hsl(43, 20%, 15%);
        --muted-foreground: hsl(50, 30%, 65%);
        --border: hsl(43, 20%, 25%);
        --gradient-primary: linear-gradient(135deg, hsl(48, 96%, 53%), hsl(45, 86%, 62%));
        --gradient-subtle: linear-gradient(180deg, hsl(43, 96%, 8%), hsl(43, 96%, 10%));
        --gradient-card: linear-gradient(145deg, hsl(43, 96%, 10%), hsl(43, 20%, 20%));
        --shadow-soft: 0 4px 20px -5px hsl(48, 96%, 53%, 0.25);
        --shadow-hover: 0 8px 30px -8px hsl(48, 96%, 53%, 0.35);
    }
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

a{
    text-decoration:none;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    line-height: 1.6;
    color: var(--foreground);
    background: var(--background);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Utility classes */
.hidden {
    display: none;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* Navigation Styles */
.navigation {
    background: var(--gradient-primary);
    box-shadow: var(--shadow-soft);
    position: sticky;
    top: 0;
    z-index: 50;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.nav-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.nav-logo {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-foreground);
    text-decoration: none;
    transition: opacity 0.3s ease;
}

    .nav-logo:hover {
        opacity: 0.8;
    }

.nav-links-desktop {
    display: none;
    gap: 2rem;
}

.nav-link {
    padding: 0.5rem 0.75rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--primary-foreground);
    text-decoration: none;
    transition: all 0.3s ease;
}

    .nav-link:hover {
        background: rgba(255, 255, 255, 0.1);
        color: var(--primary-foreground);
    }

    .nav-link.active {
        background: rgba(255, 255, 255, 0.2);
        color: var(--primary-foreground);
    }

.mobile-menu-btn {
    background: none;
    border: none;
    color: var(--primary-foreground);
    cursor: pointer;
    transition: opacity 0.3s ease;
}

    .mobile-menu-btn:hover {
        opacity: 0.8;
    }

.menu-icon,
.close-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.nav-mobile {
    padding-bottom: 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    padding-top: 1rem;
}

.nav-link-mobile {
    display: block;
    padding: 0.75rem;
    margin-bottom: 0.25rem;
    border-radius: var(--radius);
    font-size: 0.875rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: all 0.3s ease;
}

    .nav-link-mobile:hover {
        background: rgba(255, 255, 255, 0.1);
        color: rgba(255, 255, 255, 1);
    }

    .nav-link-mobile.active {
        background: rgba(255, 255, 255, 0.2);
        color: rgba(255, 255, 255, 1);
    }

/* Desktop navigation */
@media (min-width: 768px) {
    .nav-links-desktop {
        display: flex;
    }

    .mobile-menu-btn {
        display: none;
    }
}

/* Main Content */
.main-content {
    background: var(--gradient-subtle);
    min-height: calc(100vh - 4rem);
}

.hero-section {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.hero-content {
    text-align: center;
    margin-bottom: 3rem;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    max-width: 48rem;
    margin: 0 auto;
    line-height: 1.6;
}

/* Character Grid */
.character-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
}

.character-card {
    background: var(--gradient-card);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--radius);
    box-shadow: var(--shadow-soft);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.character-card:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-hover);
}
.character-grid-detail {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
}

.character-card-detail {
    background: var(--gradient-card);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.character-hiragana {
    font-size: 3.75rem;
    font-weight: 700;
    color: var(--foreground);
    margin-bottom: 1rem;
}

.character-romaji {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--muted-foreground);
    margin-bottom: 1rem;
}

.character-gif-container {
    position: relative;
    background: white;
    border-radius: var(--radius);
    padding: 1rem;
    overflow: hidden;
    margin-bottom: 0.75rem;
}

/*canvas*/
.canvas-container {
    
    max-width: 1200px;
    margin: 20px auto;
    padding: 20px;
    border-radius: 8px;
    
}

.signature-area {
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
}

#signature-canvas {
    
    border-radius: 4px;
    background: white;
    cursor: crosshair;
}

.controls {
    margin-top: 15px;
}

.btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    margin: 5px;
    font-size: 14px;
}

.btn:hover {
    background: #0056b3;
}

.btn-clear {
    background: #dc3545;
}

.btn-clear:hover {
    background: #c82333;
}

.info {
    font-size: 1.25rem;
    color: var(--muted-foreground);
    line-height: 1.6;
}


/*canvasend*/

/*home info*/
/* Information Cards Styles */
.info-card {
    display: block;
    margin: 10px auto;
    max-width: 1200px;
    padding: 1rem;
}

.info-card__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--foreground);
}

.info-card__content {
    color: var(--muted-foreground);
    line-height: 1.625;
}



/* Layout Styles */

/*home info end*/

.character-gif {
    width: 100%;
    height: 8rem;
    object-fit: contain;
    loading: lazy;
}

.character-gif-detail {
    width: 300px;
    height: 300px;
    aspect-ratio: 1/1;
    object-fit: contain;
}

.gif-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.1), transparent);
    pointer-events: none;
}

.character-label {
    font-size: 0.875rem;
    color: var(--muted-foreground);
}

.recommend {
    
    max-width: 1200px;
    margin: 20px auto;
    padding: 3rem 1rem;
}

h2 {
    font-size: 2rem;
    font-weight: 500;
    background: var(--gradient-primary);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    line-height: 1.2;
}

.recommend ul {
    
    display: flex;
    padding: 0; 
    margin: 0; 
    flex-wrap: wrap;
    list-style: none;
    gap: 15px;
    text-align:center;
}

.recommend ul li {
    font-size: 2rem;
    color: gray;
    margin-right: 20px;
    flex: 0 0 calc(10% - 10px);
    min-width: 100px;
    max-width: 200px;
}

.recommend ul li a {
    text-decoration: none;
    font-size: 2rem;
    color: white;
    max-width: 48rem;
    margin: 0 auto;
    line-height: 1.6;
}


/* Responsive grid */
@media (min-width: 640px) {
    .character-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .character-grid-detail {
        grid-template-columns: repeat(2, 1fr);
    }
    .character-gif-detail {      
        width: 400px;
        height:400px;
    }
}

@media (min-width: 768px) {
    .character-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1024px) {
    .character-grid {
        grid-template-columns: repeat(4, 1fr);
    }
   
}

@media (min-width: 1280px) {
    .character-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Footer Styles */
.footer {
    background: var(--gradient-primary);
    margin-top: 5rem;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 1rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-brand {
    grid-column: span 1;
}

.footer-logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-foreground);
    text-decoration: none;
    display: block;
    margin-bottom: 1rem;
}

.footer-description {
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.875rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.footer-tagline {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
}

.footer-section-title {
    color: var(--primary-foreground);
    font-weight: 600;
    margin-bottom: 1rem;
}

.footer-links {
    list-style: none;
}

    .footer-links li {
        margin-bottom: 0.5rem;
    }

.footer-link {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.3s ease;
}

    .footer-link:hover {
        color: var(--primary-foreground);
    }

.footer-separator {
    height: 1px;
    background: rgba(255, 255, 255, 0.2);
    margin: 1.5rem 0;
}

.footer-bottom {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
}

.footer-quick-links {
    display: flex;
    gap: 1.5rem;
}

.footer-quick-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-quick-link:hover {
    color: var(--primary-foreground);
}

.footer-additional {
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-disclaimer {
    text-align: center;
}

.footer-disclaimer p {
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.75rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.footer-disclaimer p:last-child {
    color: rgba(255, 255, 255, 0.5);
    margin-bottom: 0;
}

/* Responsive footer */
@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .footer-bottom {
        flex-direction: row;
        justify-content: space-between;
    }
}

@media (min-width: 1024px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .footer-brand {
        grid-column: span 1;
    }
}

/* Responsive typography */
@media (max-width: 640px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-description {
        font-size: 1.125rem;
    }

    .character-hiragana {
        font-size: 3rem;
    }
}

/* Loading states and animations */
.character-gif {
    transition: opacity 0.3s ease;
}

    .character-gif:not([src]) {
        opacity: 0.5;
        background: var(--muted);
    }

/* Focus states for accessibility */
.nav-link:focus,
.nav-link-mobile:focus,
.footer-link:focus,
.footer-quick-link:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.mobile-menu-btn:focus {
    outline: 2px solid rgba(255, 255, 255, 0.5);
    outline-offset: 2px;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Print styles */
@media print {
    .navigation,
    .footer {
        display: none;
    }

    .main-content {
        background: white;
    }

    .character-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
