/* ==================== RESET & BASE ==================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Vazirmatn", "Segoe UI", Tahoma, sans-serif;
}

body {
  direction: rtl;
  min-height: 100vh;
  background: linear-gradient(
    135deg,
    #667eea 0%,
    #764ba2 50%,
    #f093fb 100%
  );
  background-attachment: fixed;
  color: #2d3748;
}

.hidden {
  display: none;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
  height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  background: linear-gradient(
    135deg,
    #667eea 0%,
    #764ba2 50%,
    #f093fb 100%
  );
  background-attachment: fixed;
  position: relative;
  overflow: hidden;
}

.login-page::before {
  content: "";
  position: absolute;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  border-radius: 50%;
  top: -200px;
  right: -200px;
  animation: float 8s ease-in-out infinite;
}

.login-page::after {
  content: "";
  position: absolute;
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
  border-radius: 50%;
  bottom: -100px;
  left: -100px;
  animation: float 10s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-30px) rotate(5deg); }
}

.login-card {
  width: 420px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  padding: 48px 40px;
  border-radius: 24px;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3),
              0 0 0 1px rgba(255, 255, 255, 0.3) inset;
  text-align: center;
  position: relative;
  z-index: 1;
  animation: slideUp 0.6s ease-out;
}

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

.login-card h3 {
  margin-bottom: 32px;
  color: #6b46c1;
  font-size: 28px;
  font-weight: 800;
  text-shadow: 0 2px 10px rgba(107, 70, 193, 0.2);
  position: relative;
}

.login-card h3::after {
  content: "";
  position: absolute;
  bottom: -12px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 4px;
  background: linear-gradient(90deg, #667eea, #764ba2);
  border-radius: 2px;
}

.login-card input {
  width: 100%;
  padding: 16px 20px;
  margin-bottom: 16px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  font-size: 15px;
  background: #ffffff;
  transition: all 0.3s ease;
}

.login-card input:focus {
  outline: none;
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.login-card input::placeholder {
  color: #a0aec0;
}

.login-card button {
  width: 100%;
  padding: 16px;
  margin-top: 8px;
  border-radius: 12px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(102, 126, 234, 0.4);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

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

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

.login-card button:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(102, 126, 234, 0.5);
}

.login-card button:active {
  transform: translateY(-1px);
}

.login-card p {
  margin-top: 16px;
}

/* ==================== DASHBOARD LAYOUT ==================== */
.layout {
  display: flex;
  min-height: 100vh;
}

/* ==================== HEADER ==================== */
header,
.header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 24px 40px;
  border-radius: 0 0 32px 32px;
  box-shadow: 0 15px 40px rgba(102, 126, 234, 0.3);
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(10px);
}

header h1,
.header h1,
header h2,
.header h2,
.dashboard-title {
  color: #ffffff;
  font-size: 28px;
  font-weight: 800;
  letter-spacing: 0.5px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ==================== LOGOUT BUTTON ==================== */
button,
.btn {
  cursor: pointer;
}

button.logout-btn,
header button,
#logoutBtn {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 700;
  box-shadow: 0 10px 25px rgba(245, 87, 108, 0.4);
  transition: all 0.3s ease;
}

button.logout-btn:hover,
header button:hover,
#logoutBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 35px rgba(245, 87, 108, 0.6);
}

/* ==================== SIDEBAR / NAV ==================== */
nav,
.sidebar {
  margin-top: 24px;
  padding: 20px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

nav button,
.sidebar button {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 14px 24px;
  font-weight: 700;
  font-size: 15px;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

nav button::before,
.sidebar 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 ease;
}

nav button:hover::before,
.sidebar button:hover::before {
  left: 100%;
}

nav button:hover,
.sidebar button:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);
}

nav a,
.sidebar a {
  display: block;
  padding: 12px;
  margin-bottom: 8px;
  border-radius: 8px;
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  font-size: 14px;
}

nav a:hover,
.sidebar a:hover {
  background: rgba(255,255,255,.18);
}

/* ==================== MAIN CONTENT ==================== */
main,
.main-content,
.content {
  position: relative;
  margin: 28px;
  padding: 40px;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(20px);
  border-radius: 28px;
  min-height: 75vh;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15);
  overflow: hidden;
  flex: 1;
}

main::before,
.main-content::before,
.content::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("https://images.unsplash.com/photo-1625246333195-78d9c38ad449")
    no-repeat center bottom / 800px;
  opacity: 0.05;
  pointer-events: none;
}

/* ==================== FORMS ==================== */
.form {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 24px;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
}

.form input,
input,
select {
  padding: 14px 18px;
  border-radius: 12px;
  border: 2px solid #e2e8f0;
  outline: none;
  font-size: 15px;
  transition: all 0.3s ease;
  background: #ffffff;
}

.form input:focus,
input:focus,
select:focus {
  border-color: #667eea;
  box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.15);
  transform: translateY(-2px);
}

.form button,
#addProvinceBtn {
  padding: 14px 28px;
  border-radius: 12px;
  border: none;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(102, 126, 234, 0.35);
  transition: all 0.3s ease;
}

.form button:hover,
#addProvinceBtn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 28px rgba(102, 126, 234, 0.5);
}

/* ==================== TABLE ==================== */
table {
  width: 100%;
  background: #fff;
  border-collapse: collapse;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
  margin-top: 24px;
}

th {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #fff;
  padding: 16px;
  text-align: center;
  font-weight: 700;
  font-size: 15px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

td {
  padding: 16px;
  text-align: center;
  border-bottom: 1px solid #e2e8f0;
  font-size: 14px;
  transition: background 0.3s ease;
}

tr:hover {
  background: linear-gradient(90deg, rgba(102, 126, 234, 0.05) 0%, rgba(118, 75, 162, 0.05) 100%);
}

tr:last-child td {
  border-bottom: none;
}

/* ==================== ACTION BUTTONS IN TABLE ==================== */
table button,
td button {
  background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 700;
  transition: all 0.3s ease;
  box-shadow: 0 6px 15px rgba(245, 87, 108, 0.35);
}

table button:hover,
td button:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 10px 22px rgba(245, 87, 108, 0.5);
}

/* ==================== PAGE SECTIONS ==================== */
.page {
  animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.page h3 {
  color: #667eea;
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 24px;
  padding-bottom: 12px;
  border-bottom: 3px solid #667eea;
  display: inline-block;
}

section {
  position: relative;
  z-index: 1;
}

/* ==================== FOOTER SPACING ==================== */
footer {
  margin-top: 40px;
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
  .login-card {
    width: 90%;
    padding: 32px 24px;
  }
  
  header,
  .header {
    flex-direction: column;
    gap: 16px;
    text-align: center;
  }
  
  main,
  .content {
    margin: 16px;
    padding: 24px;
  }
  
  nav,
  .sidebar {
    flex-direction: column;
  }
}
