:root {
    --primary-color: #4CAF50;
    --primary-dark: #388E3C;
    --primary-light: #A5D6A7;
    --secondary-color: #2196F3;
    --accent-color: #FFC107;
    --text-color: #333;
    --text-light: #666;
    --text-dark: #222;
    --white: #fff;
    --light-bg: #f9f9f9;
    --border-color: #e0e0e0;
    --success-color: #4CAF50;
    --header-bg: linear-gradient(135deg, #2E7D32, #4CAF50);
    --card-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    --section-radius: 12px;
    --input-border: 1px solid #ddd;
    --input-bg: #fff;
    --input-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.05);
    --transition: all 0.3s ease
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif
}

body {
    background-color: #f5f5f5;
    background-image: linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5), linear-gradient(45deg, #f5f5f5 25%, transparent 25%, transparent 75%, #f5f5f5 75%, #f5f5f5);
    background-size: 20px 20px;
    background-position: 0 0, 10px 10px;
    color: var(--text-color);
    line-height: 1.6;
    padding: 20px;
    margin: 0 auto
}

.calculator-container {
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    background-color: #fff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--card-shadow)
}

header {
    background: var(--header-bg);
    color: #fff;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    overflow: hidden
}

header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.05' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: .5
}

.logo {
    width: 80px;
    height: 80px;
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, .2);
    border-radius: 50%
}

.logo svg {
    width: 50px;
    height: 50px;
    fill: #fff
}

h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .1)
}

.subtitle {
    font-size: 1.1rem;
    opacity: .9
}

.intro {
    padding: 25px;
    background-color: #f8f9fa;
    text-align: center;
    border-bottom: 1px solid var(--border-color)
}

.intro p {
    max-width: 700px;
    margin: 0 auto;
    color: var(--text-dark);
    font-size: 1.05rem
}

.calculator-content {
    padding: 30px
}

.form-section {
    background-color: var(--white);
    border: 1px solid var(--border-color);
    border-radius: var(--section-radius);
    margin-bottom: 25px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .05);
    transition: var(--transition)
}

.form-section:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, .08);
    transform: translateY(-2px)
}

.section-header {
    background-color: var(--primary-color);
    color: #fff;
    padding: 15px 20px;
    font-size: 1.2rem;
    font-weight: 500;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background-color .3s ease
}

.section-header:hover {
    background-color: var(--primary-dark)
}

.section-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(135deg, rgba(255, 255, 255, .1) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, .1) 50%, rgba(255, 255, 255, .1) 75%, transparent 75%, transparent);
    background-size: 4px 4px;
    opacity: .3
}

.section-id {
    background-color: rgba(255, 255, 255, .2);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 10px;
    font-weight: 700;
    font-size: .9rem
}

.section-title {
    display: flex;
    align-items: center;
    flex: 1;
}

.toggle-icon {
    transition: transform .3s ease;
    font-size: .8rem;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(255, 255, 255, .2);
    border-radius: 50%
}

.rotate {
    transform: rotate(180deg)
}

.section-body {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height .5s ease, padding .3s ease
}

.section-body.active {
    padding: 25px;
    max-height: 2000px
}

.header-toggle {
    display: flex;
    align-items: center;
    margin-left: 20px;
}

/* Force toggle switch styling */
.header-toggle .toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    z-index: 10;
}

.header-toggle .toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.header-toggle .slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
}

.header-toggle .slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: #fff;
    transition: .4s;
    border-radius: 50%;
}

.header-toggle input:checked + .slider {
    background-color: #4CAF50;
}

.header-toggle input:checked + .slider:before {
    transform: translateX(26px);
}

/* Add these specific CSS fixes to ensure toggle switches work properly */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px;
    margin: 0 5px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

/* Add white border to toggle slider */
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px;
    border: 2px solid white; /* Add white border */
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: #fff;
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider {
    background-color: var(--primary-color);
    border: 2px solid white; /* Keep white border when active */
}

input:checked + .slider:before {
    transform: translateX(26px);
}
/*
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 24px
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0
}

.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #ccc;
    transition: .4s;
    border-radius: 24px
}

.slider:before {
    position: absolute;
    content: "";
    height: 16px;
    width: 16px;
    left: 4px;
    bottom: 4px;
    background-color: #fff;
    transition: .4s;
    border-radius: 50%
}

input:checked+.slider {
    background-color: var(--primary-color)
}

input:checked+.slider:before {
    transform: translateX(26px)
}
*/
.toggle-label {
    margin-left: 10px;
    font-weight: 500;
    color: var(--white);
    font-size: 0.9rem;
}

.form-group {
    margin-bottom: 20px
}

.form-row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px 15px
}

.form-col {
    flex: 1;
    padding: 0 10px;
    min-width: 200px;
    margin-bottom: 10px
}

.form-col-results {
    flex: 0 0 150px;
    padding: 0 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f8f9fa;
    border-radius: 8px
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark)
}

input[type=number],
input[type=text] {
    width: 100%;
    padding: 12px 15px;
    border: var(--input-border);
    border-radius: 8px;
    background-color: var(--input-bg);
    font-size: 1rem;
    transition: var(--transition);
    box-shadow: var(--input-shadow)
}

input[type=number]:focus,
input[type=text]:focus {
    outline: 0;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, .2)
}

input[type=number]:disabled,
input[type=text]:disabled {
    background-color: #f9f9f9;
    cursor: not-allowed
}

.zakat-result {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    border-radius: 8px;
    width: 100%
}

.zakat-label {
    font-size: .8rem;
    color: var(--text-light);
    margin-bottom: 5px
}

.zakat-value {
    font-weight: 600;
    font-size: 1.1rem;
    color: var(--primary-color)
}

.section-total {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-left: 4px solid var(--primary-color)
}

.section-total-label {
    font-weight: 600;
    color: var(--text-dark)
}

.section-total-value {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 1.2rem
}

.total-section {
    background: linear-gradient(135deg, #4caf50, #2e7d32);
    padding: 30px;
    border-radius: 15px;
    margin-top: 40px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, .1);
    color: #fff;
    position: relative;
    overflow: hidden
}

.total-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url("data:image/svg+xml,%3Csvg width='100' height='100' viewBox='0 0 100 100' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M11 18c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm48 25c3.866 0 7-3.134 7-7s-3.134-7-7-7-7 3.134-7 7 3.134 7 7 7zm-43-7c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm63 31c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM34 90c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zm56-76c1.657 0 3-1.343 3-3s-1.343-3-3-3-3 1.343-3 3 1.343 3 3 3zM12 86c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm28-65c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm23-11c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-6 60c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm29 22c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zM32 63c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm57-13c2.76 0 5-2.24 5-5s-2.24-5-5-5-5 2.24-5 5 2.24 5 5 5zm-9-21c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM60 91c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM35 41c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2zM12 60c1.105 0 2-.895 2-2s-.895-2-2-2-2 .895-2 2 .895 2 2 2z' fill='%23ffffff' fill-opacity='0.1' fill-rule='evenodd'/%3E%3C/svg%3E");
    opacity: .3
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    z-index: 2
}

.total-label {
    font-weight: 600;
    font-size: 1.3rem
}

.total-value {
    font-weight: 700;
    font-size: 2.5rem;
    text-shadow: 0 2px 4px rgba(0, 0, 0, .1)
}

.info-text {
    font-size: .9rem;
    color: #666;
    margin-top: 5px
}

.total-info {
    margin-top: 10px;
    color: rgba(255, 255, 255, .8);
    font-size: .95rem;
    position: relative;
    z-index: 2
}

.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 40px
}

button {
    padding: 14px 28px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(0, 0, 0, .1);
    position: relative;
    overflow: hidden
}

button::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(to right, transparent, rgba(255, 255, 255, .2), transparent);
    transform: translateX(-100%)
}

button:hover {
    background-color: var(--primary-dark);
    box-shadow: 0 6px 12px rgba(0, 0, 0, .15)
}

button:hover::after {
    transform: translateX(100%);
    transition: transform .6s ease-in-out
}

button.secondary {
    background-color: #f0f0f0;
    color: var(--text-color)
}

button.secondary:hover {
    background-color: #e5e5e5
}

.disclaimer {
    background-color: #fff9e6;
    border-left: 4px solid #ffc107;
    padding: 20px;
    margin: 40px 0 20px;
    font-size: .95rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, .05)
}

.tooltip {
    position: relative;
    display: inline-block;
    cursor: help;
    margin-left: 5px
}

.tooltip .tooltiptext {
    visibility: hidden;
    width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 6px;
    padding: 10px;
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    transition: opacity .3s;
    font-size: .85rem;
    line-height: 1.5;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .2)
}

.tooltip:hover .tooltiptext {
    visibility: visible;
    opacity: 1
}

footer {
    text-align: center;
    padding: 30px 0;
    margin-top: 60px;
    color: #777;
    font-size: .95rem;
    background-color: #f9f9f9;
    border-radius: 10px;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, .03)
}

@media (max-width:768px) {
    body {
        padding: 10px
    }
    .calculator-container {
        border-radius: 15px
    }
    h1 {
        font-size: 2rem
    }
    .form-col {
        flex: 100%;
        margin-bottom: 15px
    }
    .form-col-results {
        flex: 100%;
        margin-top: 5px;
        padding: 15px
    }
    .action-buttons {
        flex-direction: column
    }
    button {
        width: 100%
    }
    .total-value {
        font-size: 2rem
    }
}

@keyframes pulse {
    0% {
        transform: scale(1)
    }
    50% {
        transform: scale(1.05)
    }
    100% {
        transform: scale(1)
    }
}

.animate-pulse {
    animation: pulse 2s infinite
}

/* Add a nice highlight effect when total changes */
@keyframes highlight {
    0% { background-color: rgba(76, 175, 80, 0.2); }
    100% { background-color: transparent; }
}

.highlight {
    animation: highlight 0.7s ease-out;
    border-radius: 4px;
}

/* Active header styling */
.active-header {
    background-color: var(--primary-dark) !important;
}

/* Touch feedback for mobile */
.touch-active {
    opacity: 0.8;
}

/* Large Tablets */
@media (max-width: 992px) {
    .calculator-container {
        max-width: 100%;
    }
    
    h1 {
        font-size: 2.2rem;
    }
    
    .section-header {
        padding: 12px 15px;
        font-size: 1.1rem;
    }
    
    .section-body.active {
        padding: 20px;
    }
    
    .form-col {
        min-width: 180px;
    }
    
    button {
        padding: 12px 24px;
        font-size: 1rem;
    }
}