: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-color: var(--background-light);
    color: var(--text-color);
    direction: rtl;
    line-height: 1.6;
}

/* ===== 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);
}

.scroll-to-top-h:active {
    transform: translateY(-2px) scale(1.05);
}

.scroll-to-top-h.pulse {
    animation: pulseGlow 1.5s ease-in-out;
}

@keyframes pulseGlow {
    0%, 100% {
        box-shadow: 0 8px 25px rgba(30, 142, 62, 0.3);
    }
    50% {
        box-shadow: 0 12px 35px rgba(30, 142, 62, 0.6), 0 0 0 10px rgba(30, 142, 62, 0.1);
    }
}

/* 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);

    /* ❌ Remove this: overflow: hidden; */
    overflow: visible; /* ✅ Allow dropdowns to be visible outside header */
    z-index: 1000; /* ✅ Ensure it stays above table headers */
}

.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 1rem;
    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);
}

.btn-h:active {
    transform: translateY(0);
}

.btn-h i {
    font-size: 0.9rem;
    transition: var(--transition-quick);
}

.btn-h:hover i {
    transform: scale(1.1);
}

.header-btn-h {
    background: rgba(255, 255, 255, 0.2);
}

.header-btn-h:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* Enhanced Dropdown Styles */
.dropdown-h {
    position: relative;
}

.dropdown-menu-h {
    display: none;
    position: absolute;
    top: calc(100% + 10px);
    left: 0;
    background: white;
    border-radius: 15px;
    min-width: 220px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
    z-index: 9999; /* <-- raise this */
    overflow: visible; /* <-- avoid hiding parts */
    border: 1px solid rgba(0, 0, 0, 0.05);
    backdrop-filter: blur(20px);
    animation: dropdownSlide 0.3s ease;
}


@keyframes dropdownSlide {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.dropdown-menu-h::before {
    content: '';
    position: absolute;
    top: -6px;
    left: 20px;
    width: 12px;
    height: 12px;
    background: white;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-bottom: none;
    border-right: none;
    transform: rotate(45deg);
}

.dropdown-menu-h a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    color: var(--text-color);
    text-decoration: none;
    transition: var(--transition-quick);
    font-size: 0.95rem;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.dropdown-menu-h a::before {
    content: '';
    position: absolute;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, var(--primary-light), transparent);
    transition: right 0.3s ease;
}

.dropdown-menu-h a:hover::before {
    right: 100%;
}

.dropdown-menu-h a:hover {
    background: var(--primary-light);
    color: var(--primary-color);
    transform: translateX(-5px);
}

.dropdown-menu-h a i {
    color: var(--primary-color);
    font-size: 1rem;
    transition: var(--transition-quick);
}

.dropdown-menu-h a:hover i {
    transform: scale(1.1) rotate(5deg);
}

/* Main Content Styles */
.main-h {
    margin: 0 auto;
    padding: 2.5rem 2rem;
}

.page-title-h {
    font-size: 1.75rem;
    color: var(--primary-color);
    margin-bottom: 1.5rem;
    font-weight: 600;
    position: relative;
    display: inline-block;
}

.page-title-h::after {
    content: '';
    position: absolute;
    bottom: -8px;
    right: 0;
    width: 50px;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
    border-radius: 2px;
}

.info-card-h {
    background: linear-gradient(145deg, white, #fafafa);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: var(--transition-normal);
}

.info-card-h:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
}

.info-card-content-h {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.info-card-icon-h {
    font-size: 2rem;
    color: var(--primary-color);
    background: linear-gradient(135deg, var(--primary-light), rgba(30, 142, 62, 0.1));
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(30, 142, 62, 0.1);
}

.info-card-text-h {
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--text-color);
}

/* Search Container */
.search-container-h {
    background: linear-gradient(145deg, white, #fafafa);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.search-field-h {
    flex: 1;
    min-width: 220px;
}

.search-field-h input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition-quick);
    background: white;
}

.search-field-h input:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(30, 142, 62, 0.1);
}

.search-actions-h {
    display: flex;
    gap: 0.75rem;
}

.card-container-h {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

.student-card-h {
    background: linear-gradient(145deg, white, #fafafa);
    border-radius: 15px;
    padding: 1rem 1.5rem;
    box-shadow: var(--shadow-light);
    transition: var(--transition-normal);
    border: 1px solid rgba(0, 0, 0, 0.03);
    position: relative;
    overflow: hidden;
}

.student-card-h::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-color), var(--primary-dark));
}

.student-card-h:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-hover);
}

.card-header-h {
    font-weight: bold;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--primary-color);
}

.card-detail-h {
    margin: 0.25rem 0;
    color: #555;
}

.card-actions-h {
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}

.btn-edit-h {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-normal);
    font-weight: 500;
}

.btn-edit-h:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.3);
}

.btn-showmore-h {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition-normal);
    font-weight: 500;
}

.btn-showmore-h:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(30, 142, 62, 0.3);
}

.extra-info-h {
    display: none;
    margin-top: 1rem;
    font-size: 0.9rem;
    padding-top: 1rem;
    border-top: 1px solid #eee;
}

/* Table Styles */
.table-container-h {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-light);
    margin-bottom: 1.5rem;
    overflow: hidden;
    overflow-x: auto;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

table {
    width: 100%;
    min-width: auto;
}

th, td {
    padding: 1rem;
    text-align: right;
    border-bottom: 1px solid #eee;
}

th {
    background: linear-gradient(135deg, var(--primary-light), rgba(30, 142, 62, 0.1));
    font-weight: 600;
    color: var(--primary-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

tr:hover {
    background: var(--primary-light);
}

td select, td input[type="date"] {
    width: 100%;
    padding: 0.5rem;
    border: 2px solid #eee;
    border-radius: 6px;
    font-size: 0.9rem;
    transition: var(--transition-quick);
}

td select:focus, td input[type="date"]:focus {
    border-color: var(--primary-color);
    outline: none;
}

td textarea {
    width: 100%;
    height: 80px;
    padding: 0.5rem;
    border: 2px solid #eee;
    border-radius: 6px;
    resize: vertical;
    font-size: 0.9rem;
    transition: var(--transition-quick);
}

td textarea:focus {
    border-color: var(--primary-color);
    outline: none;
}

.action-buttons-h {
    display: flex;
    gap: 0.5rem;
}

.btn-delete-h {
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-delete-h:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(231, 76, 60, 0.3);
}

/* Action Buttons */
.actions-container-h {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-top: 1.5rem;
}

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

.footer-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 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); }
}

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

/* Print Styles */
@media print {
    .header-h, .search-container-h, .actions-container-h, .footer-h, .scroll-to-top-h {
        display: none !important;
    }

    body {
        background-color: white;
    }

    .main-h {
        padding: 0;
    }

    .table-container-h {
        box-shadow: none;
    }

    td textarea, td select, td input {
        border: none;
    }

    th, td {
        padding: 0.5rem;
        font-size: 10pt;
    }

    .action-buttons-h {
        display: none;
    }
}

/* Responsive Styles for Scroll Button */
@media (max-width: 768px) {
    .scroll-to-top-h {
        bottom: 20px;
        left: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .scroll-to-top-h {
        bottom: 15px;
        left: 15px;
        width: 45px;
        height: 45px;
        font-size: 1rem;
    }
}

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

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

    .search-container-h {
        flex-direction: column;
    }

    .search-field-h {
        width: 100%;
    }

/*    .table-container-h {*/
/*        overflow-x: auto;*/
/*    }*/

/*    table {*/
/*        min-width: 1000px;*/
/*    }*/
/*}*/

@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;
    }

    .dropdown-menu-h {
        width: 100%;
        left: 0;
    }

    .card-actions-h {
        flex-direction: column;
        gap: 0.5rem;
    }
}
