:root {
    --primary-color: #1e8e3e;
    --primary-dark: #166e2f;
    --primary-light: #e8f5e9;
    --text-color: #333333;
    --text-light: #ffffff;
    --background-light: #f9f9f9;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 5px 15px rgba(0, 0, 0, 0.1);
    --shadow-hover: 0 8px 20px rgba(0, 0, 0, 0.15);
    --transition-quick: all 0.2s ease;
    --transition-normal: all 0.3s ease;
    --border-radius: 12px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, var(--primary-light) 0%, rgba(30, 142, 62, 0.1) 50%, var(--background-light) 100%);
    color: var(--text-color);
    direction: rtl;
    line-height: 1.6;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100" fill="none"><circle cx="20" cy="20" r="2" fill="rgba(30,142,62,0.1)"><animate attributeName="cy" values="20;80;20" dur="4s" repeatCount="indefinite"/></circle><circle cx="50" cy="50" r="3" fill="rgba(30,142,62,0.15)"><animate attributeName="cx" values="50;10;50" dur="6s" repeatCount="indefinite"/></circle><circle cx="80" cy="30" r="2" fill="rgba(30,142,62,0.1)"><animate attributeName="cy" values="30;70;30" dur="5s" repeatCount="indefinite"/></circle></svg>');
    z-index: -1;
    pointer-events: none;
}

/* ===== SCROLL TO TOP BUTTON ===== */
.scroll-to-top-h {
    position: fixed;
    bottom: 30px;
    left: 30px;
    width: 55px;
    height: 55px;
    background: linear-gradient(135deg, var(--primary-color), #2ecc71);
    color: var(--text-light);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(30, 142, 62, 0.3);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    backdrop-filter: blur(10px);
    border: 2px solid rgba(255, 255, 255, 0.2);
}

.scroll-to-top-h:hover {
    background: linear-gradient(135deg, var(--primary-dark), #27ae60);
    transform: translateY(-5px) scale(1.1);
    box-shadow: 0 15px 35px rgba(30, 142, 62, 0.4);
}

.scroll-to-top-h.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Header Styles - Enhanced */
.header-h {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--text-light);
    padding: 1.5rem 0;
    position: relative;
    box-shadow: var(--shadow-medium);
    overflow: hidden;
}

.header-h::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20" fill="none"><path d="M0 20L10 15L20 20L30 10L40 20L50 5L60 20L70 8L80 20L90 12L100 20V0H0Z" fill="white" opacity="0.05"/></svg>');
    background-size: 200px 40px;
    animation: headerWave 20s linear infinite;
}

@keyframes headerWave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-200px); }
}

.header-container-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.logo-container-h {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-h {
    width: 160px;
    height: auto;
    transition: var(--transition-normal);
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.logo-h:hover {
    transform: scale(1.05) rotate(1deg);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.welcome-text-h {
    font-size: 1.4rem;
    font-weight: 600;
    background: linear-gradient(45deg, var(--text-light), rgba(255, 255, 255, 0.8));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.user-controls-h {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.btn-h {
    padding: 0.75rem 1.5rem;
    background: rgba(255, 255, 255, 0.15);
    color: var(--text-light);
    border: 2px solid rgba(255, 255, 255, 0.2);
    border-radius: 25px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition-normal);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    backdrop-filter: blur(10px);
    text-decoration: none;
    position: relative;
    overflow: hidden;
}

.btn-h::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.btn-h:hover::before {
    left: 100%;
}

.btn-h:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.4);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Main Login Section */
.login-main {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 2rem;
    position: relative;
}

.login-container {
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0.85));
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 3rem;
    border-radius: 20px;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
    animation: loginSlideIn 0.8s ease-out;
}

@keyframes loginSlideIn {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark), #2ecc71);
    animation: gradientShift 3s ease-in-out infinite;
}

@keyframes gradientShift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.login-title i {
    font-size: 2.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: #666;
    font-size: 1rem;
    opacity: 0.8;
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.95rem;
}

.input-container {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 1rem 1rem 1rem 3rem;
    border: 2px solid #e1e5e9;
    border-radius: 12px;
    font-size: 1rem;
    transition: var(--transition-normal);
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(10px);
}

.form-group input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 4px rgba(30, 142, 62, 0.1);
    background: white;
}

.input-icon {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary-color);
    font-size: 1.1rem;
    z-index: 2;
}

.password-toggle {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #666;
    font-size: 1.1rem;
    transition: var(--transition-quick);
}

.password-toggle:hover {
    color: var(--primary-color);
}

.checkbox-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.checkbox-container input[type="checkbox"] {
    width: auto;
    margin: 0;
    accent-color: var(--primary-color);
}

.checkbox-container label {
    margin: 0;
    font-size: 0.9rem;
    cursor: pointer;
}

.login-button {
    width: 100%;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: var(--text-light);
    border: none;
    border-radius: 12px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.login-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.login-button:hover::before {
    left: 100%;
}

.login-button:hover {
    background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(30, 142, 62, 0.3);
}

.login-button:active {
    transform: translateY(0);
}

.error-message {
    background: linear-gradient(135deg, #ff6b6b, #ee5a52);
    color: white;
    padding: 1rem;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
    animation: errorShake 0.5s ease-in-out;
}

@keyframes errorShake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ===== ENHANCED FOOTER STYLES ===== */
.enhanced-footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 50%, #2ecc71 100%);
    color: var(--text-light);
    margin-top: 3rem;
    position: relative;
    overflow: hidden;
}

.enhanced-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20" fill="none"><path d="M0 0L10 5L20 0L30 10L40 0L50 15L60 0L70 12L80 0L90 8L100 0V20H0Z" fill="white" opacity="0.05"/></svg>');
    background-size: 200px 40px;
    animation: footerWave 25s linear infinite reverse;
}

@keyframes footerWave {
    0% { transform: translateX(0); }
    100% { transform: translateX(-200px); }
}

.simple-footer {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-color) 100%);
    color: var(--text-light);
    padding: 1.5rem 0;
    text-align: center;
    margin-top: 2rem;
    position: relative;
    overflow: hidden;
}

.simple-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 20" fill="none"><path d="M0 0L10 5L20 0L30 10L40 0L50 15L60 0L70 12L80 0L90 8L100 0V20H0Z" fill="white" opacity="0.05"/></svg>');
    background-size: 200px 40px;
    animation: footerWave 25s linear infinite reverse;
}

.simple-footer-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
    z-index: 2;
}

.simple-copyright {
    font-size: 0.9rem;
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header-container-h {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .user-controls-h {
        margin-top: 1rem;
        justify-content: center;
        flex-wrap: wrap;
    }

    .login-container {
        margin: 1rem;
        padding: 2rem;
    }

    .login-title {
        font-size: 1.5rem;
    }

    .scroll-to-top-h {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
}

@media (max-width: 600px) {
    .logo-h {
        width: 140px;
    }

    .welcome-text-h {
        font-size: 1.1rem;
    }

    .user-controls-h {
        flex-direction: column;
        width: 100%;
    }

    .btn-h {
        width: 100%;
        justify-content: center;
    }

    .login-container {
        padding: 1.5rem;
    }
}

/* Loading Animation */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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