:root {
    --primary: #14213d;
    --secondary: #fca311;
    --light: #f8f9fa;
    --dark: #333;
    --gray: #e5e5e5;
    --success: #38b000;
    --border-radius: 10px;
    --box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --padding-mobile: 15px;
    --padding-tablet: 20px;
    --padding-desktop: 30px;
}

.logo-image {
    height: 60px; /* Adjust height as needed */
    width: auto; /* Maintains aspect ratio */
    vertical-align: middle;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Cairo', sans-serif;
    background-color: var(--light);
    color: var(--dark);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    text-size-adjust: 100%;
    -webkit-font-smoothing: antialiased;
}

/* Header Styles */
.header {
    background-color: var(--primary);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--padding-mobile);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 20px;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.logo i {
    color: var(--secondary);
}

.nav-links {
    display: flex;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    justify-content: center;
}

.nav-link {
    color: white;
    text-decoration: none;
    padding: 6px 10px;
    border-radius: 5px;
    transition: var(--transition);
    font-size: 14px;
}

.nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.nav-link.active {
    background-color: var(--secondary);
    color: var(--primary);
    font-weight: bold;
}

/* Main Container */
.main-content {
    flex: 1;
    padding: 20px var(--padding-mobile);
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    overflow: hidden;
}

/* Page Title */
.page-title {
    background-color: var(--secondary);
    color: var(--primary);
    padding: 15px;
    font-size: 22px;
    font-weight: 700;
    text-align: center;
    border-bottom: 5px solid var(--primary);
}

/* Content Layout */
.content-wrapper {
    display: flex;
    flex-direction: column;
    padding: var(--padding-mobile);
    gap: var(--padding-mobile);
}

.form-wrapper {
    width: 100%;
    order: 1;
}

.results-wrapper {
    width: 100%;
    order: 2;
}

/* Form Sections */
.card {
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
    overflow: hidden;
    transition: var(--transition);
    border: 1px solid var(--gray);
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
}

.card-header {
    background-color: var(--primary);
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
}

.card-header i {
    color: var(--secondary);
}

.card-body {
    padding: 15px;
}

.form-row {
    display: flex;
    flex-direction: column;
    margin-bottom: 15px;
    gap: 15px;
}

.form-group {
    width: 100%;
}

label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    color: var(--primary);
    font-size: 15px;
}

input[type="number"] {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-size: 16px; /* Keep 16px to prevent zoom on iOS */
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
}

input[type="number"]:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.2);
}

input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-left: 8px;
    cursor: pointer;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    margin-top: 10px;
}

.checkbox-wrapper label {
    margin-bottom: 0;
    cursor: pointer;
}

.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--gray);
    border-radius: 8px;
    font-size: 16px; /* Keep 16px to prevent zoom on iOS */
    font-family: 'Cairo', sans-serif;
    transition: var(--transition);
    background-color: white;
    -webkit-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23333' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
}

.form-select:focus {
    border-color: var(--secondary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(252, 163, 17, 0.2);
}

.input-group {
    position: relative;
}

.input-group-append {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--dark);
    font-weight: 600;
}

.help-text {
    font-size: 12px;
    color: #6c757d;
    margin-top: 6px;
    padding-right: 3px;
}

.btn {
    display: inline-block;
    padding: 12px 20px;
    background-color: var(--secondary);
    color: var(--primary);
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    font-family: 'Cairo', sans-serif;
    width: 100%;
}

.btn:hover {
    background-color: #e69500;
    transform: translateY(-2px);
    box-shadow: 0 6px 8px rgba(0, 0, 0, 0.15);
}

.btn:active {
    transform: translateY(1px);
}

.btn-block {
    width: 100%;
}

.btn-lg {
    padding: 14px 20px;
    font-size: 18px;
}

/* Results Area */
.result-card {
    background-color: var(--light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    height: 100%;
    border: 1px solid var(--gray);
}

.result-header {
    background-color: var(--primary);
    color: white;
    padding: 12px 15px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 16px;
}

.result-header i {
    color: var(--secondary);
}

.result-body {
    padding: 0;
}

.result-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.result-item {
    padding: 12px 15px;
    display: flex;
    flex-direction: column;
    border-bottom: 1px solid var(--gray);
    transition: background-color 0.2s;
}

.result-item:hover {
    background-color: rgba(252, 163, 17, 0.05);
}

.result-label {
    font-weight: 600;
    color: var(--primary);
    margin-bottom: 4px;
}

.result-value {
    font-weight: 700;
    color: var(--primary);
    text-align: left;
}

.result-total {
    background-color: var(--primary);
    color: white;
    padding: 15px;
    display: flex;
    flex-direction: column;
    font-size: 18px;
    font-weight: 700;
}

.result-total .result-value {
    color: var(--secondary);
    font-size: 20px;
    margin-top: 5px;
}

.no-results {
    padding: 30px 15px;
    text-align: center;
    color: #6c757d;
}

.no-results i {
    font-size: 40px;
    margin-bottom: 10px;
    color: var(--gray);
}

/* Animation for Results */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

/* Privacy Policy Specific Styles */
.privacy-content {
    padding: 30px var(--padding-mobile);
}

.policy-section {
    margin-bottom: 40px;
}

.policy-section h2 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 15px;
    position: relative;
    padding-right: 15px;
    display: flex;
    align-items: center;
}

.policy-section h2::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 5px;
    background-color: var(--secondary);
    border-radius: 2px;
}

.policy-section h2 i {
    color: var(--secondary);
    margin-left: 10px;
}

.policy-section h3 {
    color: var(--primary);
    font-size: 18px;
    margin: 20px 0 10px;
}

.policy-section p {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.8;
}

.policy-section ul, .policy-section ol {
    padding-right: 25px;
    margin-bottom: 15px;
}

.policy-section li {
    margin-bottom: 10px;
}

.last-updated {
    font-style: italic;
    margin-bottom: 30px;
    color: #6c757d;
    text-align: left;
    direction: ltr;
}

.policy-block {
    background-color: var(--light);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    border-right: 4px solid var(--secondary);
}

/* Table of Contents */
.toc {
    background-color: var(--light);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 30px;
}

.toc h3 {
    color: var(--primary);
    margin-bottom: 15px;
    font-size: 18px;
    display: flex;
    align-items: center;
}

.toc h3 i {
    color: var(--secondary);
    margin-left: 8px;
}

.toc ol {
    padding-right: 20px;
}

.toc li {
    margin-bottom: 8px;
}

.toc a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

.toc a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* About Page Specific Styles */
.about-content {
    padding: 30px var(--padding-mobile);
}

.about-section {
    margin-bottom: 40px;
}

.about-section h2 {
    color: var(--primary);
    font-size: 24px;
    margin-bottom: 15px;
    position: relative;
    padding-right: 15px;
}

.about-section h2::before {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 5px;
    background-color: var(--secondary);
    border-radius: 2px;
}

.about-section p {
    margin-bottom: 15px;
    font-size: 16px;
    line-height: 1.8;
}

.about-section ul {
    padding-right: 20px;
    margin-bottom: 15px;
}

.about-section li {
    margin-bottom: 10px;
}

.about-info-cards {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.about-info-card {
    display: flex;
    align-items: center;
    background-color: var(--light);
    padding: 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.about-info-card:hover {
    transform: translateY(-5px);
}

.about-info-card i {
    font-size: 40px;
    color: var(--secondary);
    margin-left: 20px;
    padding: 15px;
    background-color: var(--primary);
    border-radius: 50%;
}

.about-info-card .info-content {
    flex: 1;
}

.about-info-card h3 {
    color: var(--primary);
    margin-bottom: 5px;
    font-size: 18px;
}

.about-info-card p {
    margin: 0;
    color: var(--dark);
}

.team-section {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    margin-top: 30px;
}

.team-member {
    width: 100%;
    max-width: 300px;
    background-color: var(--light);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.team-member:hover {
    transform: translateY(-5px);
}

.team-member img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.team-member-info {
    padding: 15px;
}

.team-member-info h3 {
    color: var(--primary);
    font-size: 18px;
    margin-bottom: 5px;
}

.team-member-info p {
    margin: 0;
    color: var(--dark);
    font-size: 14px;
}

.team-member-info .position {
    color: var(--secondary);
    font-weight: 600;
    margin-bottom: 10px;
}

/* Footer Styles */
.footer {
    background-color: var(--primary);
    color: white;
    padding: 20px 0;
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 var(--padding-mobile);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
}

.footer-logo {
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 8px;
}

.footer-logo i {
    color: var(--secondary);
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.footer-link {
    color: white;
    text-decoration: none;
    transition: var(--transition);
    font-size: 14px;
}

.footer-link:hover {
    color: var(--secondary);
}

.footer-bottom {
    text-align: center;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-size: 13px;
    color: rgba(255, 255, 255, 0.7);
}

/* Tablet Styles (576px and up) */
@media (min-width: 576px) {
    :root {
        --padding-mobile: var(--padding-tablet);
    }
    
    .nav-links {
        width: auto;
        margin-top: 0;
    }
    
    .nav-link {
        font-size: 15px;
        padding: 8px 12px;
    }
    
    .page-title {
        font-size: 24px;
        padding: 18px;
    }
    
    .form-row {
        flex-direction: row;
        flex-wrap: wrap;
    }
    
    .form-group {
        flex: 1;
        min-width: 250px;
    }
    
    .result-item {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .result-label {
        margin-bottom: 0;
    }
    
    .result-total {
        flex-direction: row;
        justify-content: space-between;
        align-items: center;
    }
    
    .result-total .result-value {
        margin-top: 0;
    }
    
    .about-info-cards {
        display: flex;
        flex-direction: row;
        flex-wrap: wrap;
        gap: 20px;
    }

    .about-info-card {
        flex: 1;
        min-width: 250px;
    }
    
    .footer-content {
        flex-direction: row;
        justify-content: space-between;
    }
}

/* Desktop Styles (992px and up) */
@media (min-width: 992px) {
    :root {
        --padding-mobile: var(--padding-desktop);
    }
    
    .logo {
        font-size: 24px;
    }
    
    .nav-link {
        font-size: 16px;
    }
    
    .main-content {
        padding: 40px var(--padding-desktop);
    }
    
    .page-title {
        font-size: 28px;
        padding: 20px 30px;
    }
    
    .content-wrapper {
        flex-direction: row;
    }
    
    .form-wrapper {
        flex: 3;
        order: 1;
    }
    
    .results-wrapper {
        flex: 2;
        order: 2;
        position: sticky;
        top: 100px;
        align-self: flex-start;
    }
    
    .card-body {
        padding: 20px;
    }
    
    .form-row {
        margin-bottom: 20px;
        gap: 20px;
    }
    
    .btn-lg {
        padding: 15px 30px;
        font-size: 20px;
    }
    
    .policy-section h2, .about-section h2 {
        font-size: 28px;
    }

    .policy-section h3 {
        font-size: 20px;
    }

    .policy-section p, .about-section p {
        font-size: 17px;
    }
}

/* Larger Desktop Styles (1200px and up) */
@media (min-width: 1200px) {
    .container {
        border-radius: calc(var(--border-radius) * 1.5);
    }
    
    .content-wrapper {
        padding: calc(var(--padding-desktop) * 1.2);
        gap: calc(var(--padding-desktop) * 1.2);
    }
}

/* Print Styles */
@media print {
    body {
        background-color: white;
        font-size: 12pt;
    }
    
    .header, .footer, .form-wrapper, .btn {
        display: none;
    }
    
    .container, .content-wrapper, .results-wrapper {
        width: 100%;
        padding: 0;
        margin: 0;
        box-shadow: none;
        position: static;
    }
    
    .result-card {
        border: 1px solid #ddd;
        box-shadow: none;
    }
    
    .page-title {
        text-align: center;
        color: black;
        background: none;
        border: none;
        padding: 10px 0;
        margin-bottom: 20px;
    }
    
    .result-header {
        background-color: #f8f9fa;
        color: black;
        border-bottom: 1px solid #ddd;
    }
    
    .result-item {
        padding: 10px 0;
        border-bottom: 1px solid #eee;
    }
    
    .result-total {
        background-color: #f8f9fa;
        color: black;
        border-top: 2px solid #333;
    }
    
    .policy-block, .toc {
        page-break-inside: avoid;
        background: none;
        border: 1px solid #ddd;
    }
    
    .about-info-card {
        box-shadow: none;
        page-break-inside: avoid;
    }

    .team-member {
        page-break-inside: avoid;
        box-shadow: none;
    }
}

/* Fix for iPhone zoom on input focus */
@supports (-webkit-touch-callout: none) {
    input, select, textarea {
        font-size: 16px !important;
    }
}

/* High-DPI Display Support */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        border-width: 0.5px;
    }
    
    .input-group-append, .help-text {
        font-weight: 500;
    }
}

/* Dark Mode Support (Optional) */
@media (prefers-color-scheme: dark) {
    .dark-mode-enabled {
        --light: #121212;
        --dark: #f5f5f5;
        --gray: #333;
        
        background-color: #121212;
        color: #f5f5f5;
    }
    
    .dark-mode-enabled .container,
    .dark-mode-enabled .card,
    .dark-mode-enabled .result-card,
    .dark-mode-enabled .policy-block,
    .dark-mode-enabled .toc,
    .dark-mode-enabled .about-info-card,
    .dark-mode-enabled .team-member {
        background-color: #1e1e1e;
        border-color: #333;
    }
    
    .dark-mode-enabled input[type="number"],
    .dark-mode-enabled .form-select {
        background-color: #2d2d2d;
        color: #f5f5f5;
        border-color: #444;
    }
    
    .dark-mode-enabled .result-item:hover {
        background-color: #2c2c2c;
    }
    
    .dark-mode-enabled .help-text {
        color: #aaa;
    }
}

/* Center logo on all mobile devices regardless of orientation */
@media screen and (max-width: 767px) {
    .nav-container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo {
        margin: 0 auto;
        justify-content: center;
        margin-bottom: 10px;
    }
    
    .nav-links {
        margin-top: 10px;
    }
}

/* Your existing landscape-specific rules */
@media screen and (max-width: 767px) and (orientation: landscape) {
    .form-wrapper, .results-wrapper {
        max-height: 80vh;
        overflow-y: auto;
    }
}
/* Disabled element styles */
.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* For hiding sections until apartment info is entered */
.hidden-until-info {
    opacity: 0.4;
    pointer-events: none;
}