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

/* Hex to Binary Converter Styles */
.hex-binary-converter {
    margin-top: 2rem;
    margin-bottom: 3rem;
}

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

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

.converter-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 1.5rem;
    color: white;
    text-align: center;
}

.direction-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.base-label {
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hex-label {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.bin-label {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
}

.arrow-icon {
    font-size: 1.5rem;
    font-weight: 300;
    opacity: 0.9;
}

.converter-subtitle {
    margin: 0;
    font-size: 0.875rem;
    opacity: 0.9;
    font-weight: 400;
}

.converter-body {
    padding: 2rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.input-wrapper,
.output-wrapper {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    margin-bottom: 0.25rem;
}

.label-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    background: #f3f4f6;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #6b7280;
}

.input-container,
.output-container {
    position: relative;
    display: flex;
    align-items: stretch;
}

.hex-input {
    width: 100%;
    padding: 1rem 3rem 1rem 1rem;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    
    font-size: 1rem;
    font-weight: 600;
    color: #1f2937;
    background: #ffffff;
    transition: all 0.2s ease;
    text-transform: uppercase;
}

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

.hex-input::placeholder {
    color: #9ca3af;
    text-transform: none;
    font-weight: 400;
}

.input-clear {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0.5rem;
    cursor: pointer;
    color: #9ca3af;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: all 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.input-container:hover .input-clear,
.hex-input:not(:placeholder-shown) ~ .input-clear {
    opacity: 1;
    pointer-events: all;
}

.input-clear:hover {
    background: #f3f4f6;
    color: #374151;
}

.binary-output {
    width: 100%;
    padding: 1rem;
    border: 2px solid #10b981;
    border-radius: 12px;
    
    font-size: 0.9375rem;
    line-height: 1.6;
    color: #065f46;
    background: #f0fdf4;
    resize: vertical;
    min-height: 80px;
    letter-spacing: 0.05em;
    word-break: break-all;
    transition: all 0.2s ease;
}

.binary-output:focus {
    outline: none;
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.1);
}

.binary-output::placeholder {
    color: #9ca3af;
}

.conversion-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #9ca3af;
    margin: 0.5rem 0;
}

.copy-button {
    position: absolute;
    right: 0.75rem;
    top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #10b981;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.copy-button:hover {
    background: #059669;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(16, 185, 129, 0.3);
}

.copy-button:active {
    transform: translateY(0);
}

.copy-button.copied {
    background: #059669;
}

.copy-button.copied .copy-text {
    display: none;
}

.copy-button.copied::after {
    content: 'Copied!';
}

.copy-icon {
    width: 18px;
    height: 18px;
}

.validation-message {
    min-height: 1.25rem;
    font-size: 0.875rem;
    color: #dc2626;
    margin-top: 0.25rem;
    padding-left: 0.25rem;
}

.output-info {
    min-height: 1.25rem;
    font-size: 0.75rem;
    color: #6b7280;
    margin-top: 0.25rem;
    padding-left: 0.25rem;
}

.action-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e5e7eb;
}

.action-btn {
    flex: 1;
    min-width: 120px;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: 10px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}

.primary-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.primary-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.secondary-btn {
    background: #f3f4f6;
    color: #374151;
    border: 2px solid #e5e7eb;
}

.secondary-btn:hover {
    background: #e5e7eb;
    border-color: #d1d5db;
}

.link-btn {
    background: transparent;
    color: #667eea;
    border: 2px solid #667eea;
}

.link-btn:hover {
    background: #667eea;
    color: white;
}

.examples-section {
    padding: 2rem;
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
}

.examples-title {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
    margin: 0 0 1.25rem 0;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
}

.example-card {
    background: white;
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    text-align: left;
}

.example-card:hover {
    border-color: #667eea;
    background: #f9fafb;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.example-hex {
    
    font-weight: 700;
    color: #667eea;
    font-size: 0.875rem;
}

.example-arrow {
    color: #9ca3af;
    font-size: 0.875rem;
}

.example-bin {
    
    font-weight: 600;
    color: #10b981;
    font-size: 0.75rem;
    word-break: break-all;
    flex: 1;
    text-align: right;
}

.info-section {
    padding: 2rem;
    background: white;
    border-top: 1px solid #e5e7eb;
}

.info-card {
    max-width: 100%;
}

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

.info-text {
    font-size: 0.9375rem;
    color: #4b5563;
    line-height: 1.6;
    margin: 0 0 1.5rem 0;
}

.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.75rem;
    background: #f9fafb;
    padding: 1rem;
    border-radius: 10px;
}

.info-item {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    padding: 0.75rem;
    background: white;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
}

.info-item strong {
    font-size: 0.75rem;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.info-item code {
    
    font-size: 0.875rem;
    font-weight: 700;
    color: #1f2937;
    background: #f3f4f6;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
}

/* Mobile Responsive Styles */
@media (max-width: 768px) {
    .converter-body {
        padding: 1.5rem;
    }

    .converter-header {
        padding: 1.25rem;
    }

    .direction-indicator {
        gap: 0.75rem;
    }

    .base-label {
        padding: 0.375rem 0.75rem;
        font-size: 0.75rem;
    }

    .arrow-icon {
        font-size: 1.25rem;
    }

    .hex-input,
    .binary-output {
        font-size: 0.875rem;
        padding: 0.875rem;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-btn {
        width: 100%;
    }

    .examples-section,
    .info-section {
        padding: 1.5rem;
    }

    .examples-grid {
        grid-template-columns: 1fr;
    }

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

    .copy-button {
        position: static;
        margin-top: 0.5rem;
        width: 100%;
        justify-content: center;
    }

    .output-container {
        flex-direction: column;
    }
}

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

    .converter-header {
        padding: 1rem;
    }

    .hex-input {
        padding-right: 2.5rem;
    }

    .examples-title,
    .info-title {
        font-size: 1rem;
    }
}
