:root {
    /* Professional Islamic Theme */
    --primary-color: #274c77;
    --primary-light: #6096ba;
    --primary-dark: #065f34;
    --gold-color: #d4af37;
    --silver-color: #c0c0c0;
    --accent-blue: #2563eb;
    --accent-purple: #7c3aed;
    --danger-color: #dc2626;
    --warning-color: #d97706;
    --success-color: #059669;
    
    /* Light Theme */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #475569;
    --text-muted: #64748b;
    --border-light: #e2e8f0;
    --border-medium: #cbd5e1;
    
    /* Shadows */
    --shadow-sm: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    
    /* Border Radius */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
    max-width: 100%;
}

html, body {
    overflow-x: hidden;
    width: 100%;
    position: relative;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;padding-top: 70px;
}

.arabic-text {
    font-family: 'Amiri', serif;
    direction: rtl;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
    box-sizing: border-box;
}

/* Ensure all elements don't exceed viewport */
.card,
.headernew,
.seo-section,
.price-config,
.asset-category,
.notification,
.tooltip-content {
    max-width: 100vw;
    box-sizing: border-box;
}

/* Header */
.headernew {
    padding: 28px 0;
    display: flex;
    justify-content: center;
    border-bottom: 1px solid var(--border-light);
    margin-bottom: 40px;
    position: relative;
}

.logo-section {
    display: flex;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

.logo-text h1 {
    font-size: 32px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 6px;
    line-height: 1.2;
}

.logo-text p {
    color: var(--text-muted);
    font-size: 15px;
    max-width: 500px;
}

/* Main Layout */
.main-grid {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 32px;
    margin-bottom: 60px;
    align-items: start;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border-radius: var(--radius-xl);
    padding: 32px;
    margin-bottom: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--border-light);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.card-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.3;
}

.card-title-icon {
    width: 40px;
    height: 40px;
    background: var(--primary-light);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

/* Price Configuration */
.price-config {
    background: linear-gradient(135deg, rgba(13, 138, 79, 0.05), rgba(16, 185, 129, 0.05));
    border: 2px solid var(--primary-light);
    position: relative;
    overflow: hidden;
}

.price-config::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 150px;
    height: 150px;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), transparent);
    border-radius: 50%;
    transform: translate(50%, -50%);
}

.price-inputs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
    margin-top: 20px;
}

.price-input-group {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: 24px;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.price-input-group:hover {
    border-color: var(--primary-light);
    transform: translateY(-2px);
}

.price-input-label {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 16px;
}

.price-input-label-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.price-input-label-icon.gold {
    background: var(--gold-color);
}

.price-input-label-icon.silver {
    background: var(--silver-color);
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
    position: relative;
}

.form-label {
    display: block;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 10px;
    line-height: 1.4;
}

.form-input {
    width: 100%;
    padding: 16px 20px;
    background: var(--bg-primary);
    border: 2px solid var(--border-light);
    border-radius: var(--radius-md);
    font-size: 16px;
    color: var(--text-primary);
    transition: all 0.2s ease;
    font-family: 'Inter', sans-serif;
    appearance: none;
    -webkit-appearance: none;
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.1);
}

.form-input:hover {
    border-color: var(--border-medium);
}

.input-with-suffix {
    position: relative;
}

.input-suffix {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 500;
}

.input-group {
    display: flex;
    gap: 16px;
    align-items: center;
}

.input-group .form-input {
    flex: 1;
    min-width: 0;
}

.currency-select {
    min-width: 140px;
    flex-shrink: 0;
}

.form-hint {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 8px;
    display: flex;
    align-items: flex-start;
    gap: 6px;
    line-height: 1.5;
}

/* Asset Categories */
.asset-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
}

.asset-category {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 24px;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.asset-category:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-light);
}

.asset-category-header {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 20px;
}

.category-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    color: white;
    flex-shrink: 0;
}

.category-icon.gold {
    background: linear-gradient(135deg, var(--gold-color), #b8941b);
}

.category-icon.cash {
    background: linear-gradient(135deg, var(--accent-blue), #1d4ed8);
}

.category-icon.investments {
    background: linear-gradient(135deg, var(--accent-purple), #6d28d9);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 32px;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-family: 'Inter', sans-serif;
    text-decoration: none;
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}

.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.5);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.btn:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    100% {
        transform: scale(20, 20);
        opacity: 0;
    }
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 2px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--border-light);
    border-color: var(--border-medium);
    transform: translateY(-2px);
}

.btn-group {
    display: flex;
    gap: 16px;
    margin-top: 32px;
    flex-wrap: wrap;
}

/* Results Section */
.results-summary {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 24px;
    margin-bottom: 40px;
}

.summary-card {
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: 28px;
    text-align: center;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.summary-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.summary-card.zakat-amount {
    background: linear-gradient(135deg, rgba(13, 138, 79, 0.1), rgba(16, 185, 129, 0.05));
    border-color: var(--primary-color);
}

.summary-label {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 16px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 600;
}

.summary-value {
    font-size: 24px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
    line-height: 1.2;
}

.summary-card.zakat-amount .summary-value {
    color: var(--primary-color);
    font-size: 28px;
}

.summary-subvalue {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Chart */
.chart-container {
    height: 320px;
    margin: 40px 0;
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* Asset Breakdown */
.breakdown-list {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-light);
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-light);
    transition: background-color 0.2s ease;
}

.breakdown-item:hover {
    background: var(--bg-tertiary);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-item.total {
    background: var(--bg-tertiary);
    font-weight: 700;
    font-size: 18px;
}

.breakdown-label {
    display: flex;
    align-items: center;
    gap: 16px;
}

.breakdown-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-primary);
    font-size: 18px;
    flex-shrink: 0;
}

/* Sidebar */
.sidebar-section {
    margin-bottom: 24px;
}

.nisab-card {
    background: linear-gradient(135deg, rgba(212, 175, 55, 0.1), rgba(192, 192, 192, 0.05));
    border: 2px solid var(--gold-color);
}

.nisab-values {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.nisab-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.nisab-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-sm);
}

.nisab-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-weight: 600;
}

.nisab-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
}

.nisab-icon.gold {
    background: linear-gradient(135deg, var(--gold-color), #b8941b);
}

.nisab-icon.silver {
    background: linear-gradient(135deg, var(--silver-color), #a0a0a0);
}

/* Tooltips */
.tooltip-container {
    position: relative;
    display: inline-block;
}

.tooltip-icon {
    width: 20px;
    height: 20px;
    background: var(--bg-tertiary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 12px;
    margin-left: 8px;
    cursor: help;
    font-weight: 600;
    transition: all 0.2s ease;
}

.tooltip-icon:hover {
    background: var(--primary-light);
    color: white;
}

.tooltip-content {
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%) translateY(-10px);
    background: var(--bg-secondary);
    color: var(--text-primary);
    padding: 20px;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xl);
    width: 320px;
    font-size: 14px;
    line-height: 1.6;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--border-light);
    pointer-events: none;
}

.tooltip-content::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 8px solid transparent;
    border-top-color: var(--bg-secondary);
}

.tooltip-container:hover .tooltip-content {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* Notifications */
.notification {
    position: fixed;
    top: 24px;
    right: 24px;
    padding: 18px 28px;
    border-radius: var(--radius-lg);
    background: var(--bg-secondary);
    color: var(--text-primary);
    box-shadow: var(--shadow-xl);
    z-index: 10000;
    transform: translateX(150%);
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    max-width: 400px;
    border-left: 6px solid var(--primary-color);
    line-height: 1.5;
}

.notification.show {
    transform: translateX(0);
}

.notification.success {
    border-left-color: var(--success-color);
}

.notification.error {
    border-left-color: var(--danger-color);
}

.notification.warning {
    border-left-color: var(--warning-color);
}

/* Islamic Pattern */
.islamic-pattern {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%230d8a4f' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
    z-index: -1;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(15, 23, 42, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    backdrop-filter: blur(4px);
}

.loading-overlay.active {
    opacity: 1;
    visibility: visible;
}

.loading-spinner {
    width: 70px;
    height: 70px;
    border: 4px solid transparent;
    border-top-color: var(--primary-color);
    border-right-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Skip to content for accessibility */
.skip-to-content {
    position: absolute;
    top: -40px;
    left: 0;
    background: var(--primary-color);
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 0 0 var(--radius-md) var(--radius-md);
    z-index: 1001;
    transition: top 0.3s ease;
}

.skip-to-content:focus {
    top: 0;
}

/* Focus styles for accessibility */
:focus-visible {
    outline: 3px solid var(--primary-light);
    outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* Print Styles */
@media print {
    .card {
        break-inside: avoid;
        box-shadow: none;
        border: 2px solid #ddd;
        margin-bottom: 20pt;
    }
    
    .btn-group,
    .notification,
    .loading-overlay,
    .tooltip-icon {
        display: none !important;
    }
    
    .seo-section {
        break-inside: avoid;
        box-shadow: none;
        border: 2px solid #ddd;
    }
    
    .chart-container {
        height: 200pt;
    }
}

/* Performance Optimizations */
@media (prefers-reduced-data: reduce) {
    .islamic-pattern,
    .price-config::before {
        display: none;
    }
    
    * {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

/* iOS Safari Specific Fixes */
@supports (-webkit-touch-callout: none) {
    .btn,
    .form-input,
    select,
    textarea {
        font-size: 16px; /* Prevents auto-zoom on iOS */
    }
    
    .form-input {
        padding: 12px 16px;
    }
    
    .headernew {
        padding-top: env(safe-area-inset-top);
    }
}

/* High DPI Screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .card {
        border-width: 0.5px;
    }
    
    .border-light {
        border-width: 0.5px;
    }
}

/* Dark Mode Media Query */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f1f5f9;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border-light: #334155;
        --border-medium: #475569;
    }
}

/* ==================== RESPONSIVE DESIGN ==================== */

/* Large Desktop: 1440px and above */
@media (min-width: 1440px) {
    .container {
        max-width: 1400px;
        padding: 0 40px;
    }
    
    .main-grid {
        grid-template-columns: 1fr 420px;
        gap: 40px;
    }
}

/* Desktop: 1025px to 1439px */
@media (max-width: 1439px) and (min-width: 1025px) {
    .container {
        padding: 0 32px;
    }
    
    .main-grid {
        grid-template-columns: 1fr 360px;
        gap: 32px;
    }
}

/* Tablet Landscape: 1024px and below - MOBILE OVERFLOW FIXES */
@media (max-width: 1024px) {
    html, body {
        overflow-x: hidden;
    }
    
    .container {
        padding: 0 24px;
        width: 100%;
        max-width: 100%;
    }
    
    .headernew {
        padding: 24px 0;
        margin-bottom: 32px;
        width: 100%;
    }
    
    .main-grid {
        grid-template-columns: 1fr;
        gap: 28px;
        width: 100%;
        margin-left: 0;
        margin-right: 0;
    }
    
    .card,
    .seo-section,
    .price-config {
        width: 100%;
        max-width: 100%;
    }
    
    .logo-text h1 {
        font-size: 28px;
    }
    
    .card {
        padding: 28px;
    }
    
    .price-inputs-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .asset-categories {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .sidebar-column {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        margin-top: 32px;
    }
    
    .sidebar-section {
        margin-bottom: 0;
    }
    
    .nisab-card {
        grid-column: 1 / -1;
    }
}

/* Tablet Portrait: 768px and below */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        margin: 0;
        padding: 0;
    }
    
    html {
        font-size: 15px;
    }
    
    .container {
        padding: 0 20px;
        width: 100%;
        max-width: 100%;
    }
    
    .headernew {
        padding: 20px 0;
        margin-bottom: 28px;
        width: 100%;
    }
    
    .logo-text h1 {
        font-size: 24px;
        margin-bottom: 4px;
    }
    
    .logo-text p {
        font-size: 14px;
        max-width: 100%;
    }
    
    .main-grid {
        gap: 24px;
        margin-bottom: 48px;
        width: 100%;
    }
    
    .card {
        padding: 24px;
        margin-bottom: 20px;
        border-radius: var(--radius-lg);
        width: 100%;
    }
    
    .card-header {
        margin-bottom: 24px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-title {
        font-size: 20px;
    }
    
    .card-title-icon {
        width: 36px;
        height: 36px;
        font-size: 16px;
    }
    
    /* Price Configuration */
    .price-inputs-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    
    .price-input-group {
        padding: 20px;
    }
    
    .price-input-label {
        font-size: 15px;
    }
    
    /* Asset Categories */
    .asset-categories {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 24px;
    }
    
    .asset-category {
        padding: 20px;
    }
    
    .asset-category-header {
        margin-bottom: 16px;
    }
    
    .category-icon {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    
    /* Form Elements */
    .form-group {
        margin-bottom: 20px;
    }
    
    .form-label {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .form-input {
        padding: 14px 16px;
        font-size: 16px;
    }
    
    .input-group {
        flex-direction: column;
        gap: 12px;
    }
    
    .input-group .form-input,
    .currency-select {
        width: 100%;
        min-width: 100%;
    }
    
    /* Buttons */
    .btn-group {
        flex-direction: column;
        gap: 12px;
        margin-top: 28px;
    }
    
    .btn {
        width: 100%;
        padding: 16px 24px;
        font-size: 16px;
        justify-content: center;
    }
    
    .price-actions {
        flex-direction: column;
        gap: 12px;
    }
    
    /* Results Section */
    .results-summary {
        grid-template-columns: 1fr;
        gap: 16px;
        margin-bottom: 32px;
    }
    
    .summary-card {
        padding: 24px;
    }
    
    .summary-value {
        font-size: 22px;
    }
    
    .summary-card.zakat-amount .summary-value {
        font-size: 24px;
    }
    
    /* Chart */
    .chart-container {
        height: 280px;
        margin: 32px 0;
    }
    
    /* Asset Breakdown */
    .breakdown-list {
        border-radius: var(--radius-md);
    }
    
    .breakdown-item {
        padding: 16px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .breakdown-label {
        width: 100%;
    }
    
    .breakdown-icon {
        width: 36px;
        height: 36px;
    }
    
    /* Sidebar */
    .sidebar-column {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 24px;
    }
    
    .nisab-values {
        gap: 12px;
    }
    
    .nisab-item {
        padding: 16px;
    }
    
    /* Tooltips */
    .tooltip-content {
        width: 280px;
        left: 50%;
        transform: translateX(-50%) translateY(-10px);
        padding: 16px;
        font-size: 13px;
        max-width: calc(100vw - 40px);
    }
    
    /* Notification */
    .notification {
        max-width: calc(100vw - 48px);
        right: 20px;
        left: 20px;
        padding: 16px 20px;
        top: 20px;
    }
    
    /* Fix for iOS Safari */
    @supports (-webkit-touch-callout: none) {
        body, html {
            position: fixed;
            width: 100%;
            height: 100%;
            overflow: hidden;
        }
        
        .container {
            -webkit-overflow-scrolling: touch;
            height: 100%;
            overflow-y: auto;
        }
    }
}

/* Small Mobile: 480px and below */
@media (max-width: 480px) {
    html, body {
        overflow-x: hidden;
    }
    
    html {
        font-size: 14px;
    }
    
    .container {
        padding: 0 16px;
        width: 100%;
    }
    
    .headernew {
        padding: 16px 0;
        margin-bottom: 24px;
    }
    
    .logo-text h1 {
        font-size: 22px;
    }
    
    .card {
        padding: 20px;
        margin-bottom: 16px;
        border-radius: var(--radius-md);
        width: 100%;
    }
    
    .card-header {
        margin-bottom: 20px;
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .card-title {
        font-size: 18px;
    }
    
    /* Form Elements */
    .form-input {
        padding: 13px 16px;
    }
    
    /* Price Configuration */
    .price-input-group {
        padding: 16px;
    }
    
    /* Asset Categories */
    .asset-category {
        padding: 16px;
    }
    
    /* Results */
    .summary-card {
        padding: 20px;
    }
    
    .summary-value {
        font-size: 20px;
    }
    
    .summary-card.zakat-amount .summary-value {
        font-size: 22px;
    }
    
    /* Chart */
    .chart-container {
        height: 240px;
        margin: 24px 0;
    }
    
    /* Buttons */
    .btn {
        padding: 15px 20px;
        font-size: 15px;
    }
    
    /* Sidebar items */
    .nisab-item {
        padding: 14px;
        font-size: 14px;
    }
    
    /* Tooltips */
    .tooltip-content {
        width: 260px;
        padding: 14px;
        font-size: 12px;
    }
}

/* Extra Small Mobile: 360px and below */
@media (max-width: 360px) {
    .container {
        padding: 0 12px;
        width: 100%;
    }
    
    .logo-text h1 {
        font-size: 20px;
    }
    
    .logo-text p {
        font-size: 13px;
    }
    
    .card-title {
        font-size: 17px;
    }
    
    .form-input {
        font-size: 15px;
        padding: 12px 14px;
    }
    
    .btn {
        padding: 14px 16px;
        font-size: 14px;
    }
    
    .summary-value {
        font-size: 18px;
    }
    
    .chart-container {
        height: 200px;
    }
    
    .tooltip-content {
        width: 240px;
    }
}

/* Landscape Mode for Mobile */
@media (max-width: 768px) and (orientation: landscape) {
    .main-grid {
        display: flex;
        flex-direction: column;
    }
    
    .sidebar-column {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
    
    .chart-container {
        height: 220px;
    }
    
    .asset-categories {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Foldable and Large Screen Mobile */
@media (max-width: 768px) and (min-height: 700px) {
    .chart-container {
        height: 300px;
    }
    
    #historyList {
        max-height: 250px;
    }
    
    .main-grid {
        gap: 28px;
    }
}