/* Tool Hero Section - Required by tool-page-structure.mdc */
.tool-hero {
    display: flex;
    flex-wrap: wrap;
    gap: 32px;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.hero-text {
    flex: 1;
    min-width: 260px;
}

.hero-text h1 {
    font-size: 40px;
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 0;
}

.hero-subtitle {
    font-size: 18px;
    color: var(--text-muted);
    max-width: 640px;
    margin-bottom: 1rem;
    margin-top: 0;
}

@media (max-width: 767px) {
    .hero-text h1 {
        font-size: clamp(1.75rem, 5vw, 2.5rem);
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.125rem);
    }
}

/* Music Generator Container */
.music-generator-container {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

/* Tool Card */
.tool-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.tool-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Card Layout - Two Columns */
.card-layout {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0;
}

/* Section Headers */
.section-header {
    padding: 1.25rem 1.5rem;
    background: #f7fafc;
    border-bottom: 2px solid #e2e8f0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0;
    color: #1a202c;
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.icon-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background: #667eea;
    border-radius: 6px;
    color: #ffffff;
}

.icon-wrapper svg {
    color: #ffffff;
}

/* Columns */
.config-column {
    padding: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.result-column {
    display: flex;
    flex-direction: column;
}

.result-section {
    border-top: 1px solid #e2e8f0;
}

.result-section:first-child {
    border-top: none;
}

.config-content,
.result-content {
    padding: 1.5rem;
}

/* Form Styles */
.form-section {
    margin-bottom: 1.5rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.input-label {
    display: block;
    margin-bottom: 0.5rem;
}

.label-text {
    display: block;
    font-weight: 600;
    font-size: 0.9375rem;
    color: #1a202c;
    margin-bottom: 0.25rem;
}

.label-hint {
    display: block;
    font-size: 0.8125rem;
    color: #718096;
    font-weight: 400;
}

.input-wrapper,
.select-wrapper {
    position: relative;
}

.form-field,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    background: #ffffff;
    color: #1a202c;
    transition: all 0.2s ease;
    
}

.form-field:focus,
.form-select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-field::placeholder {
    color: #a0aec0;
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* Options Group */
.options-group {
    background: #f7fafc;
    border-radius: 12px;
    padding: 1.25rem;
}

.options-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: #1a202c;
    margin: 0 0 1rem 0;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
}

.option-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.option-item:hover {
    background: #edf2f7;
    border-color: #cbd5e0;
}

.option-checkbox {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-indicator {
    position: relative;
    width: 20px;
    height: 20px;
    border: 2px solid #cbd5e0;
    border-radius: 5px;
    background: #ffffff;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.option-checkbox:checked + .option-indicator {
    background: #667eea;
    border-color: #667eea;
}

.option-checkbox:checked + .option-indicator::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 6px;
    height: 10px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: translate(-50%, -60%) rotate(45deg);
}

.option-label {
    font-size: 0.875rem;
    color: #2d3748;
    font-weight: 500;
    user-select: none;
}

/* Action Buttons */
.action-group {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.btn-generate,
.btn-reset {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    
    flex: 1;
    min-width: 140px;
}

.btn-generate {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.btn-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.4);
}

.btn-generate:active {
    transform: translateY(0);
}

.btn-reset {
    background: #ffffff;
    color: #4a5568;
    border: 2px solid #e2e8f0;
}

.btn-reset:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-text {
    font-weight: 600;
}

/* Copy Button */
.btn-copy {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #ffffff;
    color: #4a5568;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-copy:hover {
    background: #f7fafc;
    border-color: #cbd5e0;
    color: #2d3748;
}

.btn-copy:active {
    transform: scale(0.98);
}

.btn-copy.copied {
    background: #48bb78;
    border-color: #48bb78;
    color: #ffffff;
}

.copy-icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-text {
    font-weight: 500;
}

/* Code Output */
.code-container {
    position: relative;
}

.code-output {
    width: 100%;
    padding: 1.25rem;
    font-size: 0.875rem;
    line-height: 1.6;
    background: #1a202c;
    color: #e2e8f0;
    border: none;
    border-radius: 10px;
    resize: vertical;
    min-height: 200px;
    tab-size: 2;
}

.code-output:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.code-output::placeholder {
    color: #718096;
}

/* Preview Area */
.preview-container {
    min-height: 200px;
    padding: 1.5rem;
    background: #f7fafc;
    border-radius: 12px;
    border: 2px dashed #cbd5e0;
}

.preview-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    text-align: center;
}

.placeholder-icon {
    color: #cbd5e0;
    margin-bottom: 1rem;
}

.placeholder-text {
    color: #718096;
    font-size: 0.9375rem;
    margin: 0;
}

/* Preview Content Styles */
#preview-area .custom-audio-player,
#preview-area .playlist-player {
    max-width: 100%;
}

/* Responsive Design */
@media (min-width: 768px) {
    .card-layout {
        grid-template-columns: 1fr 1fr;
    }

    .config-column {
        border-bottom: none;
        border-right: 1px solid #e2e8f0;
        padding: 2rem;
    }

    .result-column {
        padding: 0;
    }

    .result-content {
        padding: 2rem;
    }

    .form-row {
        grid-template-columns: 1fr 1fr;
    }

    .options-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .card-layout {
        grid-template-columns: 1.1fr 1fr;
    }

    .action-group {
        flex-wrap: nowrap;
    }

    .btn-generate,
    .btn-reset {
        flex: 0 1 auto;
    }
}

/* Mobile Optimizations */
@media (max-width: 767px) {
    .music-generator-container {
        margin-top: 1.5rem;
    }

    .config-column,
    .result-content {
        padding: 1.25rem;
    }

    .section-header {
        padding: 1rem 1.25rem;
    }

    .section-title {
        font-size: 1rem;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .action-group {
        flex-direction: column;
    }

    .btn-generate,
    .btn-reset {
        width: 100%;
        min-width: unset;
    }

    .code-output {
        font-size: 0.8125rem;
        padding: 1rem;
        min-height: 150px;
    }
}

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

/* Focus Styles */
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}
