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

/* Validator Container */
.validator-container {
    margin-bottom: 3rem;
}

.validator-card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 1px solid #e5e7eb;
}

/* Input Panel */
.input-panel {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
}

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

.panel-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

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

.icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #d1d5db;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #6b7280;
}

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

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

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

.input-wrapper {
    position: relative;
}

.base64-textarea {
    width: 100%;
    min-height: 200px;
    padding: 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.875rem;
    line-height: 1.6;
    resize: vertical;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background: #fafafa;
    color: #1f2937;
}

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

.base64-textarea::placeholder {
    color: #9ca3af;
}

.input-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    font-size: 0.75rem;
    color: #6b7280;
}

.char-count {
    font-weight: 500;
}

.auto-validate-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    color: #10b981;
    font-weight: 500;
}

.auto-validate-indicator svg {
    flex-shrink: 0;
}

/* Result Panel */
.result-panel {
    padding: 1.5rem;
}

.validation-status {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.875rem;
}

.validation-status.waiting {
    background: #f3f4f6;
    color: #6b7280;
}

.validation-status.valid {
    background: #d1fae5;
    color: #065f46;
}

.validation-status.invalid {
    background: #fee2e2;
    color: #991b1b;
}

.status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.status-icon svg {
    width: 100%;
    height: 100%;
}

.result-content {
    margin-top: 1.5rem;
    min-height: 120px;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    color: #9ca3af;
}

.empty-icon {
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-text {
    margin: 0;
    font-size: 0.875rem;
}

/* Validation Details */
.validation-details {
    margin-top: 1rem;
}

.detail-item {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    background: #f9fafb;
    border-radius: 8px;
    border-left: 3px solid #3b82f6;
}

.detail-item.success {
    border-left-color: #10b981;
    background: #f0fdf4;
}

.detail-item.error {
    border-left-color: #ef4444;
    background: #fef2f2;
}

.detail-item.warning {
    border-left-color: #f59e0b;
    background: #fffbeb;
}

.detail-icon {
    flex-shrink: 0;
    margin-top: 0.125rem;
}

.detail-text {
    flex: 1;
    font-size: 0.875rem;
    line-height: 1.5;
}

.detail-label {
    font-weight: 600;
    color: #374151;
    margin-right: 0.5rem;
}

.detail-value {
    color: #6b7280;
}

/* Details Grid */
.details-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.detail-card {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e5e7eb;
}

.detail-header.error-header {
    border-bottom-color: #fecaca;
}

.detail-header.warning-header {
    border-bottom-color: #fde68a;
}

.detail-header svg {
    color: #6b7280;
    flex-shrink: 0;
}

.detail-header.error-header svg {
    color: #dc2626;
}

.detail-header.warning-header svg {
    color: #d97706;
}

.detail-title {
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    margin: 0;
}

.detail-body {
    font-size: 0.875rem;
    line-height: 1.6;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #f3f4f6;
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-weight: 500;
    color: #374151;
}

.info-value {
    color: #6b7280;
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
    font-size: 0.8125rem;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.check-icon {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.check-icon.success {
    color: #10b981;
}

.check-icon.error {
    color: #ef4444;
}

.check-text {
    flex: 1;
    color: #374151;
}

.error-item,
.warning-item {
    padding: 0.75rem;
    margin-bottom: 0.5rem;
    border-radius: 8px;
    font-size: 0.875rem;
    line-height: 1.5;
}

.error-item {
    background: #fef2f2;
    border-left: 3px solid #ef4444;
    color: #991b1b;
}

.warning-item {
    background: #fffbeb;
    border-left: 3px solid #f59e0b;
    color: #92400e;
}

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

    .input-panel,
    .result-panel {
        padding: 1rem;
    }

    .panel-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .panel-actions {
        width: 100%;
        justify-content: flex-end;
    }

    .base64-textarea {
        min-height: 150px;
        font-size: 0.8125rem;
    }

    .details-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
        margin-top: 1.5rem;
    }

    .detail-card {
        padding: 1rem;
    }

    .input-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .icon-btn {
        width: 32px;
        height: 32px;
    }

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

    .validation-status {
        font-size: 0.8125rem;
        padding: 0.375rem 0.75rem;
    }
}

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

    .panel-title {
        color: #f9fafb;
    }

    .base64-textarea {
        background: #111827;
        border-color: #374151;
        color: #f9fafb;
    }

    .base64-textarea:focus {
        border-color: #3b82f6;
        background: #1f2937;
    }

    .icon-btn {
        background: #374151;
        border-color: #4b5563;
        color: #d1d5db;
    }

    .icon-btn:hover {
        background: #4b5563;
        color: #f9fafb;
    }

    .detail-card {
        background: #1f2937;
        border-color: #374151;
    }

    .detail-header {
        border-bottom-color: #374151;
    }

    .info-row {
        border-bottom-color: #374151;
    }
}
