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

:root {
  --primary: #4361ee;
  --primary-dark: #3a56d4;
  --secondary: #3f37c9;
  --accent: #4895ef;
  --success: #4cc9f0;
  --warning: #f72585;
  --light-bg: #f8f9fa;
  --dark-bg: #212529;
  --text-dark: #212529;
  --text-light: #f8f9fa;
  --border-color: #dee2e6;
  --card-bg: #e5a3f5;
  --sidebar-width: 240px;
}

body {
  margin: 0;
  font-family: 'Inter', 'Roboto', sans-serif;
  background-color: var(--light-bg);
  color: var(--text-dark);
  line-height: 1.6;
  display: flex;
  min-height: 100vh;
}

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  background-color: var(--dark-bg);
  color: var(--text-light);
  position: fixed;
  height: 100vh;
  overflow-y: auto;
  transition: all 0.3s ease;
  z-index: 1000;
}

.sidebar-header {
  padding: 20px;
  display: flex;
  align-items: center;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h1 {
  font-size: 24px;
  font-weight: 700;
  color: white;
  margin: 0;
}

.menu-items {
  padding: 0;
  list-style: none;
}

.menu-item {
  padding: 15px 20px;
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.7);
  text-decoration: none;
  transition: all 0.3s ease;
  border-left: 3px solid transparent;
}

.menu-item:hover, .menu-item.active {
  background-color: rgba(255, 255, 255, 0.05);
  color: white;
  border-left-color: var(--primary);
}

.menu-item i {
  margin-right: 10px;
  font-size: 18px;
}

/* Main Content */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-width);
  transition: all 0.3s ease;
}

/* Header */
.top-header {
  background: white;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
  padding: 15px 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 900;
}

.top-header .user-info {
  display: flex;
  align-items: center;
  gap: 15px;
}

.balance-badge {
  font-size: 14px;
  font-weight: 600;
  padding: 6px 12px;
  background: var(--light-bg);
  color: var(--text-dark);
  border-radius: 30px;
  display: inline-flex;
  align-items: center;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.balance-badge i {
  margin-right: 6px;
  color: var(--primary);
}

.logout-btn {
  color: var(--text-dark);
  text-decoration: none;
  background: var(--light-bg);
  padding: 8px 16px;
  border-radius: 30px;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.logout-btn:hover { 
  background: var(--dark-bg);
  color: white;
}

.logout-btn i {
  margin-right: 6px;
}

/* Container */
.container {
  max-width: 1200px;
  margin: 30px auto;
  padding: 0 30px;
}

/* Page Title */
.page-title {
  margin-bottom: 25px;
  position: relative;
  padding-bottom: 15px;
}

.page-title h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.page-title::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 60px;
  height: 4px;
  background: var(--primary);
  border-radius: 2px;
}

/* Tab Navigation */
.tab-navigation {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 30px;
}

.tab-link {
  padding: 12px 24px;
  font-weight: 500;
  color: var(--text-dark);
  text-decoration: none;
  position: relative;
}

.tab-link.active {
  color: var(--primary);
}

.tab-link.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--primary);
  border-radius: 3px 3px 0 0;
}

/* Cards */
.card {
  background: var(--card-bg);
  padding: 25px;
  margin-bottom: 30px;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  position: relative;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.card h2 { 
  margin-top: 0;
  margin-bottom: 20px;
  font-size: 20px;
  font-weight: 600;
  color: var(--text-dark);
  display: flex;
  align-items: center;
}

.card h2 i {
  margin-right: 10px;
  color: var(--primary);
  font-size: 22px;
}

/* Forms */
form label {
  display: block;
  margin: 0 0 8px;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 14px;
}

form input, form textarea, form select {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  background: white;
  color: var(--text-dark);
  font-size: 14px;
  transition: all 0.3s ease;
}

form input:focus, form textarea:focus, form select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

form input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-right: 10px;
  accent-color: var(--primary);
}

form textarea { 
  resize: vertical;
  min-height: 120px;
}

.form-control {
  margin-bottom: 20px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.btn i {
  margin-right: 8px;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(67, 97, 238, 0.2);
}

.btn-secondary {
  background: var(--light-bg);
  color: var(--text-dark);
}

.btn-secondary:hover {
  background: var(--border-color);
  transform: translateY(-2px);
}

.btn-success {
  background: var(--success);
  color: white;
}

.btn-success:hover {
  background: #39b9df;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(76, 201, 240, 0.2);
}

.btn-danger {
  background: var(--warning);
  color: white;
}

.btn-danger:hover {
  background: #e01e79;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(247, 37, 133, 0.2);
}

.btn-block {
  display: block;
  width: 100%;
}

/* Form tabs */
.form-tabs {
  margin-bottom: 25px;
}

.tab-links {
  display: flex;
  background: var(--light-bg);
  border-radius: 12px;
  padding: 5px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.tab-link {
  flex: 1;
  padding: 12px 20px;
  text-align: center;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  border-radius: 8px;
  color: var(--text-dark);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tab-link i {
  margin-right: 8px;
  font-size: 16px;
}

.tab-link.active {
  background: var(--primary);
  color: white;
  box-shadow: 0 2px 8px rgba(67, 97, 238, 0.3);
}

.tab-content {
  display: none;
  padding: 10px 0;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

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

.form-help {
  font-size: 13px;
  color: #6c757d;
  margin-top: 6px;
  display: block;
}

.form-group {
  margin-bottom: 25px;
  padding: 20px;
  border-radius: 10px;
  background: var(--light-bg);
  border: 1px solid var(--border-color);
}

.form-section {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
  margin-bottom: 20px;
}

.form-section-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 15px;
  color: var(--text-dark);
  display: flex;
  align-items: center;
}

.form-section-title i {
  margin-right: 8px;
  color: var(--primary);
}

.hidden {
  display: none;
}

/* Response display */
.response {
  background: white;
  padding: 20px;
  margin-top: 25px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.alert {
  padding: 16px 20px;
  margin: 15px 0;
  border-radius: 10px;
  display: flex;
  align-items: flex-start;
  position: relative;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  border: 1px solid transparent;
}

.alert::before {
  content: '';
  display: block;
  width: 20px;
  height: 20px;
  margin-right: 15px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}

.alert-success {
  background-color: rgba(76, 201, 240, 0.1);
  border-color: rgba(76, 201, 240, 0.3);
  color: #0a7993;
}

.alert-success::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-.997-6l7.07-7.071-1.414-1.414-5.656 5.657-2.829-2.829-1.414 1.414L11.003 16z' fill='%230a7993'/%3E%3C/svg%3E");
}

.alert-error {
  background-color: rgba(247, 37, 133, 0.1);
  border-color: rgba(247, 37, 133, 0.3);
  color: #b91c65;
}

.alert-error::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1-7v2h2v-2h-2zm0-8v6h2V7h-2z' fill='%23b91c65'/%3E%3C/svg%3E");
}

.alert-info {
  background-color: rgba(67, 97, 238, 0.1);
  border-color: rgba(67, 97, 238, 0.3);
  color: #3a56d4;
}

.alert-info::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm-1-11v6h2v-6h-2zm0-4v2h2V7h-2z' fill='%233a56d4'/%3E%3C/svg%3E");
}

.alert-warning {
  background-color: rgba(255, 181, 71, 0.1);
  border-color: rgba(255, 181, 71, 0.3);
  color: #b56d16;
}

.alert-warning::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' width='24' height='24'%3E%3Cpath fill='none' d='M0 0h24v24H0z'/%3E%3Cpath d='M12.866 3l9.526 16.5a1 1 0 0 1-.866 1.5H2.474a1 1 0 0 1-.866-1.5L11.134 3a1 1 0 0 1 1.732 0zM11 16v2h2v-2h-2zm0-7v5h2V9h-2z' fill='%23b56d16'/%3E%3C/svg%3E");
}

/* Progress tracking */
.progress-container {
  margin-top: 30px;
  background: white;
  border-radius: 10px;
  padding: 25px;
  border: 1px solid var(--border-color);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.progress-bar {
  height: 12px;
  background: var(--light-bg);
  border-radius: 6px;
  overflow: hidden;
  margin: 20px 0;
  position: relative;
}

.progress-fill {
  height: 100%;
  background: linear-gradient(to right, var(--primary), var(--accent));
  transition: width 0.5s;
  border-radius: 6px;
  box-shadow: 0 0 10px rgba(67, 97, 238, 0.4);
}

.progress-text {
  margin: 15px 0;
  text-align: center;
  font-weight: 500;
  color: var(--text-dark);
  font-size: 15px;
}

.progress-stats {
  display: flex;
  justify-content: space-between;
  margin-top: 15px;
  color: var(--text-dark);
  background: var(--light-bg);
  padding: 12px 20px;
  border-radius: 8px;
  font-weight: 500;
}

.progress-label {
  display: block;
  text-align: center;
  margin-bottom: 5px;
  font-size: 12px;
  color: #6c757d;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Character counter */
.char-counter {
  margin-top: 8px;
  text-align: right;
  font-size: 13px;
  color: #6c757d;
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

.char-counter.limit-near {
  color: #b56d16;
}

.char-counter.limit-reached {
  color: #b91c65;
}

.char-counter::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #6c757d;
  margin-right: 6px;
}

.char-counter.limit-near::before {
  background-color: #b56d16;
}

.char-counter.limit-reached::before {
  background-color: #b91c65;
}

/* Login page */
.login-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background-color: var(--light-bg);
  background-image: linear-gradient(135deg, #f5f7fa 0%, #e4e8ef 100%);
}

.login-container {
  background: white;
  padding: 40px;
  border-radius: 16px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
  width: 400px;
  max-width: 90%;
  border: 1px solid rgba(0, 0, 0, 0.05);
}

.login-logo {
  text-align: center;
  margin-bottom: 30px;
}

.login-logo h1 {
  font-size: 28px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.login-logo p {
  font-size: 14px;
  color: #6c757d;
  margin-top: 5px;
}

.login-container h2 { 
  text-align: center; 
  margin-bottom: 25px; 
  color: var(--text-dark);
  font-size: 20px;
  font-weight: 600;
}

.login-form {
  margin-top: 30px;
}

.login-form .form-control {
  margin-bottom: 20px;
  position: relative;
}

.login-form label {
  display: block;
  margin-bottom: 8px;
  font-weight: 500;
  color: var(--text-dark);
}

.login-form input {
  width: 100%;
  padding: 12px 15px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  transition: all 0.3s ease;
}

.login-form input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.15);
}

.login-form .btn {
  width: 100%;
  margin-top: 10px;
}

.login-form .error { 
  color: var(--warning);
  text-align: center; 
  margin: 15px 0;
  padding: 10px;
  border-radius: 8px;
  background-color: rgba(247, 37, 133, 0.1);
  border: 1px solid rgba(247, 37, 133, 0.2);
  font-size: 14px;
}

/* Loading indicator */
.loading {
  display: inline-block;
  width: 24px;
  height: 24px;
  border: 3px solid rgba(67, 97, 238, 0.2);
  border-radius: 50%;
  border-top-color: var(--primary);
  animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Responsive adjustments */
@media (max-width: 992px) {
  .sidebar {
    transform: translateX(-100%);
  }
  
  .sidebar.active {
    transform: translateX(0);
  }
  
  .main-content {
    margin-left: 0;
  }
  
  .top-header {
    padding-left: 15px;
    padding-right: 15px;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 15px;
  }
  
  .top-header {
    flex-wrap: wrap;
  }
  
  .top-header .user-info {
    margin-top: 10px;
    width: 100%;
    justify-content: space-between;
  }
  
  .btn {
    padding: 10px 20px;
  }
  
  .tab-link {
    padding: 10px 15px;
    font-size: 13px;
  }
  
  .tab-link i {
    margin-right: 5px;
  }
}

@media (max-width: 576px) {  
  .login-container {
    padding: 30px 20px;
  }
  
  .form-group {
    padding: 15px;
  }
  
  .progress-stats {
    flex-direction: column;
    gap: 10px;
  }
}
