/* Reset and Base Styles */

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

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.5rem;
    font-weight: 700;
    color: #667eea;
}

.nav-logo i {
    font-size: 2rem;
}

.nav-menu {
    display: flex;
    list-style: none;
    gap: 30px;
}

.nav-link {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: #667eea;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: #667eea;
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* Mobile Navigation */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    cursor: pointer;
    gap: 4px;
    z-index: 1001;
}

.mobile-menu-toggle span {
    width: 25px;
    height: 3px;
    background: #667eea;
    transition: all 0.3s ease;
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(7px, -6px);
}

/* Mobile menu improvements */
@media (max-width: 768px) {
    .mobile-menu-toggle {
        padding: 5px;
        border-radius: 5px;
        transition: background-color 0.3s ease;
    }
    
    .mobile-menu-toggle:hover {
        background-color: rgba(102, 126, 234, 0.1);
    }
    
    .mobile-menu-toggle.active {
        background-color: rgba(102, 126, 234, 0.2);
    }
}

/* Hero Section */
.hero {
    padding: 120px 0 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(2rem, 5vw, 3.5rem);
    font-weight: 700;
    margin-bottom: 20px;
    background: linear-gradient(45deg, #fff, #f0f0f0);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: clamp(1rem, 2.5vw, 1.3rem);
    margin-bottom: 40px;
    opacity: 0.9;
}

.hero-buttons {
    display: flex;
    gap: 20px;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: 2px solid rgba(255, 255, 255, 0.3);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

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

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

.hero-visual {
    margin-top: 60px;
    display: flex;
    justify-content: center;
}

.binary-animation {
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 20px;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.binary-line {
    font-family: 'Courier New', monospace;
    font-size: clamp(1rem, 3vw, 1.5rem);
    font-weight: bold;
    color: #fff;
    margin: 10px 0;
    text-align: center;
}

/* Theory Section */
.theory-section {
    padding: 80px 0;
    background: white;
}

.section-title {
    text-align: center;
    font-size: clamp(2rem, 4vw, 2.5rem);
    font-weight: 700;
    margin-bottom: 20px;
    color: #333;
}

.section-subtitle {
    text-align: center;
    font-size: clamp(1rem, 2.5vw, 1.2rem);
    color: #666;
    margin-bottom: 60px;
}

.theory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 60px;
}

.theory-card {
    background: white;
    padding: 30px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 1px solid #f0f0f0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    overflow: hidden;
}

.theory-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
}

.theory-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.card-icon i {
    font-size: 1.5rem;
    color: white;
}

.theory-card h3 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #333;
}

.theory-card p {
    color: #666;
    line-height: 1.6;
}

/* Mathematical Formulas */
.math-formula {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border: 4px solid #667eea;
    border-radius: 20px;
    padding: 40px;
    margin: 40px 0;
    font-family: 'Times New Roman', serif;
    text-align: center;
    overflow-x: auto;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
    position: relative;
    transform: translateY(0);
    transition: all 0.3s ease;
}

.math-formula:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(102, 126, 234, 0.25);
}

.math-formula::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 6px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 20px 20px 0 0;
}

.math-formula h4 {
    color: #667eea;
    margin-bottom: 25px;
    font-size: 1.6rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-shadow: 0 2px 4px rgba(102, 126, 234, 0.1);
}

.formula-text {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    margin: 20px 0;
    padding: 20px;
    background: linear-gradient(135deg, #ffffff 0%, #f0f4ff 100%);
    border-radius: 15px;
    border: 3px solid #667eea;
    display: inline-block;
    min-width: 400px;
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.1);
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.formula-explanation {
    font-size: 1.1rem;
    color: #444;
    margin-top: 25px;
    text-align: left;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    padding: 25px;
    border-radius: 15px;
    border-left: 6px solid #667eea;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
}

.formula-explanation p {
    margin: 10px 0;
    line-height: 1.7;
    font-size: 1rem;
}

.formula-explanation strong {
    color: #667eea;
    font-weight: 700;
    font-size: 1.05rem;
}

/* Algorithm Flowchart */
.algorithm-flowchart {
    margin: 40px 0;
    text-align: center;
}

.flowchart-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    border: 3px solid #667eea;
    padding: 30px;
    margin: 30px 0;
    overflow: visible;
    position: relative;
    transform: translateY(0);
    transition: all 0.3s ease;
    min-height: 800px;
}

.flowchart-container:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
}

.flowchart-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    border-radius: 20px 20px 0 0;
}

.flowchart-container svg {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    border-radius: 10px;
    overflow: visible;
}

.flowchart-image {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border: 2px solid #e9ecef;
}

.flowchart-caption {
    margin-top: 15px;
    font-style: italic;
    color: #666;
    font-size: 0.95rem;
}

/* Algorithm Steps */
.algorithm-steps {
    margin-top: 60px;
}

.algorithm-steps h3 {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 40px;
    color: #333;
}

.step-container {
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 800px;
    margin: 0 auto;
}

.step {
    display: flex;
    align-items: center;
    gap: 20px;
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.step:hover {
    transform: translateX(10px);
}

.step-number {
    width: 50px;
    height: 50px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h4 {
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 5px;
    color: #333;
}

.step-content p {
    color: #666;
}

/* Recoding Table */
.recoding-table {
    margin-top: 60px;
}

.recoding-table h3 {
    text-align: center;
    font-size: clamp(1.5rem, 3vw, 2rem);
    margin-bottom: 30px;
    color: #333;
}

.table-container {
    overflow-x: auto;
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 20px;
}

.booth-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 1rem;
    min-width: 600px;
}

.booth-table th,
.booth-table td {
    padding: 15px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
}

.booth-table th {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.booth-table tr:nth-child(even) {
    background: #f8f9fa;
}

.booth-table tr:hover {
    background: #e3f2fd;
}

/* Calculator Section */
.calculator-section {
    padding: 80px 0;
    background: #f8f9fa;
}

.calculator-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    margin-bottom: 40px;
}

.input-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    align-items: end;
    margin-bottom: 30px;
}

.input-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.input-group label {
    font-weight: 600;
    color: #333;
}

.input-group input {
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

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

.binary-display {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
    border: 1px solid #e0e0e0;
    font-size: 0.9rem;
}

.binary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.binary-row:last-child {
    margin-bottom: 0;
}

.label {
    font-weight: 600;
    color: #333;
}

.binary-value {
    font-family: 'Courier New', monospace;
    font-weight: bold;
    color: #667eea;
    background: white;
    padding: 5px 10px;
    border-radius: 5px;
    border: 1px solid #e0e0e0;
}

/* Steps Container */
.steps-container {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.steps-container h3 {
    font-size: clamp(1.5rem, 3vw, 1.8rem);
    margin-bottom: 30px;
    color: #333;
}

.steps-controls {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
    justify-content: center;
}

.step-counter {
    font-weight: 600;
    color: #333;
    background: #f0f4ff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
}

.btn-secondary {
    background: #667eea;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-secondary:hover {
    background: #5a6fd8;
    transform: translateY(-2px);
}

.btn-secondary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.steps-table-container {
    overflow-x: auto;
    margin-bottom: 30px;
}

.steps-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
    min-width: 800px;
}

.steps-table th,
.steps-table td {
    padding: 12px 8px;
    text-align: center;
    border-bottom: 1px solid #f0f0f0;
    white-space: nowrap;
}

.steps-table th {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
    position: sticky;
    top: 0;
}

.steps-table tr:nth-child(even) {
    background: #f8f9fa;
}

.steps-table tr.active {
    background: #e3f2fd;
    font-weight: 600;
}

.steps-table tr.completed {
    background: #e8f5e8;
}

.final-result {
    text-align: center;
    padding: 30px;
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    border-radius: 15px;
}

.final-result h4 {
    font-size: 1.5rem;
    margin-bottom: 20px;
}

.result-display {
    display: flex;
    flex-direction: column;
    gap: 15px;
    align-items: center;
}

.result-row {
    display: flex;
    align-items: center;
    gap: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 10px 20px;
    border-radius: 10px;
    min-width: 300px;
    justify-content: space-between;
    flex-wrap: wrap;
}

.result-label {
    font-weight: 600;
    font-size: 1rem;
}

.verification-result {
    font-size: 1rem;
    font-weight: 600;
    color: #90EE90;
}

/* Result Info Section */
.result-info {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.result-details {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 20px;
}

.result-details p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.5;
    color: white;
}

.result-details strong {
    color: #ffd700;
    font-weight: 600;
}

/* Algorithm Selector */
.algorithm-selector {
    margin: 20px 0;
    padding: 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.algorithm-selector label {
    display: block;
    margin-bottom: 15px;
    font-weight: 600;
    color: #667eea;
    font-size: 1.1rem;
}

.radio-group {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.radio-option:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(102, 126, 234, 0.3);
}

.radio-option input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #667eea;
    border-radius: 50%;
    position: relative;
    transition: all 0.3s ease;
}

.radio-option input[type="radio"]:checked + .radio-custom {
    background: #667eea;
}

.radio-option input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: white;
    border-radius: 50%;
}

.radio-option input[type="radio"]:checked ~ span {
    color: #667eea;
    font-weight: 600;
}

/* Algorithm Comparison */
.algorithm-comparison {
    margin-top: 40px;
    padding: 30px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.algorithm-comparison h3 {
    text-align: center;
    margin-bottom: 30px;
    color: #667eea;
    font-size: 1.5rem;
}

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

.comparison-table table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 15px;
    overflow: hidden;
    min-width: 600px;
}

.comparison-table th,
.comparison-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.comparison-table th {
    background: linear-gradient(45deg, #667eea, #764ba2);
    color: white;
    font-weight: 600;
}

.comparison-table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

.comparison-table tr:last-child td {
    border-bottom: none;
}

.result-binary {
    font-family: 'Courier New', monospace;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    font-weight: bold;
    background: rgba(255, 255, 255, 0.2);
    padding: 10px 20px;
    border-radius: 10px;
}

.result-decimal {
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: bold;
}

/* Examples Section */
.examples-section {
    padding: 80px 0;
    background: white;
    margin-bottom: 0;
}

.examples-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.example-card {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    text-align: center;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 2px solid transparent;
}

.example-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.example-card h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.example-card p {
    color: #666;
    margin-bottom: 20px;
}

/* Footer - Fixed to remove blue line and add proper spacing */
.footer {
    background: #333;
    color: white;
    padding: 40px 0 20px;
    margin-top: 80px;
    position: relative;
    border-top: none;
    box-shadow: none;
}

.footer::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    right: 0;
    height: 1px;
    background: transparent;
}

/* Ensure no unwanted spacing or lines above footer */
.examples-section {
    border-bottom: none;
    margin-bottom: 0;
    box-shadow: none;
}

.calculator-section {
    border-bottom: none;
    margin-bottom: 0;
    box-shadow: none;
}

.theory-section {
    border-bottom: none;
    margin-bottom: 0;
    box-shadow: none;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 30px;
}

.footer-info h3 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.footer-info p {
    color: #ccc;
    line-height: 1.6;
}

.footer-developer h4 {
    color: #667eea;
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.footer-developer p {
    color: #ccc;
    margin-bottom: 8px;
}

.footer-developer strong {
    color: #ffd700;
}

.footer-developer a {
    color: #fafbff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-developer a:hover {
    color: #ffd700;
}

.footer-bottom {
    border-top: 1px solid #555;
    padding-top: 20px;
    text-align: center;
}

.footer-bottom p {
    color: #999;
    font-size: 0.9rem;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

.slide-in-left {
    animation: slideInLeft 0.6s ease-out;
}

.pulse {
    animation: pulse 2s infinite;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .container {
        padding: 0 15px;
    }
    
    .nav-container {
        padding: 0 15px;
    }
    
    .calculator-container,
    .steps-container {
        padding: 30px;
    }
}

@media (max-width: 768px) {
    .nav-menu {
        display: none;
        position: fixed;
        top: 70px;
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(10px);
        flex-direction: column;
        padding: 20px;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
        transform: translateY(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
    }
    
    .nav-menu.active {
        display: flex;
        transform: translateY(0);
    }
    
    .nav-menu li {
        margin: 10px 0;
    }
    
    .nav-menu .nav-link {
        display: block;
        padding: 15px 0;
        font-size: 1.1rem;
        border-bottom: 1px solid rgba(102, 126, 234, 0.1);
    }
    
    .nav-menu .nav-link:last-child {
        border-bottom: none;
    }
    
    .mobile-menu-toggle {
        display: flex;
    }
    
    .hero-title {
        font-size: 2.5rem;
    }
    
    .input-section {
        grid-template-columns: 1fr;
    }
    
    .steps-controls {
        flex-direction: column;
        align-items: stretch;
    }
    
    .theory-grid {
        grid-template-columns: 1fr;
    }
    
    .step {
        flex-direction: column;
        text-align: center;
    }
    
    .examples-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 30px;
        text-align: center;
    }
    
    .calculator-container,
    .steps-container {
        padding: 20px;
    }
    
    .result-row {
        flex-direction: column;
        align-items: center;
        text-align: center;
        min-width: auto;
    }
    
    .radio-group {
        flex-direction: column;
    }
    
    /* Mobile responsive for formulas and flowchart */
    .math-formula {
        padding: 20px;
        margin: 20px 0;
    }
    
    .formula-text {
        font-size: 1.2rem;
        min-width: auto;
        padding: 10px;
    }
    
    .flowchart-container {
        padding: 15px;
        margin: 15px 0;
        min-height: 600px;
        overflow: visible;
    }
    
    .flowchart-container svg {
        width: 100%;
        height: auto;
        overflow: visible;
    }
}

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }
    
    .section-title {
        font-size: 2rem;
    }
    
    .calculator-container,
    .steps-container {
        padding: 15px;
    }
    
    .theory-card {
        padding: 20px;
    }
    
    .example-card {
        padding: 20px;
    }
    
    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .steps-table {
        font-size: 0.8rem;
    }
    
    .steps-table th,
    .steps-table td {
        padding: 8px 4px;
    }
}

/* Print Styles */
@media print {
    .navbar,
    .hero-buttons,
    .steps-controls,
    .btn {
        display: none;
    }
    
    .hero {
        padding: 20px 0;
    }
    
    .calculator-container,
    .steps-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}
