/* 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);
    }
}

/* Decoder Interface */
.decoder-interface {
    margin-bottom: 48px;
}

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

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

/* Card Header */
.card-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: #ffffff;
    margin: 0;
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

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

.btn-icon.btn-small {
    width: 28px;
    height: 28px;
    background: rgba(102, 126, 234, 0.1);
    border-color: rgba(102, 126, 234, 0.2);
    color: #667eea;
}

.btn-icon.btn-small:hover {
    background: rgba(102, 126, 234, 0.2);
}

.btn-icon svg {
    flex-shrink: 0;
}

/* Card Body */
.card-body {
    padding: 20px;
}

/* Decoder Split Layout */
.decoder-split {
    display: flex;
    gap: 20px;
    align-items: stretch;
}

.decoder-panel {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 12px;
    border-bottom: 1px solid #e2e8f0;
}

.panel-title {
    font-size: 16px;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: 6px;
}

.panel-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 300px;
}

.panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e2e8f0;
}

/* Decoder Divider */
.decoder-divider {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    color: #cbd5e0;
    position: relative;
}

.decoder-divider::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 1px;
    background: #e2e8f0;
    transform: translateX(-50%);
}

.decoder-divider svg {
    position: relative;
    z-index: 1;
    background: #ffffff;
    padding: 4px;
}

/* Base64 Input */
.base64-input {
    width: 100%;
    flex: 1;
    min-height: 300px;
    padding: 16px;
    font-size: 14px;
    line-height: 1.6;
    color: #2d3748;
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    resize: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.base64-input::placeholder {
    color: #a0aec0;
}

/* JSON Output */
.json-output {
    width: 100%;
    flex: 1;
    min-height: 300px;
    max-height: 600px;
    padding: 16px;
    margin: 0;
    font-size: 14px;
    line-height: 1.6;
    color: #2d3748;
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    overflow-x: auto;
    overflow-y: auto;
    white-space: pre;
    word-wrap: normal;
}

.json-code {
    display: block;
    margin: 0;
    padding: 0;
    font-size: inherit;
    line-height: inherit;
    color: inherit;
}

/* JSON Syntax Highlighting */
.json-output .json-code {
    color: #2d3748;
}

.json-output .json-key {
    color: #2d5ada;
    font-weight: 500;
}

.json-output .json-string {
    color: #cc5b5c;
}

.json-output .json-number {
    color: #008100;
}

.json-output .json-boolean {
    color: #0b7500;
    font-weight: 500;
}

.json-output .json-null {
    color: #808080;
    font-style: italic;
}

.json-output .json-error {
    color: #e53e3e;
    background: #fed7d7;
    padding: 2px 4px;
    border-radius: 4px;
}

/* Removed - using panel-footer instead */

.char-count {
    font-size: 13px;
    color: #718096;
    font-weight: 500;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #718096;
}

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

.status-indicator.success .status-dot {
    background: #48bb78;
}

.status-indicator.error .status-dot {
    background: #f56565;
}

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

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

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

.status-indicator.success .status-text {
    color: #48bb78;
}

.status-indicator.error .status-text {
    color: #f56565;
}

/* Removed - using divider instead */

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

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 24px;
}

.info-card {
    padding: 24px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.info-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
}

.info-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    color: #ffffff;
    margin-bottom: 16px;
}

.info-card h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2d3748;
    margin: 0 0 12px 0;
}

.info-card p {
    font-size: 14px;
    line-height: 1.6;
    color: #4a5568;
    margin: 0;
}

/* Mobile Responsive */
@media (max-width: 767px) {
    .decoder-card {
        border-radius: 8px;
    }

    .card-header {
        padding: 12px 16px;
    }

    .card-title {
        font-size: 16px;
    }

    .btn-icon {
        width: 32px;
        height: 32px;
    }

    .btn-icon svg {
        width: 16px;
        height: 16px;
    }

    .card-body {
        padding: 16px;
    }

    .decoder-split {
        flex-direction: column;
        gap: 16px;
    }

    .decoder-divider {
        width: 100%;
        height: 40px;
        transform: rotate(90deg);
    }

    .decoder-divider::before {
        left: 0;
        right: 0;
        top: 50%;
        bottom: auto;
        width: auto;
        height: 1px;
        transform: translateY(-50%);
    }

    .panel-content {
        min-height: 250px;
    }

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

    .panel-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .info-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .info-card {
        padding: 20px;
    }

    .info-icon {
        width: 40px;
        height: 40px;
    }

    .info-icon svg {
        width: 20px;
        height: 20px;
    }
}

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

    .panel-header {
        border-bottom-color: #4a5568;
    }

    .panel-title {
        color: #e2e8f0;
    }

    .base64-input,
    .json-output {
        background: #2d3748;
        border-color: #4a5568;
        color: #e2e8f0;
    }

    .json-output {
        background: #252f3f;
    }

    .panel-footer {
        border-top-color: #4a5568;
    }

    .decoder-divider::before {
        background: #4a5568;
    }

    .decoder-divider svg {
        background: #1a202c;
    }

    .info-card {
        background: #1a202c;
    }

    .info-card h3 {
        color: #e2e8f0;
    }

    .info-card p {
        color: #cbd5e0;
    }
}
