:root {
  /* White Greenish Glassy Theme */
  --bg-base: #fdfdfd;
  --bg-surface: #ffffff;
  --bg-card: rgba(255, 255, 255, 0.8);
  --bg-card-hover: rgba(255, 255, 255, 0.95);

  /* Glass effect (Premium & Translucent) */
  --glass-bg: rgba(255, 255, 255, 0.6);
  --glass-border: rgba(16, 185, 129, 0.15);
  --glass-shadow: 0 8px 32px rgba(16, 185, 129, 0.04);
  --glass-blur: blur(16px);

  /* New Global Gradient (Light, White-Greenish) */
  --gradient-primary: radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.08) 0, transparent 40%),
                      radial-gradient(at 100% 100%, rgba(52, 211, 153, 0.05) 0, transparent 40%),
                      linear-gradient(135deg, #ffffff 0%, #f7fefc 100%);

  /* Accent greens */
  --accent-primary: #10b981;
  --accent-bright: #059669;
  --accent-glow: #34d399;
  --accent-muted: rgba(16, 185, 129, 0.1);
  --accent-deep: rgb(6, 78, 59);         /* emerald-900 */
  --accent-muted: rgba(16, 185, 129, 0.1);

  /* Text - Darker for contrast */
  --text-primary: #0f172a;        /* slate-900 */
  --text-secondary: #475569;      /* slate-600 */
  --text-muted: #64748b;          /* slate-500 */
  --text-dim: #94a3b8;            /* slate-400 */

  /* Status colors */
  --status-success: #10b981;
  --status-warning: #f59e0b;
  --status-danger: #ef4444;
  --status-info: #3b82f6;
  --status-neutral: #64748b;
}

/* Hide scrollbar for Chrome, Safari and Opera */
*::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
* {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

body {
    background: var(--bg-base);
    color: var(--text-primary);
    overflow-x: hidden;
    font-family: 'Inter', sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Inter', -apple-system, sans-serif;
}

/* Global Form Visibility Fixes */
input, textarea, select {
    color: #0f172a !important; /* Force slate-900 */
    background-color: transparent !important;
}

input::placeholder, textarea::placeholder {
    color: #94a3b8;
}

.glass-card {
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-shadow);
  border-radius: 12px;
}

.glass-card-hover:hover {
  background: var(--bg-card-hover);
  border-color: rgba(16, 185, 129, 0.2);
  transform: translateY(-2px);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.glow-text {
  color: var(--accent-primary);
  text-shadow: 0 0 20px rgba(16, 185, 129, 0.2);
}

.gradient-text {
  background: linear-gradient(135deg, rgb(5, 150, 105), rgb(16, 185, 129), rgb(52, 211, 153));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.btn-primary {
  background: rgb(16 185 129);
  border: 1px solid rgba(16, 185, 129, 0.1);
  box-shadow: 0 4px 12px rgba(16, 185, 129, 0.15);
  color: white;
  font-weight: 800;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  padding: 0.5rem 1.25rem;
  border-radius: 0.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 10px;
}

.btn-primary:hover {
  background: rgb(5, 150, 105);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.25);
  transform: translateY(-1px);
}

.btn-primary:active {
    transform: scale(0.97);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--glass-border);
  color: var(--accent-primary);
  transition: all 0.2s;
  padding: 0.6rem 1.5rem;
  border-radius: 8px;
  display: inline-block;
  cursor: pointer;
}
.btn-ghost:hover {
  background: rgba(16, 185, 129, 0.05);
  border-color: var(--accent-primary);
}

/* Sidebar Specific */
.sidebar-link-active {
    background: rgba(16, 185, 129, 0.08);
    color: var(--accent-primary);
    border-right: 3px solid var(--accent-primary);
}

/* Animations */
@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 10px rgba(16,185,129,0.1); }
  50% { box-shadow: 0 0 20px rgba(16,185,129,0.2); }
}

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

.animate-pulse-glow { animation: pulseGlow 3s ease-in-out infinite; }
.animate-float { animation: float 6s ease-in-out infinite; }
.animate-fade-in { animation: fadeIn 0.4s ease-out; }

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

.animate-fade-in { animation: fadeIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards; }

/* Standardized Form Styling */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-size: 11px;
    font-weight: 900;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin-left: 0.25rem;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1.25rem;
    width: 1.25rem;
    height: 1.25rem;
    color: #94a3b8;
    transition: color 0.2s;
}

.form-control {
    width: 100%;
    background-color: #f8fafc !important;
    border: 1px solid #f1f5f9 !important;
    border-radius: 1.25rem;
    padding: 1rem 1.25rem 1rem 3.5rem !important;
    font-size: 14px;
    font-weight: 700;
    color: #0f172a !important;
    outline: none;
    transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

.form-control:focus {
    background-color: #ffffff !important;
    border-color: rgba(16, 185, 129, 0.3) !important;
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.08);
}

.form-control:focus + .input-icon {
    color: var(--accent-primary);
}

textarea.form-control {
    min-height: 120px;
    resize: none;
}

@keyframes modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.animate-modal-in {
    animation: modal-in 0.3s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.custom-scrollbar::-webkit-scrollbar {
    width: 6px;
}

.custom-scrollbar::-webkit-scrollbar-track {
    background: transparent;
}

.custom-scrollbar::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}

.custom-scrollbar::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

/* Markdown Content Styling */
.markdown-content ul {
    list-style-type: disc !important;
    padding-left: 1.25rem !important;
    margin: 1rem 0;
}

.markdown-content ol {
    list-style-type: decimal !important;
    padding-left: 1.25rem !important;
    margin: 1rem 0;
}

.markdown-content li {
    margin-bottom: 0.5rem;
    line-height: 1.6;
}

.markdown-content p {
    margin-bottom: 1rem;
    line-height: 1.6;
}

.markdown-content strong {
    font-weight: 800;
    color: var(--text-primary);
}

.markdown-content h1, .markdown-content h2, .markdown-content h3 {
    font-weight: 900;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

/* ==========================================================================
   GLOBAL MOBILE RESPONSIVENESS OVERRIDES
   These rules force Tailwind grids, flex layouts, and large elements to behave
   responsively on small screens without needing to edit dozens of HTML templates.
   ========================================================================== */
@media (max-width: 768px) {
    /* Layout structural overrides */
    body {
        font-size: 14px;
    }
    
    /* Sidebars and Navigation */
    aside, 
    .sidebar {
        position: relative !important;
        width: 100% !important;
        height: auto !important;
        min-height: auto !important;
        border-right: none !important;
        border-bottom: 1px solid var(--glass-border) !important;
        z-index: 40;
    }

    /* Main Content Padding reduction */
    main {
        padding: 1rem !important;
        margin-left: 0 !important; /* In case sidebar pushed it */
        width: 100% !important;
    }

    /* Padding & Margin reduction on cards */
    .p-6, .p-8, .p-10, .p-12,
    .px-6, .px-8, .px-10, .px-12 {
        padding: 1rem !important;
    }

    .glass-card {
        padding: 1rem !important;
        margin-bottom: 1rem !important;
    }

    /* Typography scaling */
    .text-4xl, .text-5xl, .text-6xl {
        font-size: 1.75rem !important;
        line-height: 2rem !important;
    }
    
    .text-3xl {
        font-size: 1.5rem !important;
        line-height: 1.75rem !important;
    }
    
    h1 { font-size: 1.75rem !important; }
    h2 { font-size: 1.5rem !important; }

    /* Tables */
    .overflow-x-auto table,
    .min-w-full {
        display: block !important;
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        white-space: nowrap !important;
    }

    /* Drawers and Modals */
    .fixed, .absolute {
        max-width: 100vw !important;
    }
    
    .w-full.max-w-md,
    .w-full.max-w-lg,
    .w-full.max-w-xl,
    .w-full.max-w-2xl,
    .w-full.max-w-3xl,
    .w-full.max-w-4xl {
        width: 95% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    /* Button and Form sizing */
    input, select, textarea {
        font-size: 16px !important; /* Prevents iOS zooming on input focus */
    }

    /* Prevent horizontal scrolling entirely */
    body, html {
        max-width: 100vw !important;
        overflow-x: hidden !important;
    }
}
