/* --- General, Reset, and Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;600;700&display=swap');

/* === Animations & Transitions === */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

* { margin: 0; padding: 0; box-sizing: border-box; }
html { 
    overflow-x: hidden; 
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none;  /* IE and Edge */
}
html::-webkit-scrollbar {
    display: none;
}
body { 
    overflow-x: hidden;
    font-family: 'Cinzel', serif; color: #fff; 
    background-color: #050f1e;
    background-image: linear-gradient(to bottom, rgb(17, 75, 163), #050f1e);
    position: relative; 
}
a { text-decoration: none; color: inherit; transition: all 0.3s ease; }
ul { list-style: none; }
body, html { min-height: 100%; }

/* --- Main Site Header --- */
.site-header { 
    background: transparent; 
    padding: 0 5%; 
    position: sticky;
    top: 0;
    z-index: 900; 
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: background-color 0.4s ease-out, box-shadow 0.4s ease-out;
}

.site-header.scrolled {
    background-color: rgba(5, 15, 30, 0.85);
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.4);
}

.header-top-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 0; border-bottom: 1px solid rgba(255, 255, 255, 0.2); font-size: 14px; }
.contact-info { display: flex; align-items: center; gap: 30px; }
.contact-info a { display: flex; align-items: center; gap: 8px; }
.contact-info a:hover { transform: translateY(-2px); filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.7)); }
.social-icons { display: flex; align-items: center; gap: 20px; }
.social-icons a i { font-size: 1.3rem; }
.social-icons a:hover { transform: translateY(-2px); filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.7)); }

/* --- Main Navigation --- */
.main-nav { display: flex; justify-content: space-between; align-items: center; padding: 25px 0; }
.logo a { font-size: 28px; font-weight: 700; text-transform: uppercase; letter-spacing: 3px; display: flex; align-items: center; gap: 15px; }
.logo a:hover { transform: translateY(-3px); filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.8)); }
.logo img { height: 45px; width: auto; }

.nav-links { display: flex; align-items: center; }
.nav-links > li { margin-left: 20px; position: relative; }
.nav-links > li > a { font-size: 15px; font-weight: 700; text-transform: uppercase; letter-spacing: 1.5px; padding: 10px 5px; border-bottom: 3px solid transparent; display: flex; align-items: center; gap: 8px; position: relative; }
.nav-links > li > a::after { content: ''; position: absolute; width: 0; height: 3px; bottom: -3px; left: 0; background-color: #ffd700; transition: width 0.3s ease-out; }
.nav-links > li:hover > a::after { width: 100%; }
.nav-links > li > a:hover { transform: translateY(-2px); filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.7)); }
.nav-links > li:hover > a { border-color: transparent; }

.menu-toggle, .close-menu { display: none; background: none; border: none; color: white; cursor: pointer; }
.login-text { display: none; }

/* --- Dropdown Menus --- */
.dropdown-submenu { position: relative; }
.dropdown-menu, .submenu-menu { display: none; position: absolute; min-width: auto; width: max-content; white-space: nowrap; padding: 10px 0; opacity: 0; visibility: hidden; transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s; background-color: rgba(16, 71, 149, 0.9); backdrop-filter: blur(8px); border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 8px; z-index: 100; }
.dropdown-menu { top: 100%; left: 0; transform: translateY(15px); }
.submenu-menu { top: -10px; left: 100%; transform: translateY(15px); }
.nav-links li.dropdown:hover > .dropdown-menu, .nav-links li.dropdown-submenu:hover > .submenu-menu { display: block; opacity: 1; visibility: visible; transform: translateY(0); }
.dropdown-menu a, .submenu-menu a { display: flex; justify-content: space-between; align-items: center; padding: 12px 20px; font-weight: 400; text-transform: none; letter-spacing: 1px; transition: background-color 0.3s ease, color 0.3s; gap: 15px; border-bottom: none !important; }
.dropdown-menu a:hover, .submenu-menu a:hover { background-color: rgba(255, 255, 255, 0.1); color: #ffd700; }
.arrow-down, .arrow-right { display: inline-block; border: solid white; border-width: 0 2px 2px 0; padding: 3px; transition: transform 0.3s ease; }
.arrow-down { transform: rotate(45deg); }
.arrow-right { transform: rotate(-45deg); }
li.dropdown:hover > a > .arrow-down, li.menu-item-open > a > .arrow-down { transform: rotate(225deg); }
li.dropdown-submenu:hover > a > .arrow-right, li.menu-item-open > a > .arrow-right { transform: rotate(135deg); }

/* --- Hero Section & Search --- */
.hero-section { position: relative; height: calc(100vh - 158px); min-height: 600px; display: flex; align-items: center; justify-content: center; text-align: center; background-color: transparent; overflow: hidden; }
.hero-section::before { content: 'TAJMIR'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); font-size: 25vw; font-weight: 700; color: rgba(255, 255, 255, 0.04); z-index: 1; pointer-events: none; animation: fadeIn 2s 0.5s ease-out backwards; }
.hero-content { position: relative; z-index: 2; padding: 40px; background-color: rgba(16, 71, 149, 0.7); backdrop-filter: blur(8px); border-radius: 12px; max-width: 600px; width: 90%; border: 1px solid rgba(255, 255, 255, 0.2); animation: fadeInUp 1s ease-out; }
.search-form button { padding: 12px 40px; font-size: 16px; font-weight: 700; text-transform: uppercase; letter-spacing: 2px; color: #fff; background-color: #1976d2; border: none; border-radius: 5px; cursor: pointer; transition: all .3s ease; font-family: 'Cinzel', serif; } 
.search-form button:hover { background-color: #1565c0; transform: scale(1.05); box-shadow: 0 4px 15px rgba(25, 118, 210, 0.4); }
.search-form { display: flex; flex-direction: column; align-items: center; } .search-bar { position: relative; width: 100%; margin-bottom: 20px; } .search-bar .bi-search { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: #bbb; } .search-bar input { width: 100%; padding: 15px 15px 15px 50px; font-size: 16px; border-radius: 5px; border: 1px solid #ccc; outline: none; transition: border-color .3s ease, box-shadow .3s ease; font-family: 'Cinzel', serif; color: #333; } .search-bar input::placeholder { color: #777; font-family: 'Cinzel', serif; } .search-bar input:focus { border-color: rgb(16, 71, 149); box-shadow: 0 0 8px rgba(16, 71, 149, .6); } 

.login-item { margin-left: 20px; }
.login-icon { display: flex; align-items: center; justify-content: center; background-color: rgba(255, 255, 0, 0.8); color: #0b3f8a; width: 45px; height: 45px; border-radius: 50%; border: none !important; }
.login-icon i { font-size: 1.8rem; }
.login-icon:hover { background-color: #ffd700; color: #0b3f8a; transform: scale(1.1); box-shadow: 0 0 20px rgba(255, 255, 255, 0.8); }

/* --- Login Popup and Admin Dashboard --- */
#login-popup-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.6); backdrop-filter: blur(5px); z-index: 1000; display: none; align-items: center; justify-content: center; opacity: 0; transition: opacity 0.3s ease-in-out; }
#login-popup-overlay.active { display: flex; opacity: 1; }
.popup-close-btn { position: absolute; top: 20px; right: 30px; background: none; border: none; font-size: 3rem; color: white; cursor: pointer; line-height: 1; z-index: 1001; transition: transform 0.2s ease, color 0.2s; }
.popup-close-btn:hover { transform: scale(1.1); color: #ffd700; }
.login-container { display: flex; min-height: 100vh; width: 100%; font-family: 'Poppins', sans-serif; color: white; background-color: #0b3f8a; background-image: linear-gradient(135deg, rgba(25, 87, 168, 0.8) 0%, transparent 50%), linear-gradient(225deg, rgba(38, 114, 222, 0.7) 10%, transparent 40%), linear-gradient(315deg, rgba(16, 68, 140, 0.9) 20%, transparent 60%), linear-gradient(45deg, rgba(23, 76, 154, 0.6) 30%, transparent 70%); }
.brand-panel { flex-basis: 55%; display: flex; align-items: center; justify-content: center; position: relative; padding: 40px; transition: display 0.3s; }
.brand-panel::after { content: ''; position: absolute; right: 0; top: 20%; bottom: 20%; width: 1px; background: rgba(255, 255, 255, 0.3); }
.brand-content { text-align: center; } .brand-logo { max-width: 150px; width: 100%; margin: 0 auto 20px auto; } .brand-title { font-size: 4rem; font-weight: 700; letter-spacing: 2px; text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.3); } .brand-subtitle { font-size: 1.2rem; font-weight: 300; color: rgba(255, 255, 255, 0.8); }
.login-panel { flex-basis: 45%; display: flex; align-items: center; justify-content: center; padding: 40px; transition: display 0.3s; }
.login-form { width: 100%; max-width: 360px; } 
.login-form .will-animate { opacity: 0; animation: fadeInUp 0.5s ease-out forwards; }
#login-popup-overlay.active .login-form .will-animate:nth-of-type(1) { animation-delay: 0.3s; } #login-popup-overlay.active .login-form .will-animate:nth-of-type(2) { animation-delay: 0.4s; } #login-popup-overlay.active .login-form .will-animate:nth-of-type(3) { animation-delay: 0.5s; } #login-popup-overlay.active .login-form .will-animate:nth-of-type(4) { animation-delay: 0.6s; } #login-popup-overlay.active .login-form .will-animate:nth-of-type(5) { animation-delay: 0.7s; }

.form-header { text-align: center; margin-bottom: 30px; } .form-icon-main { font-size: 3rem; color: rgba(255, 255, 255, 0.8); } .error-message { background-color: #e74c3c; color: white; padding: 10px; border-radius: 5px; text-align: center; margin-bottom: 15px; font-size: 0.9em; display: none; } .input-group { position: relative; margin-bottom: 20px; } .input-icon { position: absolute; top: 50%; left: 15px; transform: translateY(-50%); color: rgba(0, 0, 0, 0.4); z-index: 1; } .input-group input { width: 100%; padding: 15px 15px 15px 45px; border: none; border-radius: 5px; background-color: rgba(255, 255, 255, 0.9); color: #333; font-family: 'Poppins', sans-serif; font-size: 1rem; } .input-group input::placeholder { color: #888; } .input-group input:focus { outline: 2px solid #64b5f6; } .form-options { display: flex; justify-content: space-between; align-items: center; margin-bottom: 25px; font-size: 0.9em; } .remember-me { display: flex; align-items: center; color: rgba(255, 255, 255, 0.9); cursor: pointer;} .remember-me input { margin-right: 8px; } .forgot-password { color: rgba(255, 255, 255, 0.9); text-decoration: none; } .forgot-password:hover { text-decoration: underline; }
#toggle-password { position: absolute; right: 15px; top: 50%; transform: translateY(-50%); cursor: pointer; color: #555; }
#password { padding-right: 45px; }

.login-button { width: 100%; padding: 15px; border: none; border-radius: 5px; background-color: #1976d2; color: white; font-size: 1.1rem; font-weight: 600; cursor: pointer; transition: all 0.3s ease; text-transform: uppercase; position: relative; overflow: hidden; }
.login-button:hover { background-color: #1565c0; transform: translateY(-2px); box-shadow: 0 4px 15px rgba(25, 118, 210, 0.4); }
.login-button.loading { background-color: #555; cursor: not-allowed; opacity: 0.8; } .login-button.success { background-color: #2ecc71; } .login-button.failure { background-color: #e74c3c; }
#admin-dashboard { width: 100%; display: none; padding: 40px; color: #333; flex-direction: column; align-items: center; justify-content: flex-start; overflow-y: auto; }
.dashboard-container { max-width: 1100px; width:100%; background-color: white; border-radius: 8px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); }
#admin-dashboard .dashboard-header, #admin-dashboard .dashboard-content { opacity: 0; transform: translateY(20px); transition: opacity 0.5s ease-out, transform 0.5s ease-out; }
#admin-dashboard.dashboard-visible .dashboard-header { opacity: 1; transform: translateY(0); transition-delay: 0.1s; }
#admin-dashboard.dashboard-visible .dashboard-content { opacity: 1; transform: translateY(0); transition-delay: 0.2s; }
.dashboard-header { background-color: #2c3e50; color: white; padding: 20px; border-top-left-radius: 8px; border-top-right-radius: 8px; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 15px; } .dashboard-header h1 { margin: 0; font-size: 1.5em; }
.header-actions { display: flex; gap: 10px; } .dashboard-btn { color: white; padding: 8px 15px; text-decoration: none; border-radius: 5px; transition: background-color 0.3s; cursor: pointer; border: none; font-family: 'Poppins', sans-serif; font-weight: 600; }
.logout-btn { background-color: #c0392b; } .logout-btn:hover { background-color: #e74c3c; }
.dashboard-content { padding: 20px; }
table { width: 100%; border-collapse: collapse; } th, td { padding: 15px; text-align: left; border-bottom: 1px solid #ddd; font-family: 'Poppins', sans-serif; word-break: break-word; } th { background-color: #ecf0f1; color: #333; font-weight: 600; } tr:last-child td { border-bottom: none; } td a { color: #3498db; text-decoration: none; } td a:hover { text-decoration: underline; }
#admin-dashboard tbody tr { opacity: 0; transform: translateY(15px); transition: opacity 0.4s ease-out, transform 0.4s ease-out; }
#admin-dashboard.dashboard-visible tbody tr { opacity: 1; transform: translateY(0); }
.hidden { display: none !important; }
.action-btn { font-size: 0.9em; padding: 8px 12px; border-radius: 5px; border: none; cursor: pointer; color: white; margin: 0 5px; transition: opacity 0.3s; flex-grow: 1; }
.action-btn:hover { opacity: 0.8; }
.edit-btn { background-color: #3498db; } .delete-btn { background-color: #e74c3c; } .save-btn { background-color: #2ecc71; }
.add-user-section { margin-top: 30px; padding: 20px; background-color: #f9f9f9; border-radius: 8px; border: 1px solid #eee; }
.add-user-section h2 { margin-top: 0; margin-bottom: 20px; font-size: 1.3em; color: #2c3e50; }
#add-user-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 15px; align-items: end; }
#add-user-form input { width: 100%; padding: 10px; border: 1px solid #ccc; border-radius: 4px; font-family: 'Poppins', sans-serif; }
#add-user-form button { grid-column: 1 / -1; background-color: #2980b9; color: white; padding: 12px; border: none; border-radius: 4px; cursor: pointer; font-size: 1em; font-weight: 600; transition: background-color 0.3s; }
#add-user-form button:hover { background-color: #3498db; }
.editable-input { width: 100%; padding: 8px; border: 1px solid #3498db; border-radius: 4px; font-family: 'Poppins', sans-serif; }

/* ==============================================
--- MOBILE OPTIMIZATION ---
============================================== */
@media (max-width: 992px) {
    #login-popup-overlay.active { align-items: flex-start; overflow-y: auto; }
    .login-container { flex-direction: column; height: auto; min-height: 100%; }
    .brand-panel, .login-panel { flex-basis: auto; width: 100%; min-height: auto; }
    #admin-dashboard { height: auto; flex-grow: 1; }
}

@media (max-width: 820px) {
    .brand-title { font-size: 2.8rem; } .brand-subtitle { font-size: 1rem; }
}

@media (max-width: 768px) {
    .site-header { padding: 0 15px; }
    .main-nav { padding: 15px 0; }
    .logo a { font-size: 22px; gap: 10px; }
    .logo img { height: 38px; }
    .hero-content { padding: 30px 25px; width: 95%; }
    .search-form button { width: 100%; }
    
    /* MODIFIED: Fix for hero section height and search bar position */
    .hero-section {
        min-height: calc(100vh - 115px); /* A safe average for mobile header height */
        padding: 0;
    }

    .hero-section::before { display: block; top: 50%; transform: translate(-50%, -160%); font-size: 20vw; color: rgba(255, 255, 255, 0.03); }
    .header-top-bar { flex-direction: row; flex-wrap: wrap; justify-content: center; gap: 20px; }
    .contact-info a span { display: none; }
    .contact-info a i { font-size: 1.2rem; width: 1.5rem; height: 1.5rem; display: inline-flex; align-items: center; justify-content: center; }
    .menu-toggle, .close-menu { display: block; } .menu-toggle { font-size: 28px; padding: 10px;} .close-menu { font-size: 32px; position: absolute; top: 20px; right: 20px; z-index: 1002;}
    .nav-links { display: none; flex-direction: column; justify-content: flex-start; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(16, 71, 149, 0.98); backdrop-filter: blur(10px); z-index: 1001; overflow-y: auto; padding: 80px 0 20px 0; } 
    .nav-links.active { display: flex; }
    .nav-links > li:not(.login-item) { margin: 15px auto; width: 80%; text-align: center; }
    .nav-links .login-item { margin-top: auto; margin-bottom: 30px; margin-left: auto; margin-right: auto; width: auto; }
    .nav-links .login-icon { background-color: transparent; flex-direction: column; align-items: center; gap: 8px; width: auto; height: auto; color: yellow; box-shadow: none; }
    .nav-links .login-icon:hover { transform: scale(1.05); color: white; }
    .login-text { display: block; font-family: 'Poppins', sans-serif; font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 1px; color: white; }
    .dropdown-menu, .submenu-menu { position: static; width: 100%; overflow: hidden; transform: none; background: rgba(255, 255, 255, 0.05); backdrop-filter: none; padding: 0 20px; opacity: 1; visibility: visible; border: none; margin-top: 10px; transition: max-height 0.5s ease-out, padding-top 0.5s ease-out, padding-bottom 0.5s ease-out; max-height: 0; } 
    .submenu-menu { background: rgba(255, 255, 255, 0.1); }
    .submenu-active { max-height: 1000px; padding-top: 10px; padding-bottom: 10px; }
    .arrow-down, .arrow-right { transform: rotate(45deg) !important; }
    li.menu-item-open > a > .arrow-down, li.menu-item-open > a > .arrow-right { transform: rotate(225deg) !important; }
    .dropdown-menu a, .submenu-menu a { justify-content: center; }
    #admin-dashboard { padding: 10px; }
    .dashboard-container { padding: 0; box-shadow: none; background: transparent; padding-top: 80px; }
    .dashboard-content { padding: 0; } .dashboard-content table { border: none; } .dashboard-content thead { display: none; }
    .dashboard-content tr { display: flex; flex-direction: column; background-color: #fff; border: 1px solid #e0e0e0; border-radius: 8px; padding: 15px; margin-bottom: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.1); }
    .dashboard-content td { display: flex; flex-direction: column; text-align: left; padding: 8px 0; border: none; }
    .dashboard-content td:before { content: attr(data-label); font-size: 0.75em; font-weight: 600; color: #555; text-transform: uppercase; margin-bottom: 5px; }
    .dashboard-content td.user-card-title { font-size: 1.2em; font-weight: 700; padding-bottom: 10px; margin-bottom: 10px; border-bottom: 1px solid #eee; }
    .dashboard-content td.user-card-title:before { display: none; }
    .dashboard-content td span a { color: #3498db; word-break: break-all; }
    .dashboard-content td .editable-input { width: 100%; font-size: 1em; }
    td.actions-cell { flex-direction: row; gap: 10px; margin-top: 15px; padding-top: 15px; border-top: 1px solid #eee; }
    td.actions-cell:before { display: none; }
    .dashboard-header { align-items: flex-start; }
    #add-user-form { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
    .site-header { padding: 0 2vw; }
    .header-top-bar { flex-direction: row; justify-content: center; align-items: center; flex-wrap: wrap; gap: 15px; font-size: 12px; padding: 6px 0; }
    .contact-info { flex-direction: row; align-items: center; gap: 15px; }
    .social-icons { justify-content: center; gap: 15px; margin-top: 0; }
    .social-icons a i { font-size: 1.1rem; }
    .main-nav { padding: 8px 0; }
    .logo a { font-size: 15px; gap: 5px; }
    .logo img { height: 28px; }
    .hero-content { padding: 20px 4vw; font-size: 0.95em; }
    .search-form button { font-size: 14px; padding: 12px 0; }
    .search-bar input { font-size: 14px; padding: 12px 12px 12px 40px; }
    .login-icon { width: 36px; height: 36px; }
    .login-icon i { font-size: 1.2rem; }
    .brand-title { font-size: 1.5rem; } .brand-logo { max-width: 70px; }
    .dashboard-container { padding: 0 2vw; }
    table th, table td { padding: 6px 2px; font-size: 12px; }
    #add-user-form { grid-template-columns: 1fr; gap: 8px; }
    #add-user-form input, #add-user-form button { font-size: 13px; padding: 8px; }
}

@media (max-width: 340px) {
    .logo a { font-size: 12px; }
    .brand-title { font-size: 1.1rem; }
    .brand-logo { max-width: 45px; }
    .header-top-bar { font-size: 10px; }
}

/* --- DYNAMIC BACKGROUND ANIMATION --- */
body::before, body::after { content: ''; position: absolute; transform: rotate(-28deg); transition: clip-path 1.8s cubic-bezier(0.25, 1, 0.5, 1); }
body::before { background-color: #0F2D57; z-index: -1; width: 90vw; height: 45vh; top: -12vh; left: -30vw; filter: drop-shadow(5px 8px 15px rgba(2, 4, 8, 0.4)); clip-path: inset(100% 0 0 0); transition-delay: 0.2s; }
body::after { background-color: #0A192F; z-index: -2; width: 100vw; height: 110vh; bottom: -60vh; left: -10vw; clip-path: inset(100% 0 0 0); }
body.loaded::before, body.loaded::after { clip-path: inset(0 0 0 0); }