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

/* Repair Tool Wrapper */
.repair-tool-wrapper {
    margin-bottom: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Tool Card */
.tool-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 2rem;
    border: 1px solid #e5e7eb;
}

/* Tool Header */
.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 1rem;
}

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

.tool-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
    color: #111827;
}

.tool-description {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
}

.header-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-action {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1rem;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-action:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    transform: translateY(-1px);
}

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

.btn-icon {
    font-size: 1rem;
}

.btn-text {
    line-height: 1;
}

/* Repair Status Panel */
.repair-status-panel {
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    margin-top: 1.5rem;
}

.status-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
}

.status-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 0.375rem;
}

.status-indicator.success {
    background: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

.status-indicator.warning {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.2);
}

.status-indicator.error {
    background: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

.status-content {
    flex: 1;
}

.status-title {
    font-size: 1rem;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
    color: #111827;
}

.status-message {
    font-size: 0.875rem;
    color: #6b7280;
    margin: 0;
}

.repairs-applied {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.repair-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #374151;
}

.repair-item::before {
    content: "✓";
    color: #10b981;
    font-weight: 600;
    flex-shrink: 0;
}

/* Input Output Grid */
.input-output-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

/* Panel Styles */
.input-panel,
.output-panel {
    display: flex;
    flex-direction: column;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.panel-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin: 0;
}

.panel-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon-only {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 1rem;
}

.btn-icon-only:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.btn-icon-only:active {
    transform: scale(0.95);
}

.textarea-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.base64-input,
.base64-output {
    width: 100%;
    min-height: 256px;
    padding: 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: 'Courier New', 'Monaco', 'Menlo', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    background: #ffffff;
    color: #111827;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.base64-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.base64-output {
    background: #f9fafb;
    color: #374151;
    cursor: default;
}

.char-count {
    position: absolute;
    bottom: 0.5rem;
    right: 0.75rem;
    font-size: 0.75rem;
    color: #9ca3af;
    background: rgba(255, 255, 255, 0.9);
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    pointer-events: none;
}

.base64-output + .char-count {
    background: rgba(249, 250, 251, 0.9);
}

/* Tool Footer */
.tool-footer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
    flex-wrap: wrap;
}

.btn-primary {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 2rem;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    background: #2563eb;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

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

.btn-primary:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

/* Info Cards */
.info-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.info-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.2s ease;
}

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

.info-icon {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.info-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: #111827;
}

.info-text {
    font-size: 0.9375rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* Mobile Responsive */
@media (max-width: 1024px) {
    .tool-card {
        padding: 1.5rem;
    }

    .input-output-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
}

@media (max-width: 768px) {
    .repair-tool-wrapper {
        margin-top: 1.5rem;
        gap: 1.5rem;
    }

    .tool-card {
        padding: 1.25rem;
        border-radius: 12px;
    }

    .tool-header {
        flex-direction: column;
    }

    .tool-title {
        font-size: 1.25rem;
    }

    .tool-description {
        font-size: 0.875rem;
    }

    .base64-input,
    .base64-output {
        min-height: 180px;
        font-size: 0.8125rem;
    }

    .tool-footer {
        flex-direction: column;
    }

    .btn-action,
    .btn-primary {
        width: 100%;
        justify-content: center;
        padding: 1rem 2rem;
    }

    .info-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .info-card {
        padding: 1.25rem;
    }

    .status-header {
        flex-direction: column;
        gap: 0.75rem;
    }

    .status-indicator {
        margin-top: 0;
    }
}

@media (max-width: 480px) {
    .tool-card {
        padding: 1rem;
    }


    .panel-header {
        flex-wrap: wrap;
        gap: 0.5rem;
    }

    .base64-input,
    .base64-output {
        min-height: 150px;
        padding: 0.875rem;
    }

    .char-count {
        font-size: 0.6875rem;
        padding: 0.125rem 0.375rem;
    }
}
