
/* Base Styles and Variables */
:root {
    --primary-color: #1e7145;
    --primary-light: #e8f5e9;
    --primary-dark: #155d36;
    --secondary-color: #4a6572;
    --accent-color: #d4a017;
    --text-color: #333;
    --text-light: #666;
    --background-color: #f9f9f9;
    --card-color: #fff;
    --border-color: #e0e0e0;
    --error-color: #d32f2f;
    --success-color: #388e3c;
    --font-family-arabic: 'Amiri', serif;
    --font-family-main: 'Roboto', sans-serif;
    --box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: var(--font-family-main);
    color: var(--text-color);
    background-color: var(--background-color);
    line-height: 1.6;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 10px 20px;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 500;
    line-height: 1.2;
}

h1 {
    font-size: 2.5rem;
    color: var(--primary-color);
}

h2 {
    font-size: 2rem;
    color: var(--primary-color);
    border-bottom: 2px solid var(--primary-light);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

h3 {
    font-size: 1.5rem;
    color: var(--secondary-color);
    margin-top: 1.5rem;
}

h4 {
    font-size: 1.25rem;
    color: var(--secondary-color);
    margin-top: 1rem;
}

img {
    padding: 15px 10px;
}
p {
    margin-bottom: 1rem;
}

a {
    color: var(--primary-color);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: underline;
}

/* Header Styles */
.header {
    background-color: var(--primary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    animation: fadeIn 1s ease-in-out;
}

.header h1 {
    color: white;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
}

/* Main Content Sections */
main {
    padding: 2rem 0;
    position: relative;
}

section {
    margin-bottom: 3rem;
    animation: fadeIn 1s ease-in-out;
}

.calculator-section {
    background-color: var(--card-color);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: 2rem;
    margin-bottom: 3rem;
}

.calculator-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Loading Overlay Styles */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid var(--primary-light);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Form Styles */
.form-container {
    flex: 1;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input[type="text"],
input[type="number"],
select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 1rem;
    transition: var(--transition);
}

input[type="text"]:focus,
input[type="number"]:focus,
select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 2px rgba(30, 113, 69, 0.2);
}

.input-with-prefix {
    position: relative;
    display: flex;
    align-items: center;
}

.currency-prefix {
    position: absolute;
    left: 10px;
    color: var(--text-light);
    font-weight: 500;
}

.input-with-prefix input {
    padding-left: 25px;
}

.radio-group,
.checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.radio-label,
.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    margin-bottom: 0;
}

.radio-label input,
.checkbox-label input {
    margin-right: 0.5rem;
}

.family-section {
    background-color: var(--primary-light);
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
}

.family-section h4 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    color: var(--primary-dark);
}

/* Button Styles */
.btn-primary,
.btn-secondary {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    margin-left: 1rem;
}

.btn-secondary:hover {
    background-color: #3a515c;
}

.button-group {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Results Styles */
.results-container {
    background-color: var(--primary-light);
    padding: 2rem;
    border-radius: 8px;
    animation: fadeIn 0.5s ease-in-out;
}

.results-summary {
    margin-bottom: 1.5rem;
    font-size: 1.1rem;
}

.results-summary span {
    font-weight: 700;
    color: var(--primary-color);
}

.results-table-container {
    overflow-x: auto;
    margin-bottom: 1.5rem;
}

.results-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
}

.results-table th,
.results-table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.results-table th {
    background-color: var(--primary-color);
    color: white;
}

.results-table tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.7);
}

.results-table tr:hover {
    background-color: rgba(30, 113, 69, 0.1);
}

.calculation-notes {
    background-color: #fff;
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1.5rem;
    border-left: 4px solid var(--accent-color);
}

.results-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

/* Info Section Styles */
.info-section {
    background-color: var(--card-color);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: 2rem;
}

.info-content {
    max-width: 800px;
    margin: 0 auto;
}

.info-content p,
.info-content li {
    margin-bottom: 1rem;
    text-align: justify;
}

.info-content ol,
.info-content ul {
    margin-left: 1.5rem;
    margin-bottom: 1.5rem;
}

/* FAQ Accordion Styles */
.faq-section {
    background-color: var(--card-color);
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    padding: 2rem;
}

.accordion {
    margin-top: 1.5rem;
}

.accordion-item {
    margin-bottom: 1rem;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.accordion-header {
    width: 100%;
    padding: 1rem;
    background-color: var(--primary-light);
    border: none;
    text-align: left;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--primary-dark);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.accordion-header:after {
    content: '+';
    font-size: 1.5rem;
    font-weight: 700;
}

.accordion-header.active:after {
    content: '−';
}

.accordion-header:hover {
    background-color: rgba(30, 113, 69, 0.2);
}

.accordion-content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
}

.accordion-content.active {
    padding: 1rem;
    max-height: 500px;
}




.archive-container {
  display: grid;
  grid-template-columns: repeat(2, 1fr); /* 🟢 Default: 2 columns */
  gap: 20px;
  max-width: 1200px;
  margin: auto;
}

.post-card {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
  background: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.post-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.post-image {
  width: 100%;
  height: auto;
  display: block;
}

.post-content {
  padding: 15px;
}

.post-title {
  font-size: 1.2rem;
  margin-top: 0;
  margin-bottom: 10px;
  color: #333;
}

.post-excerpt {
  font-size: 0.95rem;
  color: #555;
}








/* Disclaimer Section */
.disclaimer-section {
    background-color: #fff3e0;
    border-radius: 8px;
    padding: 1.5rem;
    border-left: 4px solid var(--accent-color);
}

/* Footer Styles */
.footer {
    background-color: var(--secondary-color);
    color: white;
    padding: 2rem 0;
    text-align: center;
    margin-top: 3rem;
}
.footer-nav a {
    color: white;
    
}
.footer p {
    margin-bottom: 0.5rem;
    padding-top: 1rem;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.text-error {
    color: var(--error-color);
}

.text-success {
    color: var(--success-color);
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Styles */
@media (min-width: 768px) {
    .calculator-container {
        flex-direction: row;
    }
    
    .form-container,
    .results-container {
        flex: 1;
    }
    
    .results-container {
        margin-left: 2rem;
    }
}

@media (max-width: 767px) {
    .header {
        padding: 1.5rem 0;
    }
    
    h1 {
        font-size: 2rem;
    }
    
    h2 {
        font-size: 1.75rem;
    }
    
    .calculator-section,
    .info-section,
    .faq-section {
        padding: 1.5rem;
    }
    
    .radio-group,
    .checkbox-group {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin: 0.5rem 0;
    }
    
    .btn-secondary {
        margin-left: 0;
    }
    
    .results-actions {
        flex-direction: column;
    }
    
    .results-actions button {
        margin-left: 0;
        margin-bottom: 0.5rem;
    }
}

/* Mobile-friendly results table */
@media (max-width: 600px) {
    .results-table {
        font-size: 0.9rem;
    }
    
    .results-table th,
    .results-table td {
        padding: 0.5rem;
    }
    
    .results-table-container {
        overflow-x: auto;
    }
    
    .results-table th:nth-child(3),
    .results-table td:nth-child(3) {
        display: none;
    }
    
    .results-summary {
        font-size: 1rem;
    }
    
    .calculation-notes {
        font-size: 0.9rem;
    }
}



/* Navigation Styles */
.navbar {
    background-color: var(--primary-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

.logo a {
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    text-decoration: none;
}

.logo a:hover {
    color: white;
    text-decoration: none;
}

.nav-links {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
}

.nav-links li {
    margin-left: 1.5rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
}

.nav-links a:hover {
    color: var(--primary-light);
    text-decoration: none;
}

.nav-toggle {
    display: none;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
}

.hamburger {
    display: block;
    position: relative;
    width: 24px;
    height: 2px;
    background-color: white;
    transition: var(--transition);
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    width: 24px;
    height: 2px;
    background-color: white;
    transition: var(--transition);
}

.hamburger::before {
    top: -8px;
}

.hamburger::after {
    bottom: -8px;
}



.share-buttons {
      display: flex;
      flex-wrap: wrap;
      gap: 10px;
    }

    .share-buttons a {
      flex: 1 1 150px;
      text-align: center;
      text-decoration: none;
      color: #fff;
      padding: 12px 10px;
      border-radius: 6px;
      font-size: 16px;
      display: flex;
      justify-content: center;
      align-items: center;
      gap: 8px;
      transition: background 0.3s ease, transform 0.2s ease;
    }

    .share-buttons a:hover {
      transform: scale(1.05);
      opacity: 0.9;
    }

    .facebook { background: #3b5998; }
    .twitter { background: #1da1f2; }
    .linkedin { background: #0077b5; }
    .whatsapp { background: #25d366; }
    .email { background: #6c757d; }
	
	
	


/* Responsive Navigation */
@media (max-width: 767px) {
    .nav-toggle {
        display: block;
    }
    
	 .share-buttons a {
        flex: 1 1 100%;
      }
	  
  .archive-container {
    grid-template-columns: 1fr; /* 🔄 Mobile: 1 column */
  }


    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        background-color: var(--primary-color);
        padding: 0;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease;
    }
    
    .nav-links.show {
        max-height: 300px;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    }
    
    .nav-links li {
        margin: 0;
    }
    
    .nav-links a {
        display: block;
        padding: 1rem;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
    }
    
    .nav-toggle.active .hamburger {
        background-color: transparent;
    }
    
    .nav-toggle.active .hamburger::before {
        transform: rotate(45deg);
        top: 0;
    }
    
    .nav-toggle.active .hamburger::after {
        transform: rotate(-45deg);
        bottom: 0;
    }
}

/* Adjust header spacing with the new navbar */
.header {
    margin-top: 0;
}
