/* Tool Hero Section - Required by structure rules */
.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);
    }
}

/* Decode Interface */
.decode-interface {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-bottom: 48px;
}

.decode-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;
}

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

.decode-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    padding: 20px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    flex-wrap: wrap;
    gap: 16px;
}

.header-content {
    flex: 1;
    min-width: 200px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: #ffffff;
}

.section-hint {
    font-size: 14px;
    margin: 0;
    opacity: 0.9;
    color: #ffffff;
}

.header-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(10px);
}

.action-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
}

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

.btn-icon {
    font-size: 16px;
    line-height: 1;
}

.btn-text {
    font-size: 14px;
}

/* Input/Output Wrappers */
.input-wrapper,
.output-wrapper {
    position: relative;
    padding: 20px;
    background: #f8f9fa;
}

.json-input {
    width: 100%;
    min-height: 200px;
    padding: 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    background: #ffffff;
    color: #333333;
    resize: vertical;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    outline: none;
}

.json-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.json-input::placeholder {
    color: #999999;
}

.json-output {
    margin: 0;
    padding: 16px;
    background: #ffffff;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    min-height: 200px;
    max-height: 600px;
    overflow: auto;
    font-size: 14px;
    line-height: 1.6;
}

.json-code {
    margin: 0;
    padding: 0;
    color: #333333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.json-code.error {
    color: #dc3545;
}

.json-code.success {
    color: #28a745;
}

/* Status Indicators */
.input-status,
.output-status {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
    font-size: 13px;
    color: #666666;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #999999;
    transition: background-color 0.3s ease;
}

.status-indicator.ready {
    background: #6c757d;
}

.status-indicator.processing {
    background: #ffc107;
    animation: pulse 1.5s ease-in-out infinite;
}

.status-indicator.success {
    background: #28a745;
}

.status-indicator.error {
    background: #dc3545;
}

@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

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

/* Info Section */
.info-section {
    margin-bottom: 48px;
}

.info-card {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.info-title {
    font-size: 24px;
    font-weight: 700;
    margin: 0 0 24px 0;
    color: #333333;
}

.info-content {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.info-item {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.info-number {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 700;
}

.info-text {
    flex: 1;
}

.info-text strong {
    display: block;
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #333333;
}

.info-text p {
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #666666;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .decode-interface {
        gap: 16px;
    }

    .decode-header {
        padding: 16px;
        flex-direction: column;
    }

    .header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .action-btn {
        flex: 1;
        justify-content: center;
        min-width: 100px;
    }

    .input-wrapper,
    .output-wrapper {
        padding: 16px;
    }

    .json-input,
    .json-output {
        min-height: 180px;
        font-size: 13px;
    }

    .info-card {
        padding: 24px 20px;
    }

    .info-title {
        font-size: 20px;
        margin-bottom: 20px;
    }

    .info-item {
        gap: 16px;
    }

    .info-number {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }

    .section-title {
        font-size: 18px;
    }

    .section-hint {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .decode-header {
        padding: 12px;
    }

    .action-btn {
        padding: 6px 12px;
        font-size: 13px;
    }

    .btn-text {
        display: none;
    }

    .action-btn {
        min-width: auto;
        padding: 8px;
    }

    .json-input,
    .json-output {
        min-height: 150px;
        padding: 12px;
        font-size: 12px;
    }

    .info-card {
        padding: 20px 16px;
    }
}

/* Scrollbar Styling */
.json-output::-webkit-scrollbar,
.json-input::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.json-output::-webkit-scrollbar-track,
.json-input::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.json-output::-webkit-scrollbar-thumb,
.json-input::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.json-output::-webkit-scrollbar-thumb:hover,
.json-input::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Dark mode support (if needed) */
@media (prefers-color-scheme: dark) {
    .decode-card {
        background: #1e1e1e;
    }

    .input-wrapper,
    .output-wrapper {
        background: #252525;
    }

    .json-input,
    .json-output {
        background: #2d2d2d;
        border-color: #404040;
        color: #e0e0e0;
    }

    .json-input:focus {
        border-color: #667eea;
        box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2);
    }

    .json-code {
        color: #e0e0e0;
    }

    .info-card {
        background: linear-gradient(135deg, #2d2d2d 0%, #1a1a1a 100%);
    }

    .info-title,
    .info-text strong {
        color: #e0e0e0;
    }

    .info-text p {
        color: #b0b0b0;
    }
}
