:root {
    /* Main colors */
    --primary-color: #3498db;
    --secondary-color: #2980b9;
    --accent-color: #f39c12;
    --light-bg: #f5f7fa;
    --dark-bg: #2c3e50;
    --success-color: #2ecc71;
    --error-color: #e74c3c;
    --text-color: #333;
    --light-text: #ecf0f1;
    
    /* Additional needed variables for header/footer */
    --primary: #3498db;
    --secondary: #2980b9;
    --background: #ffffff;
    --card: #ffffff;
    --text: #333333;
    --text-secondary: #666666;
    --text-shadow: rgba(0, 0, 0, 0.05);
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    
    /* Other variables */
    --border-radius: 8px;
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
}

.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.page-header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

h1 {
    color: var(--primary-color);
    margin-bottom: 20px;
    font-size: 2.5rem;
    position: relative;
    display: inline-block;
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background-color: var(--accent-color);
    border-radius: 2px;
}

.theme-toggle {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--dark-bg);
    color: var(--light-text);
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: var(--transition);
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.converter-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.main-converter {
    flex: 1;
    min-width: 300px;
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
}

.conversion-type {
    margin-bottom: 20px;
}

.tabs {
    display: flex;
    border-bottom: 2px solid #eee;
    margin-bottom: 20px;
}

.tab {
    padding: 10px 20px;
    cursor: pointer;
    border-bottom: 3px solid transparent;
    transition: var(--transition);
}

.tab.active {
    border-bottom: 3px solid var(--primary-color);
    color: var(--primary-color);
    font-weight: bold;
}

.input-group {
    margin-bottom: 20px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
}

textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 1rem;
    resize: vertical;
    min-height: 100px;
    transition: var(--transition);
}

textarea:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.input-options {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.input-validation {
    font-size: 0.9rem;
    color: var(--error-color);
    height: 20px;
}

button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 1rem;
    font-weight: 600;
    transition: var(--transition);
}

button:hover {
    background-color: var(--secondary-color);
    transform: translateY(-2px);
}

button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
    transform: none;
}

.action-buttons {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.clear-btn {
    background-color: #95a5a6;
}

.clear-btn:hover {
    background-color: #7f8c8d;
}

.result-section {
    margin-top: 30px;
    max-width: 100%;
}

.result-box {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: var(--border-radius);
    border-left: 4px solid var(--primary-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    font-family: monospace;
}

.result-actions {
    display: flex;
    justify-content: flex-end;
    margin-top: 10px;
    gap: 10px;
}

.result-actions button {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.copy-btn {
    background-color: var(--accent-color);
}

.copy-btn:hover {
    background-color: #d35400;
}

.visualization {
    flex: 1;
    min-width: 300px;
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
}

.visualization h2 {
    margin-bottom: 20px;
    color: var(--primary-color);
}

.conversion-steps {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
}

.step {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px dashed #ddd;
    max-width: 100%;
    overflow-wrap: break-word;
    word-wrap: break-word;
    word-break: break-word;
}

.step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-title {
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 5px;
}

.visualization-diagram {
    margin-top: 20px;
    overflow-x: auto;
}

.binary-grid, .octal-grid {
    display: inline-flex;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.bit-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-right: 10px;
    border: 1px solid #ddd;
    padding: 10px;
    border-radius: var(--border-radius);
    background-color: #f5f5f5;
}

.bit {
    font-family: monospace;
    font-size: 1.2rem;
    font-weight: bold;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    margin: 2px;
    background-color: white;
}

.bit.highlighted {
    background-color: rgba(52, 152, 219, 0.2);
    border-color: var(--primary-color);
}

.bit-value {
    font-size: 0.8rem;
    color: #777;
    margin-top: 5px;
}

.arrow-down {
    width: 0;
    height: 0;
    border-left: 10px solid transparent;
    border-right: 10px solid transparent;
    border-top: 10px solid var(--primary-color);
    margin: 10px auto;
}

.octal-result {
    font-family: monospace;
    font-size: 1.5rem;
    padding: 10px;
    background-color: #f0f8ff;
    border: 1px solid #bde0fe;
    border-radius: var(--border-radius);
    display: inline-block;
}

.history-section {
    margin-top: 30px;
    background-color: white;
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--box-shadow);
}

.history-section h2 {
    color: var(--primary-color);
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-clear {
    font-size: 0.9rem;
    background-color: #95a5a6;
    padding: 5px 10px;
}

.history-item {
    border-bottom: 1px solid #eee;
    padding: 10px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.history-item:last-child {
    border-bottom: none;
}

.history-conversion {
    flex: 1;
    min-width: 200px;
}

.history-type {
    font-size: 0.8rem;
    color: #777;
    margin-bottom: 5px;
}

.history-input, .history-output {
    font-family: monospace;
    word-break: break-all;
}

.history-time {
    font-size: 0.8rem;
    color: #777;
    margin-top: 5px;
}

.history-actions {
    display: flex;
    align-items: flex-start;
    gap: 5px;
}

.history-actions button {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 120px;
    background-color: #555;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 5px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
}

.tooltip .tooltiptext::after {
    content: "";
    position: absolute;
    top: 100%;
    left: 50%;
    margin-left: -5px;
    border-width: 5px;
    border-style: solid;
    border-color: #555 transparent transparent transparent;
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1;
}

/* Header Styles - Full Width */
.site-header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
   
    top: 0;
    z-index: 100;
   
    width: 100%;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
   
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: #4f46e5;
    text-decoration: none;
    transition: transform 0.3s ease;
}

.logo:hover {
    transform: scale(1.05);
}

.logo img {
    width: auto;
    height: auto;
    border-radius: 8px;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 2rem;
    margin: 0;
}

.nav-menu a {
    text-decoration: none;
    color: #374151;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

.nav-menu a:hover {
    color: #4f46e5;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after {
    width: 100%;
}

.mobile-menu-btn {
    display: none;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #374151;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.site-footer {
    background-color: #f8f9fa;
    padding: 30px 0;
    margin-top: 60px;
    border-top: 1px solid #e9ecef;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.footer-links {
    display: flex;
    align-items: center;
    gap: 10px;
}

.footer-links a {
    color: #8b5cf6;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.footer-links a:hover {
    color: #7c3aed;
}

.separator {
    color: #8b5cf6;
    font-size: 14px;
}

.footer-copyright {
    color: #6b7280;
    font-size: 14px;
}

.footer-copyright a {
    color: #8b5cf6;
    text-decoration: none;
}

.footer-copyright a:hover {
    color: #7c3aed;
}

@media (max-width: 768px) {
    .footer-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
}
/* Responsive Design */
@media (max-width: 768px) {
    .header-content {
        padding: 1rem;
    }

    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 1.5rem;
       

        border-top: 1px solid rgba(0, 0, 0, 0.1);
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu a {
        padding: 1rem 0;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    }

    .nav-menu a:last-child {
        border-bottom: none;
    }

    .mobile-menu-btn {
        display: block;
    }
}
/* Dark Theme */
body.dark-theme {
    background-color: var(--dark-bg);
    color: var(--light-text);
}

body.dark-theme .main-converter,
body.dark-theme .visualization,
body.dark-theme .educational-section,
body.dark-theme .history-section {
    background-color: #34495e;
    color: var(--light-text);
}

body.dark-theme .theme-toggle {
    background-color: var(--light-bg);
    color: var(--dark-bg);
}

body.dark-theme textarea,
body.dark-theme .result-box,
body.dark-theme .conversion-steps,
body.dark-theme .bit,
body.dark-theme .octal-result {
    background-color: #2c3e50;
    color: var(--light-text);
    border-color: #4a6278;
}

body.dark-theme .bit-group,
body.dark-theme .ref-card {
    background-color: #2c3e50;
    border-color: #4a6278;
}

body.dark-theme .numeral-table th {
    background-color: #2c3e50;
}

body.dark-theme .numeral-table td,
body.dark-theme .numeral-table th {
    border-color: #4a6278;
}

body.dark-theme .tab.active,
body.dark-theme .educational-tab.active {
    color: var(--accent-color);
    border-color: var(--accent-color);
}


body.dark-theme .nav-menu a {
    text-decoration: none;
    color: #ffffff;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

body.dark-theme h1,
body.dark-theme h2,
body.dark-theme .step-title {
    color: var(--accent-color);
}

body.dark-theme .site-header {
    background-color: #34495e;
    color: white;
    border-bottom-color: var(--accent-color);
}

body.dark-theme .site-footer {
    background-color: #34495e;
    border-top-color: var(--accent-color);
}

body.dark-theme .nav-links a {
    color: var(--light-text);
}

body.dark-theme .footer-section h3 {
    color: var(--light-text);
}
@media (max-width: 576px) {
    .main-content {
        padding: 10px;
    }
    
    h1 {
        font-size: 1.75rem;
    }

    h2 {
        font-size: 2rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .ai-badge {
        font-size: 0.75rem;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab {
        border-bottom: none;
        border-left: 3px solid transparent;
        padding: 8px 15px;
    }
    
    .tab.active {
        border-bottom: none;
        border-left: 3px solid var(--primary-color);
    }
    
    .theme-toggle {
        top: 5px;
        right: 5px;
        width: 35px;
        height: 35px;
    }
}

/* Animation */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes highlight {
    0% { background-color: rgba(243, 156, 18, 0.2); }
    100% { background-color: transparent; }
}

.highlight {
    animation: highlight 1.5s ease-out;
}
.main-info {
  max-width: 1160px;
  margin: 0 auto;
  padding: 20px;
  font-family: 'Arial', sans-serif;
  
  border-radius: 8px;
  
}

.main-info h2 {
  color: #2c3e50;
  margin-top: 0;
   margin-bottom: 20px;
  font-size: 24px;
  padding-bottom: 10px;
  border-bottom: 2px solid #3498db;
}

.main-info img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 20px auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.main-info p {
  line-height: 1.6;
  color: #444;
  margin-bottom: 12px;
}

.main-info p:nth-of-type(1) {
  font-size: 16px;
  margin-bottom: 20px;
}

/* Binary to octal examples styling */
.main-info p:nth-of-type(n+2) {
  background-color: #eef8ff;
  padding: 8px 12px;
  border-left: 3px solid #3498db;
  font-family: 'Courier New', monospace;
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 10px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.main-info p:nth-of-type(n+2):hover {
  background-color: #d4eaff;
  transform: translateY(-2px);
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.1);
}

/* Alternate row styling for examples */
.main-info p:nth-of-type(even) {
  border-left-color: #2ecc71;
  background-color: #eefff4;
}

.main-info p:nth-of-type(even):hover {
  background-color: #d4ffe1;
}

/* Mobile responsiveness */
@media (max-width: 600px) {
  .main-info {
    padding: 15px;
  }
  
  .main-info h3 {
    font-size: 20px;
  }
  
  .main-info p:nth-of-type(n+2) {
    display: block;
    width: 100%;
    box-sizing: border-box;
  }
}
.faqs {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
   
    border-radius: 8px;
    
}

.faqs h2 {
    color: #333;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
    border-bottom: 3px solid #3498db;
    padding-bottom: 0.5rem;
}

.faqs h3 {
    color: #2c3e50;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-left: 4px solid #3498db;
    padding-left: 1rem;
}

.faqs p {
    color: #555;
    line-height: 1.6;
    margin-bottom: 1rem;
    padding-left: 1rem;
    text-align: justify;
}

.faqs h3:first-of-type {
    margin-top: 0;
}

@media (max-width: 768px) {
    .faqs {
        margin: 1rem;
        padding: 1rem;
    }
    
    .faqs h2 {
        font-size: 1.5rem;
    }
    
    .faqs h3 {
        font-size: 1.1rem;
    }
}