/* CRC16 Generator Styles */
.crc16-generator {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

.generator-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    max-width: 100%;
}

/* Section Headers */
.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--border-color, #e5e7eb);
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary, #1f2937);
    margin: 0;
}

/* Input Section */
.input-section {
    background: var(--bg-card, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, #e5e7eb);
}

.input-wrapper {
    position: relative;
    margin-bottom: 1.5rem;
}

.text-input {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    font-size: 0.9375rem;
    
    line-height: 1.6;
    color: var(--text-primary, #1f2937);
    background: var(--bg-input, #f9fafb);
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    resize: vertical;
    transition: all 0.2s ease;
}

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

.text-input::placeholder {
    color: var(--text-placeholder, #9ca3af);
}

.input-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.char-indicator {
    font-size: 0.8125rem;
    color: var(--text-muted, #6b7280);
}

/* File Section */
.file-section {
    margin-top: 1.5rem;
}

.divider-line {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
}

.divider-line::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--border-color, #e5e7eb);
}

.divider-text {
    position: relative;
    display: inline-block;
    padding: 0 1rem;
    background: var(--bg-card, #ffffff);
    font-size: 0.8125rem;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.file-zone {
    position: relative;
    border: 2px dashed var(--border-color, #d1d5db);
    border-radius: 8px;
    padding: 2rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: var(--bg-input, #f9fafb);
}

.file-zone:hover {
    border-color: var(--primary-color, #3b82f6);
    background: var(--bg-hover, #f3f4f6);
}

.file-zone.dragover {
    border-color: var(--primary-color, #3b82f6);
    background: rgba(59, 130, 246, 0.05);
    transform: scale(1.01);
}

.file-input {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.file-zone-content {
    pointer-events: none;
}

.file-icon {
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.75rem;
    transition: color 0.2s ease;
}

.file-zone:hover .file-icon {
    color: var(--primary-color, #3b82f6);
}

.file-zone-text {
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-primary, #1f2937);
    margin: 0.5rem 0 0.25rem;
}

.file-zone-subtext {
    font-size: 0.8125rem;
    color: var(--text-muted, #6b7280);
    margin: 0;
}

.file-items {
    margin-top: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: var(--bg-input, #f9fafb);
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    font-size: 0.875rem;
}

.file-item-name {
    flex: 1;
    color: var(--text-primary, #1f2937);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 0.5rem;
}

.file-item-hash {
    
    color: var(--primary-color, #3b82f6);
    font-weight: 600;
    font-size: 0.8125rem;
}

/* Output Section */
.output-section {
    background: var(--bg-card, #ffffff);
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border-color, #e5e7eb);
}

.output-wrapper {
    position: relative;
}

.hash-result {
    width: 100%;
    min-height: 120px;
    padding: 1rem;
    
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-primary, #1f2937);
    background: var(--bg-input, #f9fafb);
    border: 2px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    word-break: break-all;
    white-space: pre-wrap;
    transition: all 0.2s ease;
}

.hash-result.has-result {
    background: var(--bg-success, #f0fdf4);
    border-color: var(--success-color, #10b981);
    color: var(--text-success, #065f46);
    font-weight: 600;
}

.result-placeholder {
    color: var(--text-placeholder, #9ca3af);
    font-style: italic;
}

.output-meta {
    display: flex;
    justify-content: flex-end;
    margin-top: 0.5rem;
}

.result-info {
    font-size: 0.8125rem;
    color: var(--text-muted, #6b7280);
}

/* Buttons */
.btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: transparent;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    color: var(--text-muted, #6b7280);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--bg-hover, #f3f4f6);
    border-color: var(--text-muted, #6b7280);
    color: var(--text-primary, #1f2937);
}

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

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
    background: var(--primary-color, #3b82f6);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-hover, #2563eb);
    transform: translateY(-1px);
    box-shadow: 0 4px 6px rgba(59, 130, 246, 0.2);
}

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

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

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

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

.btn-primary.copied {
    background: var(--success-color, #10b981);
}

.btn-primary.copied:hover {
    background: var(--success-hover, #059669);
}

/* Mobile Responsive */
@media (min-width: 768px) {
    .generator-container {
        grid-template-columns: 1fr 1fr;
        gap: 2rem;
    }
    
    .input-section,
    .output-section {
        padding: 2rem;
    }
    
    .text-input {
        min-height: 180px;
    }
    
    .hash-result {
        min-height: 150px;
    }
}

@media (min-width: 1024px) {
    .generator-container {
        max-width: 1200px;
        margin: 0 auto;
    }
}

/* Dark mode support (if applicable) */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-card: #1f2937;
        --bg-input: #111827;
        --bg-input-focus: #1f2937;
        --bg-hover: #374151;
        --bg-success: #064e3b;
        --text-primary: #f9fafb;
        --text-muted: #9ca3af;
        --text-placeholder: #6b7280;
        --text-success: #6ee7b7;
        --border-color: #374151;
        --primary-color: #60a5fa;
        --primary-hover: #3b82f6;
        --success-color: #34d399;
        --success-hover: #10b981;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(4px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.file-item {
    animation: fadeIn 0.3s ease;
}

.hash-result.has-result {
    animation: fadeIn 0.3s ease;
}
