/* Main Website Styles */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: 'Segoe UI', Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
    background: #fff !important;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ========== HEADER STYLES ========== */
.site-header {
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 1000;
    border-bottom: 1px solid #e5e7eb;
}

.header-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Top Bar */
.header-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
}

/* Logo */
.logo {
    display: flex;
    align-items: center;
    text-decoration: none;
    flex-shrink: 0;
    transition: opacity 0.2s;
}

.logo:hover {
    opacity: 0.9;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #4a90d9 0%, #357abd 100%);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    position: relative;
    box-shadow: 0 2px 8px rgba(74, 144, 217, 0.3);
}

.logo-icon::before {
    content: '';
    position: absolute;
    top: 8px;
    left: 8px;
    right: 8px;
    height: 8px;
    background: #fff;
    border-radius: 2px;
}

.logo-icon::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 7px;
    height: 7px;
    background: #ffc107;
    border-radius: 2px;
}

.logo-text {
    font-size: 1.3rem;
    font-weight: 700;
    color: #1f2937;
    letter-spacing: -0.3px;
}

.logo-text span {
    color: #4a90d9;
}

/* Mobile Menu Toggle */
.mobile-menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.2s;
}

.mobile-menu-toggle:hover {
    background: #f3f4f6;
}

.mobile-menu-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: #374151;
    margin: 5px 0;
    border-radius: 1px;
    transition: all 0.3s;
}

/* Navigation */
.main-nav {
    border-top: 1px solid #f3f4f6;
    background: #fafafa;
}

.nav-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 2px;
}

.nav-list li {
    margin: 0;
}

.nav-list a {
    display: block;
    padding: 12px 16px;
    color: #4b5563;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border-bottom: 2px solid transparent;
    position: relative;
}

.nav-list a:hover {
    color: #4a90d9;
    background: #f0f7ff;
}

.nav-list a.active {
    color: #4a90d9;
    background: #fff;
    border-bottom-color: #4a90d9;
}

.nav-list a svg {
    width: 16px;
    height: 16px;
    margin-right: 6px;
    vertical-align: middle;
}

/* Ad Banner Space */
.ad-banner {
    background: #fff;
    text-align: center;
    padding: 10px;
    min-height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #eee;
}

/* Main Content Area */
.main-wrapper {
    max-width: 900px;
    margin: 0 auto;
    padding: 20px;
    background: #fff;
    min-height: 100vh;
}

/* Calculator Section */
.calculator-section {
    text-align: center;
    padding: 10px 0 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid #ddd;
}

.calculator-section h1 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    text-align: center;
}

.subtitle {
    color: #666;
    margin-bottom: 15px;
    font-size: 0.95rem;
    display: block;
}

/* Calculator - New Blue Theme */
.calculator {
    display: inline-block;
    background: linear-gradient(180deg, #e8e8e8 0%, #d5d5d5 100%);
    border: 1px solid #aaa;
    border-radius: 10px;
    padding: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}

.display {
    width: 232px;
    height: 48px;
    border: 1px solid #888;
    border-radius: 5px;
    background: #fff;
    font-size: 1.6rem;
    text-align: right;
    padding: 0 12px;
    margin-bottom: 10px;
    font-family: 'Courier New', monospace;
    color: #333;
}

.buttons {
    display: grid;
    grid-template-columns: repeat(4, 56px);
    gap: 6px;
}

.btn {
    height: 44px;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.1s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.btn:hover { 
    transform: translateY(-2px);
    box-shadow: 0 5px 10px rgba(0,0,0,0.2);
}

.btn:active { 
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

/* Number Buttons - Light Gray */
.btn.num { 
    background: linear-gradient(180deg, #f5f5f5 0%, #e8e8e8 100%);
    color: #333;
    border: 1px solid #bbb;
}

/* Operator Buttons - Orange/Yellow */
.btn.op { 
    background: linear-gradient(180deg, #ffca28 0%, #ffc107 100%);
    color: #333;
    border: 1px solid #f9a825;
}

/* Function Buttons - Gray */
.btn.fn { 
    background: linear-gradient(180deg, #bdbdbd 0%, #9e9e9e 100%);
    color: #333;
    border: 1px solid #888;
}

/* Memory Buttons - Light Gray */
.btn.mem { 
    background: linear-gradient(180deg, #e0e0e0 0%, #bdbdbd 100%);
    color: #555;
    font-size: 0.9rem;
    border: 1px solid #999;
}

/* Equals Button - Orange/Yellow */
.btn.eq { 
    background: linear-gradient(180deg, #ffca28 0%, #ffc107 100%);
    color: #333;
    border: 1px solid #f9a825;
}

.calc-footer {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #888;
}

/* Content Section */
.content {
    text-align: left;
    padding: 0 20px 0 0;
    max-width: 100%;
}

.content section {
    margin-bottom: 25px;
}

.content h2 {
    font-size: 1.25rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 12px;
    text-align: left;
}

.content h3 {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    margin: 15px 0 10px;
    text-align: left;
}

.content p {
    margin-bottom: 10px;
    color: #333;
    text-align: left;
}

.content a { color: #800080; text-decoration: underline; }
.content a:hover { color: #4b0082; }

.content ul, .content ol {
    margin-left: 25px;
    margin-bottom: 12px;
    text-align: left;
}

.content li { margin-bottom: 6px; color: #333; text-align: left; }

/* Page Content */
.page-content {
    max-width: 700px;
    margin: 20px auto;
    padding: 20px;
}

.page-content h1 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.6rem;
    border-bottom: 2px solid #4a90d9;
    padding-bottom: 10px;
}

.page-content h2 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin: 25px 0 12px;
    padding-top: 10px;
}

.page-content h3 {
    font-size: 1.05rem;
    color: #333;
    margin: 18px 0 10px;
}

.page-content p {
    margin-bottom: 12px;
    line-height: 1.7;
    color: #444;
}

.page-content ul, .page-content ol {
    margin: 10px 0 15px 25px;
}

.page-content li {
    margin-bottom: 8px;
    line-height: 1.6;
}

.page-content a {
    color: #4a90d9;
    text-decoration: none;
}

.page-content a:hover {
    text-decoration: underline;
}

/* Contact Form */
.contact-form {
    margin-top: 30px;
}

.contact-form .form-group {
    margin-bottom: 20px;
}

.contact-form label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.contact-form input,
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.contact-form input:focus,
.contact-form textarea:focus {
    outline: none;
    border-color: #1976d2;
}

.btn-submit {
    padding: 12px 30px;
    background: #333;
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
}

.btn-submit:hover { 
    background: #555;
}

/* Alerts */
.alert {
    padding: 12px 15px;
    border-radius: 5px;
    margin-bottom: 15px;
}

.alert.success { background: #d4edda; color: #155724; }
.alert.error { background: #f8d7da; color: #721c24; }

/* Other Calculators Section */
.other-calculators {
    margin: 30px 0;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.other-calculators h2 {
    font-size: 1.2rem;
    font-weight: bold;
    color: #000;
    margin-bottom: 12px;
}

.other-calculators ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.other-calculators li {
    margin-bottom: 8px;
}

.other-calculators a {
    color: #800080;
    text-decoration: underline;
}

.other-calculators a:hover {
    color: #4b0082;
}

/* Footer */
.footer {
    background: #f9fafb;
    border-top: 1px solid #e5e7eb;
    color: #4b5563;
    padding: 25px 20px;
    text-align: center;
    margin-top: 40px;
    font-size: 0.875rem;
}

.footer p { 
    margin-bottom: 8px; 
    text-align: center;
    line-height: 1.8;
}

.footer p:last-child {
    margin-bottom: 0;
    color: #6b7280;
    font-size: 0.8rem;
}

.footer a { 
    color: #4a90d9; 
    text-decoration: none;
    transition: color 0.2s;
}

.footer a:hover { 
    color: #357abd;
    text-decoration: underline;
}

/* ========== RESPONSIVE HEADER ========== */
@media (max-width: 768px) {
    .header-top {
        padding: 10px 0;
    }
    
    .mobile-menu-toggle {
        display: block;
    }
    
    .main-nav {
        display: none;
        border-top: none;
        background: #fff;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
        z-index: 999;
    }
    
    .main-nav.active {
        display: block;
    }
    
    .nav-list {
        flex-direction: column;
        gap: 0;
    }
    
    .nav-list a {
        padding: 14px 20px;
        border-bottom: 1px solid #f3f4f6;
        border-left: 3px solid transparent;
    }
    
    .nav-list a:hover,
    .nav-list a.active {
        border-bottom-color: #f3f4f6;
        border-left-color: #4a90d9;
        background: #f0f7ff;
    }
    
    .footer {
        padding: 20px 15px;
    }
    
    .footer p {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .logo-text {
        font-size: 1.15rem;
    }
    
    .logo-icon {
        width: 36px;
        height: 36px;
        font-size: 1.2rem;
        margin-right: 10px;
    }
}

/* Responsive Calculator & Content */
@media (max-width: 600px) {
    .main-wrapper { padding: 15px 10px; }
    
    .calculator-section { padding: 5px 0 15px; }
    .calculator-section h1 { font-size: 1rem; margin-bottom: 8px; }
    
    .calculator { padding: 10px; }
    .buttons { grid-template-columns: repeat(4, 48px); gap: 4px; }
    .btn { height: 38px; font-size: 0.95rem; }
    .display { width: 200px; height: 42px; font-size: 1.3rem; padding: 0 10px; }
    .btn.mem { font-size: 0.8rem; }
    
    .content h2 { font-size: 1.1rem; }
    
    .page-content { padding: 15px; margin: 15px 10px; }
}

@media (max-width: 400px) {
    .calculator { padding: 8px; border-radius: 8px; }
    .buttons { grid-template-columns: repeat(4, 42px); gap: 3px; }
    .btn { height: 35px; font-size: 0.9rem; border-radius: 5px; }
    .display { width: 176px; height: 38px; font-size: 1.2rem; margin-bottom: 8px; }
    .btn.mem { font-size: 0.75rem; }
    .calc-footer { font-size: 0.7rem; margin-top: 8px; }
}

@media (max-width: 350px) {
    .calculator { padding: 6px; }
    .buttons { grid-template-columns: repeat(4, 38px); gap: 2px; }
    .btn { height: 32px; font-size: 0.85rem; }
    .display { width: 158px; height: 35px; font-size: 1.1rem; }
}
