/* --- START OF FILE style.css --- */

/* 1. CSS Variables for consistent theming */
:root {
  --primary-blue: #0D1B2A;       /* Deep Navy */
  --secondary-blue: #1B263B;     /* Lighter Navy */
  --accent-blue: #415A77;        /* Greyish Blue */
  --highlight: #00d4ff;          /* Bright Cyan (Pop color) */
  --bg-body: #f4f7fa;            /* Very light grey-blue (Easy on eyes) */
  --text-main: #333333;
  --text-muted: #6c757d;
  --font-main: 'Vazirmatn', sans-serif;
  --font-display: 'Lalezar', sans-serif;
}

/* 2. Global Resets & Typography */
html, body {
  height: 100%;
  margin: 0;
  padding: 0;
  scroll-behavior: smooth;
}

body {
  background-color: var(--bg-body);
  /* A subtle pattern to make it look premium without distraction */
  background-image: radial-gradient(#e2e8f0 1px, transparent 1px);
  background-size: 20px 20px;
  
  color: var(--text-main);
  direction: rtl;
  font-family: var(--font-main);
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--primary-blue);
}

/* 3. Utility Classes */
.text-primary-custom {
  color: var(--primary-blue) !important;
}

/* Main Content Wrapper (keeps footer down if you have one) */
.main-wrapper {
  min-height: 80vh;
  padding-bottom: 3rem;
  /* Adds a fade-in effect for every page load */
  animation: fadeIn 0.6s ease-in-out;
}

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

/* 4. Scrollbar Customization (Chrome/Safari) */
::-webkit-scrollbar {
  width: 10px;
}
::-webkit-scrollbar-track {
  background: #f1f1f1;
}
::-webkit-scrollbar-thumb {
  background: var(--accent-blue);
  border-radius: 5px;
}
::-webkit-scrollbar-thumb:hover {
  background: var(--primary-blue);
}

/* 5. Navbar Override (We will refine nav.html later, but this sets the base) */
.navbar {
  box-shadow: 0 4px 15px rgba(0,0,0,0.05);
  background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%) !important;
}

/* 6. Card Base Styles (Modernized) */
.card {
  border: none;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 4px 6px rgba(0, 0, 0, 0.02), 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

/* 7. Loading Animation (Refined) */
#loading {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(5px);
}

/* ---- Navbar Customization ---- */

/* Overriding the base navbar gradient for a more 'Glassy' tech look */
.custom-navbar {
    background: rgba(13, 27, 42, 0.95) !important; /* Semi-transparent Primary Blue */
    backdrop-filter: blur(10px); /* Blurs content behind the nav */
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 0.8rem;
    padding-bottom: 0.8rem;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.navbar-brand {
    font-family: var(--font-display); /* Lalezar */
    font-size: 1.8rem;
    color: #ffffff !important;
    letter-spacing: 1px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.navbar-nav .nav-link {
    font-family: var(--font-main);
    font-weight: 500;
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.8) !important;
    transition: color 0.3s ease, transform 0.2s ease;
    position: relative;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    color: #ffffff !important;
    transform: translateY(-1px);
}

/* Optional: Underline effect on hover */
.navbar-nav .nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 5px;
    left: 50%;
    background-color: var(--highlight); /* Cyan color */
    transition: all 0.3s ease;
    transform: translateX(-50%);
}

.navbar-nav .nav-link:hover::after {
    width: 80%;
}

/* Logout Button */
.btn-logout {
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white;
    font-family: var(--font-main);
    transition: all 0.3s ease;
}

.btn-logout:hover {
    background-color: rgba(255, 73, 73, 0.15); /* Subtle red tint */
    border-color: #ff4949;
    color: #ff4949;
}

/* ---- Login Page Styling ---- */

/* Center the card relative to viewport height */
.login-wrapper {
  /* Optional: A subtle mesh gradient background just for login */
  background: radial-gradient(circle at 10% 20%, rgb(242, 246, 252) 0%, rgb(227, 235, 245) 90%);
}

.auth-card {
  width: 100%;
  max-width: 400px; /* Constrain width */
  border: 1px solid rgba(255, 255, 255, 0.6);
  border-radius: 16px;
}

.brand-title {
  font-family: var(--font-display);
  color: var(--primary-blue);
  letter-spacing: -1px;
}

/* Badge styling for "Login to Account" */
.bg-primary-soft {
  background-color: rgba(13, 27, 42, 0.08);
}

/* Form Inputs */
.form-control {
  background-color: #f8f9fa;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  transition: all 0.2s ease-in-out;
}

.form-control:focus {
  background-color: #ffffff;
  border-color: var(--highlight);
  box-shadow: 0 0 0 4px rgba(0, 212, 255, 0.15); /* Soft cyan glow */
}

/* Custom Login Button */
.btn-login-custom {
  background: linear-gradient(135deg, var(--primary-blue) 0%, #0056b3 100%);
  border: none;
  font-size: 1.1rem;
  transition: transform 0.2s;
  box-shadow: 0 4px 10px rgba(13, 27, 42, 0.2);
}

.btn-login-custom:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(13, 27, 42, 0.3);
}


/* ---- Home/Dashboard Page ---- */

.feature-card {
  border: 1px solid rgba(0,0,0,0.05); /* Very subtle border */
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.feature-card:hover {
  border-color: var(--highlight); 
  /* Note: The global .card:hover transform in style.css will also apply here */
}

/* Icon Circles */
.icon-circle {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  margin: 0 auto;
}

/* Specific Colors for features */
.bg-blue-light {
  background-color: rgba(13, 27, 42, 0.08); /* Light tint of Primary Blue */
  color: var(--primary-blue);
}

.bg-green-light {
  background-color: rgba(25, 135, 84, 0.1); /* Light tint of Success Green */
  color: #198754;
}

/* Override Outline Buttons to be bolder */
.btn-outline-primary, .btn-outline-success {
    border-width: 2px;
}
.btn-outline-primary:hover {
    background-color: var(--primary-blue);
    border-color: var(--primary-blue);
}


/* ---- Search Page & Forms ---- */

/* Custom styling for Django's default {{ form.as_p }} output */
.django-form-custom p {
    margin-bottom: 1.5rem;
}

.django-form-custom label {
    display: block; /* Forces label to be on its own line */
    margin-bottom: 0.5rem;
    color: var(--primary-blue);
    font-size: 1rem;
}

.django-form-custom input[type="text"],
.django-form-custom input[type="number"],
.django-form-custom select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ced4da;
    border-radius: 0.5rem;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.django-form-custom input:focus,
.django-form-custom select:focus {
    border-color: var(--highlight);
    outline: 0;
    box-shadow: 0 0 0 0.25rem rgba(13, 27, 42, 0.1); /* Primary Blue shadow */
}

/* Toast/Alert Adjustments */
.toast-container {
    pointer-events: none; /* Allows clicking through empty space */
}
.toast {
    pointer-events: auto; /* Re-enable clicks on the actual toast */
}


/* ---- Loading Overlay ---- */

.loading-overlay {
    position: fixed;
    top: 0; 
    left: 0;
    width: 100%; 
    height: 100%;
    z-index: 9999;
    
    /* Glassmorphism Background */
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    
    display: flex; /* Centered by flexbox in inline style, but good to have here */
    justify-content: center;
    align-items: center;
    flex-direction: column;
    
    animation: fadeInOverlay 0.3s ease-in-out;
}

@keyframes fadeInOverlay {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Custom Dual-Ring Spinner */
.custom-loader {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 5px solid transparent;
    border-top-color: var(--primary-blue);
    border-bottom-color: var(--highlight);
    
    animation: spinLoader 1.5s linear infinite;
    box-shadow: 0 0 15px rgba(13, 27, 42, 0.1);
}

@keyframes spinLoader {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-content h4 {
    margin-top: 1rem;
    font-family: var(--font-display);
    letter-spacing: 0.5px;
}


/* ---- Result Page ---- */

.success-icon svg {
    filter: drop-shadow(0 4px 6px rgba(25, 135, 84, 0.4));
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(1); }
}

/* Monospace font for the ID so it looks like data */
.font-monospace {
    font-family: 'Courier New', Courier, monospace;
    letter-spacing: 1px;
}

/* Add this to your style.css */

.bg-red-light {
  background-color: rgba(220, 53, 69, 0.1); /* Light tint of Danger Red */
  color: #dc3545;
}

/* Ensure outline danger buttons have a slightly thicker border to match the design */
.btn-outline-danger {
    border-width: 2px;
}
.btn-outline-danger:hover {
    box-shadow: 0 4px 10px rgba(220, 53, 69, 0.3);
}


/* ---- Comparison Page Buttons ---- */

.btn-gradient-success {
    background: linear-gradient(135deg, #198754 0%, #146c43 100%);
    border: none;
    color: white;
    box-shadow: 0 4px 6px rgba(25, 135, 84, 0.2);
    transition: all 0.3s ease;
}

.btn-gradient-success:hover {
    background: linear-gradient(135deg, #157347 0%, #0f5132 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(25, 135, 84, 0.3);
    color: white;
}

/* ---- Dictionary Page ---- */

/* Custom Dark Header (matches Navbar) */
.bg-primary-dark {
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--secondary-blue) 100%);
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

/* Scrollable Table Container */
.dict-table-wrapper {
    max-height: 500px;
    overflow-y: auto;
    background-color: #fff;
    /* Custom scrollbar for this specific box */
    scrollbar-width: thin;
    scrollbar-color: var(--accent-blue) #f1f1f1;
}

/* Sticky Header Styles */
.dict-table-wrapper thead th {
    background-color: #f8f9fa; /* Light grey header */
    box-shadow: 0 2px 2px -1px rgba(0, 0, 0, 0.1); /* Subtle shadow for depth */
    border-bottom: 2px solid #e9ecef;
}

/* Custom Delete Icon Button */
.btn-icon-danger {
    color: #6c757d;
    border: 1px solid transparent;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-icon-danger:hover {
    color: #dc3545;
    background-color: rgba(220, 53, 69, 0.1);
    transform: scale(1.1);
}

/* Dashed border for the 'Add New' section */
.border-dashed {
    border-style: dashed !important;
    background-color: #fafbfc !important;
}

