@import url('variables.css');

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

body, input, button, select, textarea {
    font-family: 'Cairo', sans-serif;
    background-color: var(--light-bg);
    color: var(--text-color);
    line-height: 1.6;
    overflow-x: hidden;
    direction: rtl;
    text-align: right;
}

.expense-filter-form {
    margin: 0;
    display: inline-block;
}

.expense-filter-wrapper {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
}

.expense-filter-label {
    font-size: 0.85rem;
    color: #7f8c8d;
}

.expense-filter-select {
    padding: 4px 18px;
    min-width: 210px;
    border-radius: 999px;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    font-size: 0.85rem;
    line-height: 1.2;
    height: 34px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.expense-filter-select:focus {
    border-color: #3498db;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.12);
    background-color: #fff;
}

.expense-filter-select:hover {
    border-color: #d0d0d0;
}

.expense-total-row td {
    background: #f8f9fa;
}

/* Unified Footer Styles */
footer {
    background-color: #2c3e50;
    color: #ecf0f1;
    padding: 25px 0 10px;
    font-size: 0.85rem;
    border-top: 4px solid #e67e22;
    position: relative;
    z-index: 10;
}

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

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    border-bottom: 1px solid rgba(255,255,255,0.1);
    padding-bottom: 15px;
    margin-bottom: 10px;
    gap: 20px;
}

.footer-content > div, 
.footer-section-about, 
.footer-section-links, 
.footer-section-contact {
    flex: 1;
    min-width: 200px;
}

.footer-logo {
    color: white;
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
}

.footer-logo i { color: #e67e22; }

.footer-content p {
    opacity: 0.7;
    line-height: 1.6;
    margin-bottom: 0;
}

.footer-content h4 {
    color: white;
    font-size: 0.95rem;
    margin-bottom: 12px;
    font-weight: 600;
}

.footer-content ul {
    list-style: none;
    padding: 0;
    margin: 0;
    opacity: 0.8;
}

.footer-content ul li { margin-bottom: 6px; }

.footer-content ul li a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.footer-content ul li a:hover { color: #e67e22; }

.footer-contact-info p {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    opacity: 0.8;
}

.footer-contact-info a {
    color: inherit;
    text-decoration: none;
}

.footer-social-icons {
    display: flex;
    gap: 10px;
    margin-top: 10px;
}

.footer-social-link {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.footer-social-link:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

.footer-copyright {
    text-align: center;
    opacity: 0.5;
    font-size: 0.75rem;
}

@media (max-width: 768px) {
    footer { padding: 10px 0 5px !important; }
    .footer-content {
        flex-direction: column !important;
        align-items: center !important;
        text-align: center !important;
        gap: 8px !important;
        padding-bottom: 8px !important;
        margin-bottom: 5px !important;
    }
    .footer-logo { 
        justify-content: center !important; 
        font-size: 0.9rem !important;
        margin-bottom: 5px !important;
    }
    .footer-content p { 
        max-width: 240px !important; 
        margin: 0 auto !important; 
        font-size: 0.7rem !important;
        line-height: 1.3 !important;
    }
    .footer-content h4 {
        font-size: 0.8rem !important;
        margin-bottom: 5px !important;
    }
    .footer-content ul {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        gap: 2px !important;
    }
    .footer-content ul li {
        margin-bottom: 2px !important;
        font-size: 0.7rem !important;
    }
    .footer-contact-info p { 
        justify-content: center !important; 
        font-size: 0.7rem !important;
        margin-bottom: 5px !important;
    }
    .footer-social-icons { 
        justify-content: center !important; 
        margin-top: 5px !important;
        gap: 8px !important;
    }
    .footer-social-link {
        width: 26px !important;
        height: 26px !important;
        font-size: 0.8rem !important;
    }
    .footer-copyright {
        font-size: 0.65rem !important;
        margin-top: 3px !important;
    }
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    padding: 12px 30px;
    border-radius: 50px; /* Rounded pill shape */
    text-decoration: none;
    font-weight: 700;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    cursor: pointer;
    border: none;
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    box-shadow: 0 4px 15px rgba(74, 144, 226, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(74, 144, 226, 0.4);
}

.btn-outline {
    background-color: transparent;
    border: 2px solid #ddd;
    color: #555;
}

.btn-outline:hover {
    border-color: var(--primary-blue);
    color: var(--primary-blue);
}

@media (max-width: 768px) {
    body {
        font-size: 14px;
    }
    .container {
        padding: 0 12px;
    }
    .btn {
        padding: 10px 24px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    body {
        font-size: 13px;
    }
    .btn {
        padding: 9px 20px;
        font-size: 0.85rem;
    }
}

/* Footer Social Icons */
.footer-social-icons {
    display: flex;
    gap: 6px;
    margin-top: 10px;
}

.footer-social-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 26px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    color: white;
    text-decoration: none;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    position: relative;
    overflow: hidden;
}

.footer-social-link:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 6px 12px rgba(0,0,0,0.15);
    border-color: rgba(255, 255, 255, 0.4);
}

/* Brand Colors on Hover */
.link-twitter:hover {
    background: #000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

.link-instagram:hover {
    background: radial-gradient(circle at 30% 107%, #fdf497 0%, #fdf497 5%, #fd5949 45%, #d6249f 60%, #285AEB 90%);
    box-shadow: 0 10px 20px rgba(214, 36, 159, 0.3);
}

.link-facebook:hover {
    background: #1877F2;
    box-shadow: 0 10px 20px rgba(24, 119, 242, 0.3);
}

.link-youtube:hover {
    background: #FF0000;
    box-shadow: 0 10px 20px rgba(255, 0, 0, 0.3);
}

.link-tiktok:hover {
    background: #000000;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

/* Copyright Name Hover Effect */
.copyright-name {
    color: #e67e22;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    position: relative;
}

.copyright-name::after {
    content: attr(title);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    pointer-events: none;
    margin-bottom: 5px;
}

.copyright-name:hover::after {
    opacity: 1;
    visibility: visible;
    bottom: 110%;
}

/* System Alert Styles (Global) */
.system-alert {
    background-color: #fff; /* Default fallback */
    border: 1px solid transparent;
    border-radius: 12px;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    direction: rtl; /* Ensure RTL layout inside */
}

.system-alert:hover {
    transform: translateY(-2px);
}

.alert-content-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: flex-start; /* Content starts from Right in RTL */
}

.alert-icon-box {
    width: 45px;
    height: 45px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    color: white;
    flex-shrink: 0;
}

.alert-text-group {
    display: flex;
    flex-direction: column;
    text-align: right;
}

.alert-title {
    font-weight: 800;
    font-size: 1rem;
    margin-bottom: 4px;
}

.alert-message {
    color: #555;
    font-size: 0.95rem;
    line-height: 1.4;
}

.alert-close-btn {
    background: none;
    border: none;
    color: #95a5a6;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
    transition: color 0.2s;
    line-height: 1;
    opacity: 0.7;
}

.alert-close-btn:hover {
    color: #7f8c8d;
    opacity: 1;
}

/* Alert Themes - Styled to match design */

/* Warning (Orange) */
.system-alert.warning {
    background-color: #fff8f0;
    border-color: #e67e22;
}
.system-alert.warning .alert-icon-box {
    background: #e67e22;
    box-shadow: 0 4px 10px rgba(230, 126, 34, 0.2);
}
.system-alert.warning .alert-title { color: #e67e22; }

/* Info (Cyan/Blue) */
.system-alert.info {
    background-color: #f0f8ff;
    border-color: #3498db;
}
.system-alert.info .alert-icon-box {
    background: #3498db;
    box-shadow: 0 4px 10px rgba(52, 152, 219, 0.2);
}
.system-alert.info .alert-title { color: #3498db; }

/* Success (Green) */
.system-alert.success {
    background-color: #f0fff4;
    border-color: #2ecc71;
}
.system-alert.success .alert-icon-box {
    background: #2ecc71;
    box-shadow: 0 4px 10px rgba(46, 204, 113, 0.2);
}
.system-alert.success .alert-title { color: #2ecc71; }

/* Danger (Red) */
.system-alert.danger {
    background-color: #fff5f5;
    border-color: #e74c3c;
}
.system-alert.danger .alert-icon-box {
    background: #e74c3c;
    box-shadow: 0 4px 10px rgba(231, 76, 60, 0.2);
}
.system-alert.danger .alert-title { color: #e74c3c; }

/* Primary (Brand Blue) */
.system-alert.primary {
    background-color: #f5f9ff;
    border-color: #4a90e2;
}
.system-alert.primary .alert-icon-box {
    background: #4a90e2;
    box-shadow: 0 4px 10px rgba(74, 144, 226, 0.2);
}
.system-alert.primary .alert-title { color: #4a90e2; }

@media (max-width: 768px) {
    .system-alert { flex-direction: column-reverse; gap: 10px; align-items: flex-end; text-align: right; }
    .alert-content-wrapper { width: 100%; }
    .alert-close-btn { align-self: flex-start; }
}
