/* General Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    background-color: #f9f9f9;
    color: #333;
    padding: 20px;
}

/* Header */
header {
    text-align: center;
    padding: 20px 0;
    background-color: black;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.logo {
    width: 200px;
    height: auto;
}

/* Navigation */
nav {
    background-color: #333;
    margin-top: 10px;
    position: relative;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
}

nav ul li {
    margin: 0 15px;
}

nav ul li a {
    color: #fff;
    text-decoration: none;
    padding: 10px 20px;
    display: block;
}

nav ul li a:hover {
    background-color: #555;
    border-radius: 4px;
}

/* Collapsible Menu Button */
.menu-toggle {
    display: block; /* Button is shown by default */
    background-color: #007BFF;
    color: #fff;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 18px;
    text-align: right; /* Align text to the right */
    direction: rtl; /* Set text direction to right to left */
}

/* Navigation Menu */
#nav-menu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    direction: rtl;
}

/* Navigation Menu Items */
#nav-menu li a {
    text-align: right;
}

/* Hide the collapse button on larger screens */
@media (min-width: 768px) {
    .menu-toggle {
        display: none; /* Hide the menu button on screens wider than 768px */
    }
}

/* Show the collapse button and adjust menu layout on small screens */
@media (max-width: 767px) {
    .menu-toggle {
        display: block; /* Show the button on small screens */
    }

    #nav-menu {
        display: none; /* Hide the menu by default on small screens */
        flex-direction: column;
        width: 100%; /* Make sure the menu takes up full width */
    }

    #nav-menu.show {
        display: block; /* Show the menu when toggled */
    }
}

/* Table of Contents */
.toc {
    margin: 20px 0;
    text-align: center;
}

.toc button {
    padding: 10px 20px;
    background-color: #007BFF;
    color: #fff;
    border: none;
    cursor: pointer;
}

.toc ul {
    list-style: none;
    margin-top: 10px;
}

.toc ul li a {
    text-decoration: none;
    color: #007BFF;
}

/* General article styling */
article {
    direction: rtl; /* Right-to-left text direction */
    text-align: right; /* Align text to the right */
    font-family: "Tahoma", "Arial", sans-serif; /* Web-safe font for Persian text */
    line-height: 1.8; /* Improves readability */
    margin: 20px auto; /* Adds spacing on the sides and centers the article */
    max-width: 900px; /* Restricts width for better readability on large screens */
    padding: 15px; /* Adds internal spacing */
    background-color: #f9f9f9; /* Light background for better contrast */
    border-radius: 8px; /* Rounded corners for a modern look */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

/* Image styling */
article img {
    display: block; /* Ensures images are treated as block elements */
    margin: 10px auto; /* Centers the image horizontally */
    max-width: 100%; /* Makes images responsive */
    height: auto; /* Maintains aspect ratio */
    border-radius: 6px; /* Optional: Slight rounding of image corners */
}

/* Table styling */
article table {
    width: 100%; /* Makes the table occupy full width of its container */
    border-collapse: collapse; /* Removes double borders */
    margin: 15px 0; /* Adds spacing around the table */
    background-color: #fff; /* White background for better visibility */
    border-radius: 8px; /* Optional: Rounds the table edges */
    overflow: hidden; /* Ensures rounded corners work */
    box-shadow: 0 1px 5px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
}

article table th, 
article table td {
    text-align: right; /* Aligns text to the right */
    padding: 10px; /* Adds spacing inside table cells */
    border: 1px solid #ddd; /* Adds a light border to cells */
    font-size: 1rem; /* Ensures legible font size */
}

article table th {
    background-color: #f4f4f4; /* Light gray background for table headers */
    font-weight: bold; /* Makes header text bold */
}

/* Responsive Design */
@media (max-width: 768px) {
    article {
        padding: 10px; /* Reduces padding for smaller screens */
        margin: 10px; /* Adjusts margins for smaller screens */
    }

    article table, 
    article img {
        font-size: 0.9rem; /* Scales down text size slightly */
    }
}

@media (max-width: 480px) {
    article table th, 
    article table td {
        padding: 5px; /* Reduces padding for very small screens */
    }

    article {
        font-size: 0.9rem; /* Slightly smaller font for narrow screens */
    }
}

/* Images */
figure {
    text-align: center;
    margin: 20px 0;
}

figure img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

img {
    width: 100%;
    max-width: 1200px;
    height: auto;
    display: block;
    margin: 20px auto;
}


figcaption {
    margin-top: 8px;
    font-style: italic;
    color: #666;
}

/* Social Icons */
.social-icons {
    text-align: center;
    margin: 20px 0;
}

.social-icons a {
    margin: 0 10px;
    font-size: 36px;
    color: #007BFF;
    text-decoration: none;
}

.social-icons a:hover {
    color: #0056b3;
}

/* Footer */
footer {
    display: flex;
    flex-wrap: wrap;
    justify-content: center; /* Center the columns horizontally */
    align-items: flex-start; /* Align items to the top */
    background-color: #333;
    color: #fff;
    padding: 20px;
}

/* Footer Column Styling */
.footer-column {
    width: 22%; /* Each column will take 22% of the width */
    margin: 10px; /* Add margin between the columns */
}

/* Ensure that the footer columns are responsive */
@media (max-width: 768px) {
    .footer-column {
        width: 48%; /* Make columns take up 48% of the width on smaller screens */
    }
}

@media (max-width: 480px) {
    .footer-column {
        width: 100%; /* Make columns take full width on very small screens */
    }
}

/* Footer Social Media Icons (First Column Only) */
.footer-column:first-child a {
    margin: 0 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    background-color: #444;
    color: #fff;
    border-radius: 50%;
    font-size: 22px;
    transition: transform 0.3s, background-color 0.3s;
}

.footer-column:first-child a:hover {
    background-color: #007BFF;
    color: #fff;
    transform: scale(1.2);
}

/* Footer Links */
.footer-column h4 {
    margin-bottom: 10px;
}

.footer-column ul {
    list-style: none;
    padding: 0;
}

.footer-column ul li a {
    color: #ccc;
    text-decoration: none;
}

.footer-column ul li a:hover {
    color: #fff;
}


/* Copyright */
.copyright {
    text-align: center;
    padding: 10px 0;
    background-color: #222;
    color: #ccc;
    font-size: 14px;
}

/* Go Up Button */
#goTopBtn {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    background-color: #007BFF;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

#goTopBtn:hover {
    background-color: #0056b3;
}

/* Responsive Design */
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
        width: 100%;
        text-align: center;
    }

    nav ul {
        flex-direction: column;
        display: none;
    }

    nav ul li {
        margin: 10px 0;
    }

    footer {
        flex-direction: column;
    }

    .footer-column {
        width: 100%;
        text-align: center;
    }
}

/* Blinking Button */
.blinking-button {
    width: 100%;
    max-width: 600px;  /* Adjust the max width if needed */
    padding: 15px 30px;
    font-size: 18px;
    font-weight: bold;
    color: #fff;
    background-color: orange;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    animation: blink 1s infinite;
    transition: transform 0.3s ease;
    display: block;
    margin: 20px auto;
}

/* Hover effect */
.blinking-button:hover {
    transform: scale(1.05);
}

/* Blinking Animation */
@keyframes blink {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Responsive for Small Screens */
@media (max-width: 480px) {
    .blinking-button {
        font-size: 16px;
        padding: 12px 20px;
    }
}
