:root {
    /* Main colors */
    --primary: #4a6fa5;
    --secondary: #166088;
    --accent: #4fc3dc;
    --dark: #0b2545;
    --light: #f5f7fa;
    --success: #28a745;
    --danger: #dc3545;
    --warning: #ffc107;
    --info: #17a2b8;
    
    /* Required variables for header and footer */
    --background: #ffffff;
    --card: #ffffff;
    --text: #2c3e50;
    --text-secondary: #546e7a;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --text-shadow: rgba(0, 0, 0, 0.05);
    --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);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    width: 100%;
    overflow-x: hidden;
}

/* 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;
}
main {
    flex: 1;
    display: flex;
    flex-direction: column;
    width: 100%;
}
h2{
     text-align: center;
    font-size: 1.9rem;
    margin-bottom: 10px;
    position: relative;
    color: #000000;

}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
}

.page-header {
    color: rgb(0, 0, 0);
    padding: 30px 0;
    border-radius: 10px 10px 0 0;
    margin-top: 20px;
    position: relative;
    overflow: hidden;
   padding: 20px;
}

.page-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, transparent 49%, rgba(255,255,255,0.1) 50%, transparent 51%);
    background-size: 20px 20px;
}

h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 10px;
    position: relative;
}

.tagline {
    text-align: center;
    font-size: 1.2rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.main-content {
    background-color: #f9f9f9;
    border-radius: 0 0 10px 10px;
    padding: 30px;
   
    margin-bottom: 20px;
}

.converter-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 30px;
}

.input-section, .output-section {
    flex: 1;
    min-width: 300px;
}

.input-section h2, .output-section h2 {
    margin-bottom: 15px;
    color: var(--secondary);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
    display: inline-block;
    font-size: 1.5rem;
}

.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.input-group input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 1rem;
    transition: border 0.3s;
}

.input-group input[type="text"]:focus {
    border-color: var(--accent);
    outline: none;
    box-shadow: 0 0 0 3px rgba(79, 195, 220, 0.2);
}

.input-group small {
    display: block;
    margin-top: 5px;
    color: #666;
}

.buttons {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

button {
    padding: 12px 25px;
    border: none;
    border-radius: 5px;
    background-color: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

button:hover {
    background-color: var(--secondary);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

button:active {
    transform: translateY(0);
    box-shadow: none;
}

button i {
    font-size: 1.2rem;
}

button.secondary {
    background-color: #808080;
}

button.secondary:hover {
    background-color: #666;
}

.output-box {
    background-color: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 1.1rem;
    min-height: 60px;
    margin-bottom: 20px;
      margin-top: 20px;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    background-color: var(--secondary);
    color: white;
    border: none;
    border-radius: 5px;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s;
    padding: 0;
}

.copy-btn:hover {
    opacity: 1;
}

.steps-section {
    margin-top: 30px;
}

.steps-container {
    background-color: #f8f9fa;
    border: 2px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    display: none;
}

.steps-container.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

.step {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ddd;
}

.step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-title {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--secondary);
}

.conversion-table {
    width: 100%;
    border-collapse: collapse;
    margin: 15px 0;
    overflow-x: auto;
}

.conversion-table th {
    background-color: var(--secondary);
    color: white;
    padding: 12px;
    text-align: center;
}

.conversion-table td {
    padding: 12px;
    text-align: center;
    border: 1px solid #ddd;
}

.conversion-table tr:nth-child(even) {
    background-color: #f2f2f2;
}

.bit-highlight {
    font-weight: bold;
    color: var(--accent);
    background-color: rgba(79, 195, 220, 0.1);
    padding: 2px 4px;
    border-radius: 3px;
}

.info-section {
    margin-top: 30px;
    background-color: white;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.info-section h2 {
    color: var(--secondary);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 5px;
    display: inline-block;
    font-size: 1.5rem;
}

.tab-container {
    margin-top: 20px;
}

.tab-buttons {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    overflow-x: auto;
    padding-bottom: 5px;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 10px 20px;
    background-color: #f0f0f0;
    border: none;
    border-radius: 5px 5px 0 0;
    cursor: pointer;
    font-weight: 600;
    color: #555;
    transition: all 0.3s;
}

.tab-btn.active {
    background-color: var(--primary);
    color: white;
}

.tab-content {
    display: none;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 0 5px 5px 5px;
    border: 1px solid #ddd;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in-out;
}

.visual-representation {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 20px;
}

.bit-container {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    justify-content: center;
    flex-wrap: wrap;
}

.bit-box {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 5px;
    font-weight: bold;
    font-size: 1.2rem;
    position: relative;
    perspective: 800px;
    margin: 0 5px;
}

.binary-bit {
    background-color: var(--primary);
    color: white;
}

.gray-bit {
    background-color: var(--secondary);
    color: white;
}

.arrow {
    width: 30px;
    height: 30px;
    color: var(--dark);
    margin: 10px 0;
    animation: bounce 2s infinite;
}

.toggle-container {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.toggle-label {
    margin-right: 10px;
    font-weight: 600;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 60px;
    height: 34px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 34px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .toggle-slider {
    background-color: var(--primary);
}

input:checked + .toggle-slider:before {
    transform: translateX(26px);
}

.toggle-text {
    margin-left: 10px;
    font-weight: 600;
    transition: color 0.3s;
}

.error-message {
    color: var(--danger);
    font-weight: 600;
    margin-top: 5px;
    display: none;
}

.error-message.active {
    display: block;
    animation: shake 0.5s;
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: pointer;
    margin-left: 5px;
}

.tooltip-text {
    visibility: hidden;
    width: 200px;
    background-color: var(--dark);
    color: white;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 0.9rem;
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: var(--success);
    color: white;
    padding: 15px 25px;
    border-radius: 5px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transform: translateX(150%);
    transition: transform 0.5s;
    z-index: 1000;
}

.notification.active {
    transform: translateX(0);
}

.particles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 0;
}

.particle {
    position: absolute;
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    animation: float linear infinite;
}
.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;
    }
}
@media (max-width: 576px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.75rem;
    }

    .site-header h2 {
        font-size: 1.75rem;
    }

    .subtitle {
        font-size: 0.95rem;
    }

    .ai-badge {
        font-size: 0.75rem;
    }
    
    .main-content {
        padding: 15px;
    }
    
    .info-section {
        padding: 15px;
    }
    
    .tab-content {
        padding: 15px;
    }
}
/* CSS targeting only the main-article div and its children */
.main-article {
  font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
  line-height: 1.6;
  color: #333;
  max-width: 1200px;
  margin: 0 auto;
  padding: 25px;
 
  border-radius: 8px;
 
}

/* Headings inside main-article */
.main-article h3 {
  color: #2c3e50;
  border-bottom: 2px solid #3498db;
  padding-bottom: 8px;
  margin-top: 30px;
  margin-bottom: 20px;
  font-size: 1.4em;
}

/* First heading should have no top margin */
.main-article h3:first-of-type {
  margin-top: 0;
}

/* Paragraphs inside main-article */
.main-article p {
  margin-bottom: 16px;
  text-align: justify;
}

/* Lists inside main-article */
.main-article ul,
.main-article ol {
  margin-bottom: 20px;
  padding-left: 25px;
}

.main-article li {
  margin-bottom: 10px;
}

/* Strong elements for emphasis */
.main-article strong {
  color: #2980b9;
  font-weight: 600;
}

/* Mathematical notation styling - special styling for formula list */
.main-article ul:first-of-type {
  background-color: #f6f8fa;
  padding: 15px 25px;
  border-radius: 5px;
  border-left: 4px solid #2ecc71;
  font-family: 'Courier New', Courier, monospace;
}

/* Mathematical description paragraph special styling */
.main-article p:nth-of-type(5) {
  background-color: #f8f9fa;
  padding: 12px;
  border-left: 4px solid #3498db;
  border-radius: 4px;
}

/* XOR symbol emphasis */
.main-article ul:first-of-type li:not(:first-child)::after {
  content: "";
  display: block;
  height: 1px;
  width: 50%;
  background-color: #e0e0e0;
  margin-top: 8px;
}

/* Image styling */
.main-article img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px auto;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .main-article {
    padding: 15px;
  }
  
  .main-article h3 {
    font-size: 1.2em;
  }
  
  .main-article img {
    margin: 15px auto;
  }
}
.faq-container {
            padding: 30px;
            margin: 20px 0;
             max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    width: 100%;
        }
      .faq-container  h2 {
            color: #2c3e50;
            text-align: center;
            margin-bottom: 30px;
            font-size: 2.2em;
        }
      .faq-container  h3 {
            color: #3498db;
            margin-top: 25px;
            margin-bottom: 10px;
            font-size: 1.3em;
            border-left: 4px solid #3498db;
            padding-left: 15px;
        }
     .faq-container   p {
            margin-bottom: 15px;
            color: #555;
            text-align: justify;
        }
        .highlight {
            background: linear-gradient(120deg, #a8e6cf 0%, #dcedc8 100%);
            padding: 2px 4px;
            border-radius: 3px;
        }
        .code {
            background: #f4f4f4;
            padding: 2px 6px;
            border-radius: 4px;
            font-family: 'Courier New', monospace;
            color: #e74c3c;
        }