/* Norsk Theme - Minimal and Fast CSS */
/* Uses system fonts and minimal styles for optimal performance */

:root {
    --primary: #0066cc;
    --secondary: #6c757d;
    --accent: #28a745;
    --success: #198754;
    --warning: #ffc107;
    --danger: #dc3545;
    --light: #f8f9fa;
    --dark: #212529;
    --white: #ffffff;
    --border: #dee2e6;
    --radius: 0.375rem;
    --shadow: 0 2px 4px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
}

/* Container */
.container {
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 576px) {
    .container {
        max-width: 540px;
    }
}

@media (min-width: 768px) {
    .container {
        max-width: 720px;
    }
}

@media (min-width: 992px) {
    .container {
        max-width: 960px;
    }
}

@media (min-width: 1200px) {
    .container {
        max-width: 1140px;
    }
}

@media (min-width: 1400px) {
    .container {
        max-width: 1320px;
    }
}

body {
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--white);
    margin: 0;
    font-size: 16px;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping issues */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Skip link for screen readers */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--primary);
    color: var(--white);
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius);
    z-index: 9999;
}

.skip-link:focus {
    top: 6px;
}

/* Headers */
h1, h2, h3, h4, h5, h6 {
    margin: 0 0 1rem 0;
    font-weight: 600;
    line-height: 1.2;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

h1 { font-size: 2rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.5rem; }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.125rem; }
h6 { font-size: 1rem; }

/* Links */
a {
    color: var(--primary);
    text-decoration: underline;
    transition: color 0.2s ease;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

a:hover, a:focus {
    color: #0052a3;
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

a:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Navigation */
.navbar {
    background: var(--white);
    border-bottom: 1px solid var(--border);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    direction: ltr;
    text-align: left;
}

.navbar-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    direction: ltr;
    text-align: left;
}

.navbar-brand {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    text-decoration: none;
    margin-right: 2rem;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.navbar-brand:hover, .navbar-brand:focus {
    color: var(--primary);
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    align-items: center;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 1.5rem;
    direction: ltr;
    text-align: left;
}

.nav-link {
    color: var(--dark);
    text-decoration: none;
    padding: 0.5rem;
    border-radius: var(--radius);
    font-weight: 500;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.nav-link:hover, .nav-link:focus {
    background: var(--light);
    color: var(--primary);
}

/* Mobile navigation toggle */
.navbar-toggle {
    display: none;
    background: none;
    border: 2px solid var(--primary);
    padding: 0.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    text-align: left;
}

.navbar-toggle:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Centered section headings and descriptions */
.section-heading {
    text-align: center !important;
}

.section-description {
    text-align: center !important;
}

.centered-section {
    text-align: center;
}

.centered-section h2,
.centered-section .section-heading {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

.centered-section p,
.centered-section .section-description {
    text-align: center !important;
    margin-left: auto !important;
    margin-right: auto !important;
}

/* Hero section */
.hero {
    background: linear-gradient(135deg, var(--primary) 0%, #004c99 100%);
    color: var(--white);
    padding: 4rem 0;
    direction: ltr;
    text-align: left;
}

.hero h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.hero p {
    font-size: 1.125rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Cards */
.card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    margin-bottom: 1.5rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.card-header {
    border-bottom: 1px solid var(--border);
    margin: -1.5rem -1.5rem 1.5rem -1.5rem;
    padding: 1rem 1.5rem;
    background: var(--light);
    font-weight: 600;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Calculator grid */
.calc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    direction: ltr;
    text-align: left;
}

.calc-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping and right-to-left display issues */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
    unicode-bidi: embed;
}

.calc-card:hover, .calc-card:focus {
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
    text-decoration: none;
    color: inherit;
}

.calc-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
    font-size: 1.25rem;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calc-card p {
    color: var(--secondary);
    margin: 0;
    font-size: 0.95rem;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    font-size: 1rem;
    /* Fix for text direction and wrapping issues */
    direction: ltr;
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
    unicode-bidi: embed;
}

.btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover, .btn-primary:focus {
    background: #0052a3;
    color: var(--white);
    text-decoration: none;
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover, .btn-outline:focus {
    background: var(--primary);
    color: var(--white);
    text-decoration: none;
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

input, select, textarea {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(0, 102, 204, 0.2);
}

/* Search bar */
.search-bar {
    display: flex;
    gap: 0.5rem;
    margin: 2rem 0;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.search-bar input {
    flex: 1;
    margin-bottom: 0;
}

/* Breadcrumb */
.breadcrumb {
    background: none;
    padding: 1rem 0;
    margin: 0;
    font-size: 0.9rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    flex-wrap: wrap;
    direction: ltr;
    text-align: left;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "/";
    margin: 0 0.5rem;
    color: var(--secondary);
}

.breadcrumb-item.active {
    color: var(--secondary);
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 3rem 0 1rem;
    margin-top: 4rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
    direction: ltr;
    text-align: left;
}

.footer h5 {
    color: var(--white);
    font-size: 1.125rem;
    margin-bottom: 1rem;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.footer ul {
    list-style: none;
    margin: 0;
    padding: 0;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.footer ul li {
    margin-bottom: 0.5rem;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.footer a {
    color: #adb5bd;
    text-decoration: none;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.footer a:hover, .footer a:focus {
    color: var(--white);
}

.footer-bottom {
    border-top: 1px solid #495057;
    padding-top: 1rem;
    text-align: center;
    color: #adb5bd;
    font-size: 0.9rem;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Categories */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
    direction: ltr;
    text-align: left;
}

.category-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    text-align: left; /* Changed from center to left */
    transition: all 0.2s ease;
    box-shadow: var(--shadow);
    direction: ltr;
    /* Fix for text direction and wrapping issues */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
    unicode-bidi: embed;
}

.category-card:hover {
    border-color: var(--primary);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.category-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

/* Bootstrap-Compatible Calculator Interface */
.calc-interface {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 2rem;
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075), 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calculator-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
    background: #ffffff;
    border-radius: 0.5rem;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075), 0 0.25rem 0.5rem rgba(0, 0, 0, 0.1);
    border: 1px solid var(--border);
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calculator-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calculator-header h1 {
    color: var(--dark);
    font-size: 1.75rem;
    font-weight: 600;
    margin: 0;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calculator-description {
    color: var(--secondary);
    margin-top: 0.5rem;
    font-size: 1rem;
    line-height: 1.5;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Enhanced Form Components */
.form-group {
    margin-bottom: 1.5rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--dark);
    font-size: 0.875rem;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.form-control {
    display: block;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--dark);
    background-color: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.form-control:focus {
    color: var(--dark);
    background-color: var(--white);
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-select {
    display: block;
    width: 100%;
    padding: 0.75rem 2.25rem 0.75rem 0.75rem;
    font-size: 1rem;
    color: var(--dark);
    background-color: var(--white);
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m1 6 7 7 7-7'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 16px 12px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.form-select:focus {
    border-color: #86b7fe;
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

/* Enhanced Calculator Form Styling */
.calc-interface form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calc-interface .form-group,
.calc-interface .form-control,
.calc-interface .input-group {
    margin-bottom: 1.5rem;
    width: 100%;
    box-sizing: border-box;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calc-interface input,
.calc-interface select,
.calc-interface textarea,
.calc-interface button {
    font-family: inherit;
    font-size: 1rem;
    line-height: 1.5;
    box-sizing: border-box;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calc-interface input[type="text"],
.calc-interface input[type="number"],
.calc-interface input[type="email"],
.calc-interface input[type="tel"],
.calc-interface select,
.calc-interface textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--white);
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calc-interface input:focus,
.calc-interface select:focus,
.calc-interface textarea:focus {
    outline: none;
    border-color: #86b7fe;
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.calc-interface button {
    background: var(--primary);
    color: var(--white);
    border: 1px solid var(--primary);
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    cursor: pointer;
    font-weight: 500;
    transition: all 0.15s ease-in-out;
    position: relative;
    overflow: hidden;
    direction: ltr;
    text-align: center;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calc-interface button:hover {
    background: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.15);
}

.calc-interface button:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(49, 132, 253, 0.5);
}

.calc-interface button:active {
    transform: translateY(0);
}

/* Enhanced Button Classes */
.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.25rem;
    border-radius: 0.5rem;
}

.btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 0.25rem;
}

.btn-success {
    background: var(--success);
    border-color: var(--success);
}

.btn-success:hover {
    background: #157347;
    border-color: #146c43;
}

.btn-secondary {
    background: var(--secondary);
    border-color: var(--secondary);
}

.btn-secondary:hover {
    background: #5c636a;
    border-color: #565e64;
}

/* Calculator Actions */
.calculator-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Enhanced Result Display */
.calc-result,
.result,
.calculator-result {
    background: linear-gradient(135deg, var(--light) 0%, #e9ecef 100%);
    border: 1px solid var(--success);
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin: 1.5rem 0;
    font-weight: 600;
    font-size: 1.25rem;
    text-align: left; /* Changed from center to left */
    color: var(--dark);
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    position: relative;
    direction: ltr;
    /* Fix for text direction and wrapping issues */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
    unicode-bidi: embed;
}

.result-highlight {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    margin: 1rem 0;
    padding: 1rem;
    background: rgba(13, 110, 253, 0.1);
    border-radius: var(--radius);
    border-left: 4px solid var(--primary);
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.result-secondary {
    font-size: 1.125rem;
    color: #495057;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: rgba(108, 117, 125, 0.1);
    border-radius: var(--radius);
    border-left: 3px solid var(--secondary);
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Bootstrap Grid System */
.row {
    display: flex;
    flex-wrap: wrap;
    margin-right: -0.75rem;
    margin-left: -0.75rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.col {
    flex: 1 0 0%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.col-md-6 {
    flex: 0 0 auto;
    width: 50%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.col-md-4 {
    flex: 0 0 auto;
    width: 33.33333333%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.col-md-3 {
    flex: 0 0 auto;
    width: 25%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Enhanced Table Styling */
.calc-interface table {
    width: 100%;
    border-collapse: collapse;
    margin: 1rem 0;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calc-interface table td,
.calc-interface table th {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border);
    vertical-align: top;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calc-interface table th {
    font-weight: 600;
    background: var(--light);
    color: var(--dark);
    border-bottom: 2px solid var(--border);
}

.calc-interface table tr:last-child td {
    border-bottom: none;
}

.calc-interface table tr:nth-child(even) {
    background-color: rgba(0, 0, 0, 0.02);
}

.calc-interface table tr:hover {
    background-color: rgba(13, 110, 253, 0.05);
}

/* Input Groups */
.input-group {
    position: relative;
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    width: 100%;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.input-group-text {
    display: flex;
    align-items: center;
    padding: 0.75rem 0.75rem;
    font-size: 1rem;
    font-weight: 400;
    line-height: 1.5;
    color: var(--dark);
    text-align: center;
    white-space: nowrap;
    background-color: var(--light);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    direction: ltr;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.input-group .form-control {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group .form-control:not(:first-child) {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group .input-group-text:not(:last-child) {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
}

/* Alert Components */
.alert {
    position: relative;
    padding: 1rem 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.alert-success {
    color: #0f5132;
    background-color: #d1e7dd;
    border-color: #badbcc;
}

.alert-info {
    color: #055160;
    background-color: #d1ecf1;
    border-color: #b6d7df;
}

.alert-warning {
    color: #664d03;
    background-color: #fff3cd;
    border-color: #ffecb5;
}

.alert-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c2c7;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Override any problematic inline styles */
.calc-interface * {
    max-width: 100% !important;
    box-sizing: border-box !important;
    /* Fix for text wrapping */
    word-wrap: break-word !important;
    word-break: normal !important;
    overflow-wrap: break-word !important;
}

/* Grid layouts in calculators */
.calc-interface .grid,
.calc-interface .row {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin: 1rem 0;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calc-interface .col,
.calc-interface .column {
    flex: 1;
    min-width: 0;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Error and success messages */
.calc-interface .error,
.calc-interface .alert-danger {
    background: #fee;
    border: 1px solid #fcc;
    color: #c33;
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.calc-interface .success,
.calc-interface .alert-success {
    background: #efe;
    border: 1px solid #cfc;
    color: #3c3;
    padding: 1rem;
    border-radius: var(--radius);
    margin: 1rem 0;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

/* Enhanced Social Sharing Section */
.social-share {
    margin-top: 3rem;
    padding: 2rem;
    background: linear-gradient(135deg, var(--light) 0%, #f1f3f4 100%);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    text-align: left; /* Changed from center to left */
    box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    direction: ltr;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.social-share h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    color: var(--dark);
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.social-share p {
    color: var(--secondary);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.share-buttons {
    display: flex;
    justify-content: flex-start; /* Changed from center to flex-start */
    gap: 1rem;
    flex-wrap: wrap;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.share-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.25rem;
    border: none;
    border-radius: var(--radius);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.15s ease-in-out;
    color: var(--white);
    min-width: 120px;
    position: relative;
    overflow: hidden;
    direction: ltr;
    text-align: center;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.share-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;
}

.share-btn:hover::before {
    left: 100%;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 0.25rem 0.5rem rgba(0,0,0,0.15);
    text-decoration: none;
    color: var(--white);
}

.share-btn:focus {
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(255, 255, 255, 0.5);
}

.share-btn:active {
    transform: translateY(0);
}

.share-btn.facebook {
    background: linear-gradient(135deg, #1877f2 0%, #166fe5 100%);
    border: 1px solid #1877f2;
}

.share-btn.facebook:hover {
    background: linear-gradient(135deg, #166fe5 0%, #0d5dbf 100%);
    border-color: #166fe5;
}

.share-btn.twitter {
    background: linear-gradient(135deg, #1da1f2 0%, #0d8bd9 100%);
    border: 1px solid #1da1f2;
}

.share-btn.twitter:hover {
    background: linear-gradient(135deg, #0d8bd9 0%, #0a7bc4 100%);
    border-color: #0d8bd9;
}

.share-btn.linkedin {
    background: linear-gradient(135deg, #0a66c2 0%, #004182 100%);
    border: 1px solid #0a66c2;
}

.share-btn.linkedin:hover {
    background: linear-gradient(135deg, #004182 0%, #003366 100%);
    border-color: #004182;
}

.share-btn.copy {
    background: linear-gradient(135deg, var(--secondary) 0%, #5a6268 100%);
    border: 1px solid var(--secondary);
}

.share-btn.copy:hover {
    background: linear-gradient(135deg, #5a6268 0%, #495057 100%);
    border-color: #5a6268;
}

.share-btn.copy.copied {
    background: linear-gradient(135deg, var(--success) 0%, #157347 100%);
    border-color: var(--success);
    animation: checkmark 0.3s ease-in-out;
}

.share-btn .icon {
    font-size: 1rem;
    width: 16px;
    height: 16px;
    display: inline-block;
}

/* Copy success animation */
@keyframes checkmark {
    0% {
        transform: scale(0.8);
        opacity: 0;
    }
    50% {
        transform: scale(1.1);
        opacity: 1;
    }
    100% {
        transform: scale(1);
        opacity: 1;
    }
}

/* Sidebar */
.sidebar .card {
    margin-bottom: 1.5rem;
}

.sidebar ul {
    list-style: none;
    margin: 0;
    padding: 0;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.sidebar ul li {
    border-bottom: 1px solid var(--border);
    padding: 0.5rem 0;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.sidebar ul li:last-child {
    border-bottom: none;
}

/* Blog content */
.blog-meta {
    color: var(--secondary);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.blog-content {
    font-size: 1.1rem;
    line-height: 1.7;
    direction: ltr;
    text-align: left;
    /* Fix for text wrapping */
    word-wrap: break-word;
    word-break: normal;
    overflow-wrap: break-word;
}

.blog-content img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1rem 0;
}

/* Responsive design */
/* Enhanced Responsive Design */
@media (max-width: 768px) {
    .navbar-nav {
        display: none;
        width: 100%;
        flex-direction: column;
        background: var(--white);
        border-top: 1px solid var(--border);
        padding: 1rem 0;
        margin-top: 1rem;
        gap: 0;
        direction: ltr;
        text-align: left;
    }
    
    .navbar-nav.active {
        display: flex;
    }
    
    .navbar-toggle {
        display: block;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .calc-grid {
        grid-template-columns: 1fr;
    }
    
    .category-grid {
        grid-template-columns: 1fr;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
    }
    
    /* Bootstrap Grid Responsive */
    .col-md-6,
    .col-md-4,
    .col-md-3 {
        width: 100%;
        margin-bottom: 1rem;
    }
    
    /* Calculator responsive */
    .calculator-actions {
        flex-direction: column;
    }
    
    .calc-interface .btn,
    .calculator-actions .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .calculator-container {
        padding: 1rem;
        margin: 1rem;
    }
    
    .calc-interface {
        padding: 1rem;
    }
    
    .result-highlight {
        font-size: 1.25rem;
    }
    
    .calc-interface table {
        font-size: 0.875rem;
        overflow-x: auto;
        display: block;
        white-space: nowrap;
    }
    
    .calc-interface table td,
    .calc-interface table th {
        padding: 0.5rem;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: flex-start; /* Changed from center to flex-start */
    }
    
    .share-btn {
        width: 200px;
        margin-bottom: 0.5rem;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 0.75rem;
    }
    
    .hero {
        padding: 2rem 0;
    }
    
    .hero h1 {
        font-size: 1.75rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .calc-interface {
        padding: 1rem;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print styles */
@media print {
    .navbar, .footer, .btn, .breadcrumb {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.4;
        background: white !important;
        color: black !important;
    }
    
    a {
        color: black !important;
        text-decoration: underline !important;
    }
}