
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f0f2f5;
    color: #1a1a2e;
    line-height: 1.6;
    
    padding: 0;
    margin: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    font-size: 16px;
}

/* ----- NAVBAR - Full Width ----- */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: 0 1px 20px rgba(0, 0, 0, 0.06);
    padding: 10px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    min-height: 64px;
    width: 100%;
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    max-width: 100%;
    width: 100%;
}

.navbar-brand {
    font-size: 20px;
    font-weight: 700;
    color: #0f172a;
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    letter-spacing: -0.5px;
}

.navbar-brand img {
    height: 32px;
    width: auto;
    border-radius: 8px;
}

.navbar-brand span {
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.navbar-toggler {
    border: none;
    padding: 8px 10px;
    border-radius: 12px;
    background: transparent;
    cursor: pointer;
    display: none;
    font-size: 20px;
    color: #1e293b;
}

.navbar-collapse {
    display: flex;
    align-items: center;
}

.navbar-nav {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 4px;
    margin-left: auto;
}

.nav-item {
    margin: 0;
}

.nav-link {
    color: #64748b;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 12px;
    transition: all 0.2s ease;
    font-size: 14px;
    text-decoration: none;
    display: block;
}

.nav-link:hover {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.06);
}

.nav-link:active {
    transform: scale(0.95);
}

.nav-link[aria-current="page"] {
    color: #2563eb;
    background: rgba(37, 99, 235, 0.08);
    font-weight: 600;
}

@media (max-width: 991px) {
    .navbar-toggler {
        display: block;
    }
    
    .navbar-collapse {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: rgba(255, 255, 255, 0.98);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 16px;
        box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
        flex-direction: column;
    }
    
    .navbar-collapse.show {
        display: block;
    }
    
    .navbar-nav {
        flex-direction: column;
        margin-left: 0;
        gap: 2px;
    }
    
    .nav-link {
        padding: 12px 16px;
        border-radius: 12px;
        font-size: 15px;
    }
}

/* ----- HERO SECTION - Full Width ----- */
.hero-section {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
    padding: 28px 16px;
    margin-bottom: 0;
    color: white;
    text-align: center;
    width: 100%;
}

.hero-section .container {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 16px;
}

.hero-section h1 {
    font-size: 1.6rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: #ffffff;
}

.hero-section .lead {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 0;
    color: rgba(255, 255, 255, 0.85);
}

@media (min-width: 768px) {
    .hero-section {
        padding: 50px 0;
    }
    
    .hero-section h1 {
        font-size: 2.2rem;
    }
}

@media (min-width: 992px) {
    .hero-section h1 {
        font-size: 2.6rem;
    }
}

/* ----- CONTAINER - 940px Max Width ----- */
.container {
    max-width: 940px;
    padding: 0 16px;
    width: 100%;
    margin: 0 auto;
}

/* ----- BREADCRUMB ----- */
.breadcrumb {
    padding: 10px 0;
    margin: 0;
    background: transparent;
    font-size: 0.78rem;
    overflow-x: auto;
    white-space: nowrap;
    flex-wrap: nowrap;
    display: flex;
    list-style: none;
}

.breadcrumb-item {
    display: inline-flex;
    align-items: center;
}

.breadcrumb-item a {
    color: #2563eb;
    text-decoration: none;
}

.breadcrumb-item a:hover {
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    font-size: 1.2rem;
    color: #6c757d;
    padding: 0 6px;
}

/* ----- ALERT RESULT ----- */
.alert-result {
    padding: 16px;
    margin: 0 0 12px 0;
    background: transparent;
    text-align: center;
    border-radius: 12px;
}

.alert-result h2 {
    font-size: 1.3rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 6px;
}

.alert-result .result-error {
    color: #dc3545;
}

.alert-result .result-success {
    color: #0d6efd;
}

.alert-result .result-value {
    color: #198754;
}

@media (max-width: 767px) {
    .alert-result {
        border-radius: 0;
    }
}

/* ----- CARDS ----- */
.card {
    margin: 0 0 12px 0;
    overflow: hidden;
    background: transparent;
    border-radius: 12px;
    box-shadow: none;
}

.card-body {
    padding: 16px;
    background: transparent;
}

.card-title {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 10px;
    color: #1a1a2e;
}

.card-subtitle {
    font-size: 0.85rem;
    color: #6c757d;
    margin-bottom: 12px;
}

@media (max-width: 767px) {
    .card {
        border-radius: 0;
    }
}

/* ----- CALCULATOR FORM - SIDE BY SIDE INPUTS ----- */
.calculator-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
}

.calculator-form .row.two-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

@media (min-width: 768px) {
    .calculator-form .row.two-col {
        flex-direction: row;
        gap: 16px;
    }
    
    .calculator-form .row.two-col .form-group {
        flex: 1;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-label {
    font-weight: 600;
    color: #1e293b;
    font-size: 14px;
    margin-bottom: 0;
}

.form-select {
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    background: #ffffff;
    color: #1e293b;
    transition: all 0.2s ease;
    width: 100%;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%2364748b' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.form-select:focus {
    border-color: #2563eb;
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

@media (max-width: 767px) {
    .form-select {
        font-size: 16px;
        padding: 14px 16px;
    }
}

/* ----- BUTTONS ----- */
.btn-primary {
    padding: 14px 24px;
    background: linear-gradient(135deg, #2563eb, #7c3aed);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:active {
    transform: scale(0.97);
}

@media (min-width: 768px) {
    .btn-primary {
        width: auto;
        padding: 14px 32px;
    }
}

@media (max-width: 767px) {
    .btn-primary {
        padding: 16px 24px;
        font-size: 17px;
    }
}

/* ----- FORMULA BOX ----- */
.formula-box {
    background: transparent;
    padding: 12px 16px;
    border-radius: 10px;
    margin: 6px 0;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.formula-box p {
    font-size: 0.88rem;
    margin-bottom: 4px;
    color: #1a1a2e;
}

/* ----- TABLES ----- */
.table-responsive {
    overflow-x: auto;
    margin: 6px 0;
    -webkit-overflow-scrolling: touch;
}

.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    min-width: 400px;
}

.table th {
    background: transparent;
    color: #1a1a2e;
    padding: 8px 12px;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    border-bottom: 2px solid #e2e8f0;
    text-align: left;
}

.table td {
    padding: 8px 12px;
    vertical-align: middle;
    font-size: 0.82rem;
    border-bottom: 1px solid #eef2f8;
}

.table tbody tr:hover {
    background: rgba(0, 0, 0, 0.02);
}

.table .table-section td {
    background: rgba(0, 0, 0, 0.02);
    font-weight: 600;
    color: #0f172a;
    padding: 12px 12px;
}

@media (max-width: 767px) {
    .table-responsive {
        margin: 6px -4px;
    }
}

/* ----- FAQ LIST ----- */
.faq-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 8px;
}

.faq-item {
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    background: transparent;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.faq-item.active {
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
}

.faq-question {
    padding: 14px 16px;
    background: transparent;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 500;
    color: #0f172a;
    transition: background 0.2s;
    user-select: none;
    gap: 12px;
}

.faq-question:active {
    background: rgba(0, 0, 0, 0.02);
}

.faq-question i {
    transition: transform 0.3s ease;
    color: #94a3b8;
    flex-shrink: 0;
}

.faq-item.active .faq-question i {
    transform: rotate(180deg);
}

.faq-item.active .faq-question {
    background: rgba(37, 99, 235, 0.04);
}

.faq-item.active .faq-question span {
    color: #2563eb;
}

.faq-answer {
    padding: 0 16px;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
    color: #475569;
    font-size: 14px;
    line-height: 1.7;
}

.faq-item.active .faq-answer {
    padding: 12px 16px 16px 16px;
    max-height: 300px;
}

@media (max-width: 767px) {
    .faq-item {
        border-radius: 0;
        box-shadow: none;
    }
    
    .faq-question {
        padding: 16px;
    }
}

/* ----- RELATED GRID ----- */
.related-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 10px;
    margin-top: 8px;
}

@media (min-width: 480px) {
    .related-grid {
        grid-template-columns: 1fr 1fr;
    }
}

.related-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    background: transparent;
    border-radius: 12px;
    text-decoration: none;
    color: #1e293b;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.related-link:active {
    transform: scale(0.97);
    background: rgba(0, 0, 0, 0.02);
}

.related-link:hover {
    background: rgba(0, 0, 0, 0.02);
}

.related-link i {
    color: #2563eb;
    font-size: 16px;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}

@media (max-width: 767px) {
    .related-link {
        border-radius: 0;
        box-shadow: none;
    }
}

/* ----- AUTHOR BOX ----- */
.author-box {
    background: transparent;
    padding: 16px;
    margin: 0 0 12px 0;
    display: flex;
    gap: 14px;
    align-items: flex-start;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.author-box .author-image {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    background: #e9edf3;
    display: flex;
    align-items: center;
    justify-content: center;
}

.author-box .author-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.author-box .author-image i {
    font-size: 26px;
    color: #999;
}

.author-box .author-info {
    flex: 1;
}

.author-box .author-name {
    font-size: 0.92rem;
    font-weight: 600;
    color: #0b1b33;
    margin-bottom: 2px;
}

.author-box .author-name i {
    color: #2563eb;
    margin-right: 6px;
}

.author-box .author-bio {
    color: #3d4e62;
    line-height: 1.5;
    font-size: 0.82rem;
}

@media (max-width: 767px) {
    .author-box {
        border-radius: 0;
        box-shadow: none;
    }
}

/* ----- DIVIDER ----- */
.divider {
    border: none;
    border-top: 1px solid #e2e8f0;
    margin: 10px 0;
}

/* ----- NOTE ----- */
.note {
    margin-top: 12px;
    padding: 12px 16px;
    background: transparent;
    border-radius: 10px;
    font-size: 13px;
    color: #64748b;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.note i {
    margin-right: 6px;
}

@media (max-width: 767px) {
    .note {
        border-radius: 0;
        box-shadow: none;
    }
}

/* ----- FOOTER - Full Width ----- */
.footer {
    background: transparent;
    padding: 20px 0;
    margin-top: 20px;
    text-align: center;
    color: #64748b;
    font-size: 0.85rem;
    width: 100%;
}

.footer .container {
    max-width: 940px;
    margin: 0 auto;
    padding: 0 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: center;
}

.footer-links {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.footer-links a {
    color: #64748b;
    text-decoration: none;
    font-size: 0.82rem;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: #2563eb;
}

/* ----- UTILITY ----- */
.text-muted {
    color: #6c757d;
}

.text-center {
    text-align: center;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-3 {
    margin-bottom: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.section-spacer {
    height: 4px;
    background: transparent;
}

/* ----- MOBILE OVERRIDES ----- */
@media (max-width: 767px) {
    .container {
        padding: 0;
        max-width: 100%;
    }
    
    .card,
    .alert-result,
    .author-box {
        box-shadow: none;
        margin-left: 0;
        margin-right: 0;
        border-radius: 0;
    }
    
    .hero-section {
        padding: 24px 16px;
    }
    
    .hero-section .container {
        padding: 0;
    }
    
    .breadcrumb {
        padding: 8px 16px;
    }
    
    .footer .container {
        padding: 0 16px;
    }
    
    .formula-box {
        border-radius: 0;
        box-shadow: none;
    }
}


@supports (-webkit-touch-callout: none) {
    .container {
        padding-left: env(safe-area-inset-left);
        padding-right: env(safe-area-inset-right);
    }
}


::-webkit-scrollbar {
    width: 4px;
    height: 4px;
}

::-webkit-scrollbar-track {
    background: #f1f5f9;
}

::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}