/**
 * Customize Page Styles
 * Calligraphy Scroll Generator
 */

/* Hero */
.customize-hero {
    background: linear-gradient(135deg, var(--ink-black) 0%, var(--deep-brown) 100%);
    color: var(--paper-cream);
    padding: 10rem 2rem 5rem;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.customize-hero .hero-bg-pattern {
    position: absolute;
    inset: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.customize-hero .hero-content {
    position: relative;
    z-index: 1;
}

.customize-hero h1 {
    font-family: 'Zen Antique', serif;
    font-size: clamp(2.5rem, 5vw, 3.5rem);
    margin-bottom: 1rem;
}

.customize-hero p {
    font-size: 1.2rem;
    opacity: 0.8;
}

.customize-hero .hero-kanji {
    position: absolute;
    right: 10%;
    top: 50%;
    transform: translateY(-50%);
    font-family: 'Noto Serif JP', serif;
    font-size: clamp(10rem, 20vw, 18rem);
    opacity: 0.05;
    pointer-events: none;
}

/* Main Section */
.customize-main {
    padding: 4rem 2rem;
    background: var(--paper-cream);
}

.customize-main .container {
    max-width: 1400px;
    margin: 0 auto;
}

.customize-grid {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 4rem;
    align-items: start;
}

/* Controls Column */
.customize-controls {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

/* Input Section */
.input-section h2,
.symbols-section h2,
.kakemono-section h2 {
    font-family: 'Zen Antique', serif;
    font-size: 1.8rem;
    color: var(--ink-black);
    margin-bottom: 1rem;
}

.input-wrapper {
    position: relative;
}

.input-wrapper textarea {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    border: 2px solid #e0dcd5;
    border-radius: 10px;
    resize: vertical;
    transition: border-color 0.3s ease;
}

.input-wrapper textarea:focus {
    outline: none;
    border-color: var(--vermillion);
}

.word-count {
    position: absolute;
    bottom: 10px;
    right: 15px;
    font-size: 0.85rem;
    background: white;
    padding: 2px 8px;
    border-radius: 4px;
}

.input-hint {
    color: var(--soft-gray);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.input-buttons {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.input-buttons .btn {
    flex: 1;
}

/* Symbols Section */
.symbols-subtitle {
    color: var(--soft-gray);
    margin-bottom: 1.5rem;
}

.category-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.category-tab {
    padding: 0.6rem 1.2rem;
    border: 1px solid #e0dcd5;
    background: white;
    border-radius: 25px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-tab:hover {
    border-color: var(--vermillion);
    color: var(--vermillion);
}

.category-tab.active {
    background: var(--vermillion);
    color: white;
    border-color: var(--vermillion);
}

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

.symbol-card {
    background: white;
    border: 2px solid #e0dcd5;
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.symbol-card:hover {
    border-color: var(--vermillion);
    transform: translateY(-3px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.symbol-card.selected {
    background: var(--vermillion);
    border-color: var(--vermillion);
    color: white;
}

.symbol-kanji {
    display: block;
    font-family: 'Noto Serif JP', serif;
    font-size: 2.5rem;
    line-height: 1;
    margin-bottom: 0.5rem;
}

.symbol-reading {
    display: block;
    font-size: 0.8rem;
    opacity: 0.6;
    margin-bottom: 0.3rem;
}

.symbol-meaning {
    display: block;
    font-size: 0.9rem;
    font-weight: 500;
}

.selected-symbols {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 1.1rem;
}

.selected-symbols strong {
    margin-right: 0.5rem;
}

.selected-count {
    color: var(--soft-gray);
    margin-left: 0.5rem;
}

/* Kakemono Section */
.kakemono-section {
    position: sticky;
    top: 100px;
    text-align: center;
}

.kakemono-container {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}

.kakemono-frame {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.kakemono-rod {
    width: 220px;
    height: 20px;
    background: linear-gradient(180deg, #8B4513 0%, #5D3A1A 50%, #8B4513 100%);
    border-radius: 3px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.3);
}

.kakemono-rod.top {
    margin-bottom: -5px;
    z-index: 2;
}

.kakemono-rod.bottom {
    margin-top: -5px;
    z-index: 2;
}

.kakemono-canvas {
    border: none;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
}

.scroll-empty {
    color: var(--soft-gray);
    font-style: italic;
    margin-top: 1rem;
}

.scroll-actions {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin-top: 1.5rem;
}

.scroll-actions .btn {
    width: 100%;
}

/* Info Section */
.info-section {
    margin-top: 4rem;
    padding: 3rem;
    background: linear-gradient(135deg, var(--ink-black) 0%, var(--deep-brown) 100%);
    border-radius: 20px;
    color: var(--paper-cream);
}

.info-section h3 {
    font-family: 'Zen Antique', serif;
    font-size: 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.info-steps {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

.info-step {
    text-align: center;
}

.step-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: var(--vermillion);
    color: white;
    border-radius: 50%;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.info-step p {
    opacity: 0.9;
    line-height: 1.6;
}

/* Footer */
.customize-footer {
    background: var(--ink-black);
    color: var(--paper-cream);
    padding: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.customize-footer a {
    color: var(--gold-accent);
    text-decoration: none;
}

.customize-footer a:hover {
    text-decoration: underline;
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-box {
    background: var(--paper-cream);
    border-radius: 16px;
    padding: 2.5rem;
    max-width: 450px;
    width: 100%;
    text-align: center;
}

.modal-box h2 {
    font-family: 'Zen Antique', serif;
    color: var(--ink-black);
    margin-bottom: 1rem;
}

.modal-box p {
    color: var(--soft-gray);
    margin-bottom: 1.5rem;
}

.modal-preview {
    background: white;
    padding: 1.5rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
}

.preview-chars {
    font-family: 'Noto Serif JP', serif;
    font-size: 2rem;
    margin-top: 0.5rem;
    color: var(--ink-black);
}

.modal-buttons {
    display: flex;
    gap: 1rem;
}

.modal-buttons .btn {
    flex: 1;
}

/* Button Secondary */
.btn-secondary {
    background: var(--gold-accent);
    color: var(--ink-black);
    border: none;
}

.btn-secondary:hover {
    background: #b89848;
}

/* Navigation for this page */
.customize-hero + .customize-main {
    margin-top: 0;
}

/* Responsive */
@media (max-width: 1024px) {
    .customize-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
    
    .kakemono-section {
        position: static;
        order: -1;
    }
    
    .info-steps {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .customize-hero {
        padding: 8rem 1.5rem 3rem;
    }
    
    .customize-hero .hero-kanji {
        font-size: 8rem;
        right: 5%;
    }
    
    .customize-main {
        padding: 2rem 1rem;
    }
    
    .category-tabs {
        justify-content: center;
    }
    
    .symbols-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .input-buttons {
        flex-direction: column;
    }
    
    .customize-footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .modal-buttons {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .symbols-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .symbol-kanji {
        font-size: 2rem;
    }
    
    .kakemono-canvas {
        width: 160px;
        height: 400px;
    }
    
    .kakemono-rod {
        width: 180px;
    }
}
