/* --- Global Styles & Variables --- */
:root {
    --primary-color: #0056b3; /* Professional Blue */
    --secondary-color: #007bff;
    --accent-color: #17a2b8; /* Teal for accents */
    --background-color: #f4f7f9;
    --container-bg: #ffffff;
    --text-color: #333;
    --text-light: #555;
    --border-color: #dee2e6;
    --shadow-color: rgba(0, 0, 0, 0.08);
    --font-family-ar: 'Cairo', sans-serif;
    --font-family-en: 'Roboto', sans-serif;
    --border-radius: 10px;
}

body {
    background-color: var(--background-color);
    color: var(--text-color);
    margin: 0;
    line-height: 1.7;
    padding-bottom: 40px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex-grow: 1;
}

/* --- Header & Footer Styles --- */
header {
    width: 100%;
    background-color: var(--container-bg);
    padding: 15px 0;
    text-align: center;
    box-shadow: 0 2px 4px var(--shadow-color);
}
/* logo and hover */
.logo {
  width: 150px;              
  height: 150px;             
  object-fit: cover;         
  border-radius: 50%;        
  display: block;
  margin: 20px auto;         
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); 
  border: 4px solid #fff;
  transition: transform 0.3s;
}



.logo:hover {
  transform: scale(1.05);}


footer {
    background-color: #2c3e50; /* Darker footer background */
    color: #ecf0f1;
    text-align: center;
    padding: 20px;
    margin-top: auto;
    width: 100%;
    box-sizing: border-box;
}

footer p {
    margin: 5px 0;
    font-size: 0.95rem;
}

footer .copyright {
    font-size: 0.85rem;
    color: #bdc3c7;
}


/* --- Typography --- */
h1, h2 {
    color: var(--primary-color);
    text-align: center;
    margin-bottom: 25px;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.5rem;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 10px;
}

/* --- Layout --- */
.top-bar {
    padding: 10px 5%;
    background-color: var(--container-bg);
    box-shadow: 0 2px 5px var(--shadow-color);
    margin-bottom: 30px;
    text-align: left;
}
html[dir="rtl"] .top-bar {
    text-align: right;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    gap: 30px;
    align-items: flex-start;
    width: 100%;
    box-sizing: border-box;
    flex-grow: 1;
}

@media (max-width: 800px) {
    .container {
        flex-direction: column;
    }
}

.rates-viewer, .converter-tool {
    background-color: var(--container-bg);
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: 0 4px 15px var(--shadow-color);
    flex-basis: 0;
    width: 100%;
    box-sizing: border-box;
}

.rates-viewer {
    flex-grow: 1;
}

.converter-tool {
    flex-grow: 1;
    position: sticky;
    top: 30px;
}


/* --- Exchange Rate Viewer Styles --- */
.rates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.rate-card {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: transform 0.2s, box-shadow 0.2s;
}

.rate-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 12px var(--shadow-color);
}

.rate-card .currency {
    font-weight: bold;
    font-size: 1.2rem;
    color: var(--secondary-color);
}

.rate-card .value {
    font-size: 1.4rem;
    color: var(--text-color);
    font-weight: 700;
}

/* --- Converter Tool Styles --- */
.form-group {
    margin-bottom: 20px;
}

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

input, select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    box-sizing: border-box;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 86, 179, 0.2);
}

/* --- Common Button Styles --- */
.action-btn, .secondary-btn, .lang-btn {
  display: inline-block;
  width: 100%;
  padding: 14px 24px;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  transition: background-color 0.3s ease, transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  outline: none;
}

/* Hover and Focus Effects */
.action-btn:hover, .secondary-btn:hover, .lang-btn:hover,
.action-btn:focus, .secondary-btn:focus, .lang-btn:focus {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* --- Primary Action Button --- */
.action-btn {
  background-color: var(--primary-color, #0056b3);
  color: #ffffff;
}
.action-btn:hover, .action-btn:focus {
  background-color: #004094;
}

/* --- Secondary Button --- */
.secondary-btn {
  background-color: var(--accent-color, #17a2b8);
  color: #ffffff;
  margin-top: 12px;
}
.secondary-btn:hover, .secondary-btn:focus {
  background-color: #138496;
}

/* --- Language Switch Button --- */
.lang-btn {
  width: auto;
  background-color: #6c757d;
  color: #ffffff;
  font-size: 0.95rem;
  padding: 10px 20px;
  border-radius: 6px;
}
.lang-btn:hover, .lang-btn:focus {
  background-color: #495057;
}

/* --- Modal Styles --- */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0; top: 0;
  width: 100vw; height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  justify-content: center;
  align-items: center;
}

.modal-content {
  background-color: #fff;
  padding: 24px 20px;
  border-radius: 12px;
  max-width: 90%;
  width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
  text-align: center;
  direction: rtl; /* Ensure RTL support */
}

#modal-text {
  font-size: 1.1rem;
  margin-bottom: 20px;
  line-height: 1.6;
  word-break: break-word;
}

@keyframes fadeIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

/* --- Language Specific Font application --- */
html[lang="ar"] {
    font-family: var(--font-family-ar);
}
html[lang="en"] {
    font-family: var(--font-family-en);
}
