/* ===================================
   Root Variables - Single Color Theme
   =================================== */

:root {
  /* Primary Brand Color */
  --primary-color: #3A3B79;
  --primary-light: #484983;
  --primary-dark: #292A6C;

  /* Neutral Colors */
  --text-dark: #1f2937;
  --text-medium: #4b5563;
  --text-light: #6b7280;
  --bg-light: #f9fafb;
  --bg-white: #ffffff;
  --border-color: #e5e7eb;

  /* Status Colors */
  --success-color: #10b981;
  --danger-color: #ef4444;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px rgba(0, 0, 0, 0.07);
  --shadow-lg: 0 10px 15px rgba(0, 0, 0, 0.1);

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  background: var(--bg-light);
  color: var(--text-dark);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===================================
   Login Page Styles
   =================================== */

.login-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-dark) 100%
  );
}

.login-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 450px;
  width: 100%;
  animation: slideUp 0.5s ease;
}


.register-card {
  background: white;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: 2.5rem;
  max-width: 1050px;
  width: 100%;
  animation: slideUp 0.5s ease;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-icon {
  width: 80px;
  height: 80px;
  background: var(--primary-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  box-shadow: 0 8px 20px rgba(79, 70, 229, 0.3);
}

.login-icon i {
  font-size: 2rem;
  color: white;
}

.login-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.login-subtitle {
  color: var(--text-light);
  font-size: 1rem;
  margin: 0;
}

.form-group {
  margin-bottom: 1.5rem;
}

.form-label {
  display: block;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.form-input {
  width: 100%;
  padding: 1rem 1.25rem;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 1rem;
  transition: all 0.3s ease;
  background: var(--bg-light);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.form-hint {
  font-size: 0.85rem;
  color: var(--text-light);
  margin-top: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.form-hint i {
  color: var(--primary-color);
}

.submit-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(79, 70, 229, 0.3);
}

.submit-btn:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 6px 25px rgba(79, 70, 229, 0.4);
}

.submit-btn:active {
  transform: translateY(0);
}

.alert-error {
  background: #fef2f2;
  border: 2px solid var(--danger-color);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: 1.5rem;
  color: #991b1b;
  font-size: 0.95rem;
  line-height: 1.6;
  animation: shake 0.5s ease;
}

@keyframes shake {
  0%,
  100% {
    transform: translateX(0);
  }
  25% {
    transform: translateX(-10px);
  }
  75% {
    transform: translateX(10px);
  }
}

.features {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 2rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.feature-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.9rem;
  color: var(--text-light);
}

.feature-icon {
  width: 36px;
  height: 36px;
  background: var(--primary-color);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.feature-icon i {
  color: white;
  font-size: 0.9rem;
}

/* ===================================
   Main Content Area
   =================================== */

.main-content {
  padding: 2rem 0 3rem;
  min-height: calc(100vh - 80px);
}

/* Welcome Header */
.welcome-header {
  text-align: center;
  padding: 1rem 1rem;
}

.welcome-text {
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
}

.welcome-text .user-name {
  color: var(--primary-color);
  font-weight: 700;
}

/* Page Title */
.page-header {
  text-align: center;
  margin-bottom: 2rem;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.page-title i {
  color: var(--primary-color);
}

.page-subtitle {
  color: var(--text-light);
  font-size: 1rem;
  margin: 0;
}

/* ===================================
   Category Filter Dropdown
   =================================== */

.category-filter-container {
  margin-bottom: 2rem;
  background: white;
  padding: 1.25rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.filter-label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.75rem;
}

.filter-label i {
  color: var(--primary-color);
  font-size: 1rem;
}

.category-select {
  width: 100%;
  padding: 0.875rem 1rem;
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-dark);
  background: var(--bg-light);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234F46E5' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  padding-right: 2.5rem;
}

.category-select:hover {
  border-color: var(--primary-color);
  background-color: white;
}

.category-select:focus {
  outline: none;
  border-color: var(--primary-color);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

.category-select option {
  padding: 0.5rem;
  font-weight: 500;
}

/* ===================================
   Templates Grid - Full Size Display
   =================================== */

.templates-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.template-card {
  background: white;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all 0.3s ease;
  animation: fadeIn 0.5s ease;
}

.template-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.template-preview {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: var(--bg-light);
}

.template-image {
  width: 100%;
  height: auto;
  display: block;
  object-fit: contain;
}

.template-overlay {
  position: absolute;
  bottom: 0;
  width: 100%;
  object-fit: cover;
  pointer-events: none;
}

.template-info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.template-header {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  align-items: center;
}

.template-name {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-dark);
  margin: 0;
  text-align: center;
}

.category-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.4rem 0.875rem;
  background: var(--primary-color);
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  border-radius: var(--radius-lg);
  white-space: nowrap;
}

.category-badge i {
  font-size: 0.75rem;
}

.download-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 0.875rem;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: var(--radius-md);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
}

.download-btn:hover:not(:disabled) {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.4);
}

.download-btn:active:not(:disabled) {
  transform: translateY(0);
}

.download-btn:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.download-btn i {
  font-size: 1rem;
}

/* ===================================
   Empty States
   =================================== */

.empty-state,
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-light);
}

.empty-state i,
.no-results i {
  font-size: 4rem;
  color: var(--border-color);
  margin-bottom: 1rem;
}

.empty-state h5,
.no-results h5 {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.empty-state p,
.no-results p {
  font-size: 1rem;
  margin: 0;
}

/* ===================================
   Responsive Design
   =================================== */

/* Tablet */
@media (max-width: 992px) {
  .templates-grid {
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
  }
}

/* Mobile */
@media (max-width: 768px) {
  .templates-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .welcome-text {
    font-size: 1.25rem;
  }

  .page-title {
    font-size: 1.5rem;
  }

  .page-subtitle {
    font-size: 0.9rem;
  }

  .category-filter-container {
    padding: 1rem;
  }

  .filter-label {
    font-size: 0.9rem;
  }

  .category-select {
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
  }

  .template-info {
    padding: 1rem;
  }

  .template-name {
    font-size: 1rem;
  }

  .download-btn {
    padding: 0.75rem;
    font-size: 0.95rem;
  }
}

/* Small Mobile */
@media (max-width: 576px) {
  .login-card {
    padding: 2rem 1.5rem;
  }

  .login-title {
    font-size: 1.5rem;
  }

  .login-subtitle {
    font-size: 0.9rem;
  }

  .features {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .form-input {
    padding: 0.875rem 1rem;
  }

  .submit-btn {
    padding: 0.875rem;
  }

  .welcome-text {
    font-size: 1.1rem;
  }

  .page-title {
    font-size: 1.25rem;
  }

  .category-tab span {
    display: none;
  }

  .category-tab i {
    margin: 0;
  }

  .main-content {
    padding: 0;
  }
}

/* ===================================
   Loading & Animations
   =================================== */

@keyframes spin {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}

.fa-spinner {
  animation: spin 1s linear infinite;
}

/* ===================================
   Utility Classes
   =================================== */

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1rem;
}

@media (min-width: 768px) {
  .container {
    padding: 0 2rem;
  }
}
