/* =====================================================
   HEX CONVERTER TOOL STYLES - COMPLETE
   Matrix Portal - Free Conversion Tool
   Self-contained with all required base styles
   ===================================================== */

/* ============================================
   BASE & RESET STYLES
   ============================================ */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background: #000;
    color: #0f0;
    font-family: 'Courier New', monospace;
    overflow-x: hidden;
    min-height: 100vh;
    line-height: 1.6;
}

/* ============================================
   TOOL CONTAINER
   ============================================ */

.tool-container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 20px;
    position: relative;
    z-index: 5;
}

/* ============================================
   TOOL HEADER
   ============================================ */

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
    position: relative;
}

.tool-header h1 {
    font-size: 2.5em;
    margin-bottom: 15px;
    color: #00ff41;
    text-shadow: 0 0 15px rgba(0, 255, 65, 0.5);
}

.tool-badge {
    position: absolute;
    top: 15px;
    right: 15px;
    background: linear-gradient(135deg, #00ff41, #00aa2b);
    color: #000;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    font-weight: bold;
    font-size: 0.9rem;
    text-transform: uppercase;
    box-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}

.subtitle {
    color: #00aaff;
    font-size: 1.2rem;
    margin: 0.5rem 0 0 0;
}

/* ============================================
   BREADCRUMB NAVIGATION
   ============================================ */

.breadcrumb {
    text-align: center;
    color: #00ff41;
    font-size: 0.95rem;
    margin-bottom: 2rem;
    padding: 10px;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 8px;
}

.breadcrumb a {
    color: #00ff41;
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb a:hover {
    color: #00ffaa;
    text-shadow: 0 0 10px rgba(0, 255, 170, 0.5);
}

/* ============================================
   CONVERSION SELECTOR
   ============================================ */

.conversion-selector {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    margin: 2rem 0;
    padding: 2rem;
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    flex-wrap: wrap;
}

.selector-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    min-width: 250px;
}

.selector-group label {
    color: #00ffaa;
    font-size: 0.9rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.format-select {
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.8rem;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
}

.format-select:hover {
    border-color: #00ffaa;
    box-shadow: 0 0 15px rgba(0, 255, 170, 0.3);
}

.format-select:focus {
    outline: none;
    border-color: #00ffaa;
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.5);
}

.format-select option {
    background: #001100;
    color: #00ff41;
}

.arrow-icon {
    font-size: 2rem;
    color: #00ff41;
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.2); }
}

/* ============================================
   MAIN TOOL BOX
   ============================================ */

.tool-box {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.3);
}

/* ============================================
   CONVERSION SECTIONS
   ============================================ */

.conversion-section {
    margin: 2rem 0;
}

.section-title {
    color: #00ff41;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    border-bottom: 1px solid rgba(0, 255, 65, 0.3);
    padding-bottom: 0.5rem;
}

.format-hint {
    color: #888;
    font-size: 0.9rem;
    font-style: italic;
    margin-bottom: 1rem;
}

/* ============================================
   CONVERSION TEXTAREA
   ============================================ */

.conversion-textarea {
    width: 100%;
    background: rgba(0, 0, 0, 0.7);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 1rem;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    resize: vertical;
    min-height: 150px;
    transition: all 0.3s ease;
    line-height: 1.5;
}

.conversion-textarea:focus {
    outline: none;
    border-color: #00ffaa;
    box-shadow: 0 0 20px rgba(0, 255, 170, 0.5);
}

.conversion-textarea::placeholder {
    color: rgba(0, 255, 65, 0.3);
}

.conversion-textarea[readonly] {
    opacity: 0.9;
    cursor: default;
}

/* ============================================
   INPUT/OUTPUT STATS
   ============================================ */

.input-stats,
.output-stats {
    color: #00aaff;
    font-size: 0.85rem;
    margin: 0.5rem 0 1rem 0;
    font-family: 'Courier New', monospace;
}

.input-stats span,
.output-stats span {
    color: #00ff41;
    font-weight: bold;
}

/* ============================================
   QUICK ACTIONS
   ============================================ */

.quick-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ============================================
   CONVERT BUTTON CONTAINER
   ============================================ */

.convert-button-container {
    text-align: center;
    margin: 2rem 0;
}

/* ============================================
   ACTION BUTTONS
   ============================================ */

.action-btn {
    background: rgba(0, 17, 0, 0.9);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 0.8rem 1.5rem;
    border-radius: 5px;
    font-size: 1rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: bold;
    text-decoration: none;
    display: inline-block;
}

.action-btn:hover {
    background: #00ff41;
    color: #000;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.5);
    transform: translateY(-2px);
}

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

.action-btn.primary {
    background: linear-gradient(135deg, #00ff41, #00aa2b);
    color: #000;
    border-color: #00ff41;
}

.action-btn.primary:hover {
    background: linear-gradient(135deg, #00ffaa, #00ff41);
    box-shadow: 0 0 30px rgba(0, 255, 65, 0.7);
}

.action-btn.secondary {
    background: rgba(0, 17, 0, 0.9);
    font-size: 0.9rem;
    padding: 0.6rem 1.2rem;
}

.action-btn.large {
    font-size: 1.3rem;
    padding: 1.2rem 3rem;
}

.btn-icon {
    margin-right: 0.5rem;
}

/* ============================================
   OPTIONS PANEL
   ============================================ */

.options-panel {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 1.5rem;
}

.option-group {
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 5px;
}

.option-group h4 {
    color: #00ffaa;
    font-size: 1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ============================================
   CHECKBOX AND RADIO LABELS
   ============================================ */

.checkbox-label,
.radio-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #00ff41;
    font-size: 0.9rem;
    margin: 0.5rem 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.checkbox-label:hover,
.radio-label:hover {
    color: #00ffaa;
    text-shadow: 0 0 5px rgba(0, 255, 170, 0.5);
}

.checkbox-label input[type="checkbox"],
.radio-label input[type="radio"] {
    cursor: pointer;
    width: 18px;
    height: 18px;
    accent-color: #00ff41;
}

/* ============================================
   REFERENCE SECTION
   ============================================ */

.reference-section {
    margin: 2rem 0;
}

.section-toggle {
    width: 100%;
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    color: #00ff41;
    padding: 1rem 1.5rem;
    border-radius: 5px;
    font-size: 1.1rem;
    font-family: 'Courier New', monospace;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1rem 0;
}

.section-toggle:hover {
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
}

.toggle-icon {
    transition: transform 0.3s ease;
    display: inline-block;
}

.section-toggle.active .toggle-icon {
    transform: rotate(-180deg);
}

.reference-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.5s ease;
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid rgba(0, 255, 65, 0.5);
    border-top: none;
    border-radius: 0 0 5px 5px;
}

.reference-content.active {
    max-height: 2000px;
    padding: 2rem;
}

/* ============================================
   ASCII TABLE
   ============================================ */

.table-container {
    overflow-x: auto;
}

.ascii-table {
    width: 100%;
    border-collapse: collapse;
    font-family: 'Courier New', monospace;
    font-size: 0.85rem;
}

.ascii-table thead {
    background: rgba(0, 255, 65, 0.1);
}

.ascii-table th,
.ascii-table td {
    border: 1px solid rgba(0, 255, 65, 0.3);
    padding: 0.5rem;
    text-align: center;
}

.ascii-table th {
    color: #00ffaa;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ascii-table td {
    color: #00ff41;
}

.ascii-table tbody tr:hover {
    background: rgba(0, 255, 65, 0.1);
}

/* ============================================
   GUIDE GRID
   ============================================ */

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

.guide-item {
    padding: 1.5rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 5px;
}

.guide-item h4 {
    color: #00ffaa;
    font-size: 1.1rem;
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.guide-item p {
    color: #888;
    line-height: 1.6;
    margin-bottom: 1rem;
}

.guide-item ul {
    list-style: none;
    padding: 0;
}

.guide-item ul li {
    color: #00ff41;
    line-height: 1.8;
    padding-left: 1.5rem;
    position: relative;
}

.guide-item ul li::before {
    content: "▸";
    position: absolute;
    left: 0;
    color: #00ffaa;
}

.guide-item code {
    background: rgba(0, 0, 0, 0.7);
    color: #00ffaa;
    padding: 0.2rem 0.5rem;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
}

/* ============================================
   INFO SECTION
   ============================================ */

.info-section {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.info-content h3 {
    color: #00ffaa;
    font-size: 1.3rem;
    margin: 1.5rem 0 1rem 0;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.info-content p {
    color: #888;
    line-height: 1.8;
    margin-bottom: 1rem;
}

.info-list {
    color: #00ff41;
    line-height: 2;
    padding-left: 2rem;
}

.info-list li {
    margin: 0.5rem 0;
}

.info-list strong {
    color: #00ffaa;
}

/* ============================================
   CONSOLE HELP
   ============================================ */

.console-help {
    background: rgba(0, 17, 0, 0.95);
    border: 2px solid #00ff41;
    border-radius: 10px;
    padding: 2rem;
    margin: 2rem 0;
}

.console-help h3 {
    color: #00ffaa;
    font-size: 1.3rem;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.command-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1rem;
}

.command-item {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 255, 65, 0.3);
    border-radius: 5px;
    transition: all 0.3s ease;
}

.command-item:hover {
    border-color: #00ff41;
    box-shadow: 0 0 15px rgba(0, 255, 65, 0.3);
    transform: translateY(-2px);
}

.command-item code {
    color: #00ffaa;
    font-size: 1rem;
    font-weight: bold;
}

.command-item span {
    color: #888;
    font-size: 0.85rem;
}

.console-note {
    color: #888;
    font-size: 0.9rem;
    font-style: italic;
    text-align: center;
    margin-top: 1rem;
}

/* ============================================
   BACK LINK
   ============================================ */

.back-link {
    text-align: center;
    margin: 3rem 0 2rem 0;
}

/* ============================================
   MESSAGES
   ============================================ */

.message {
    padding: 1rem;
    border-radius: 5px;
    margin: 1rem 0;
    font-family: 'Courier New', monospace;
    animation: slideIn 0.3s ease;
}

.message.success {
    background: rgba(0, 255, 65, 0.1);
    border: 1px solid #00ff41;
    color: #00ff41;
}

.message.error {
    background: rgba(255, 0, 0, 0.1);
    border: 1px solid #ff4444;
    color: #ff4444;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   LOADING STATE
   ============================================ */

.loading {
    opacity: 0.5;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: "⚡ Converting...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 17, 0, 0.95);
    color: #00ff41;
    padding: 1rem 2rem;
    border: 2px solid #00ff41;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 1.2rem;
    animation: blink 1s infinite;
}

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

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .conversion-selector {
        flex-direction: column;
        gap: 1rem;
    }
    
    .arrow-icon {
        transform: rotate(90deg);
    }
    
    .selector-group {
        width: 100%;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
    }
    
    .quick-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
    }
    
    .command-grid {
        grid-template-columns: 1fr;
    }
    
    .guide-grid {
        grid-template-columns: 1fr;
    }
    
    .tool-header h1 {
        font-size: 1.8em;
    }
    
    .section-title {
        font-size: 1.2rem;
    }
}