/*
 * File: assets/css/style.css
 * Purpose: To store all custom styles and theme variables.
*/

/* 1. Import Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;700&family=Orbitron:wght@700&display=swap');

/* 2. Theme Color Variable Definitions */
:root {
  /* Variables for Light Theme (Default) */
  --color-bg: #f9fafb; /* Slate 50 */
  --color-text: #111827; /* Gray 900 */
  --color-text-muted: #6b7280; /* Gray 500 */
  --color-accent: #0891b2; /* Cyan 600 */
  --color-card-bg: #ffffff; /* White */
  --color-border: #e5e7eb; /* Gray 200 */
  --color-switch-bg: #38bdf8; /* Sky 400 */
  --color-switch-thumb: #facc15; /* Amber 400 */
}

html.dark {
  /* Variables for Dark Theme */
  --color-bg: #0f172a; /* Slate 900 */
  --color-text: #f8fafc; /* Slate 50 */
  --color-text-muted: #94a3b8; /* Slate 400 */
  --color-accent: #2dd4bf; /* Teal 400 */
  --color-card-bg: #1e293b; /* Slate 800 */
  --color-border: #334155; /* Slate 700 */
  --color-switch-bg: #1e3a8a; /* Indigo 800 - A deeper night blue */
  --color-switch-thumb: #d1d5db; /* Gray 300 - A brighter moon */
}

/* 3. Basic Body Rules */
body {
    font-family: 'Inter', sans-serif;
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: background-color 0.5s ease, color 0.5s ease;
}

/* 4. Custom Utility Classes */
.gradient-text {
    background-image: linear-gradient(to right, #2dd4bf, #38bdf8);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* 5. Adjustments for Article Content (Prose) */
.prose { color: var(--color-text-muted); }
.prose h1, .prose h2, .prose h3, .prose h4, .prose strong { color: var(--color-text); }
.prose blockquote { color: var(--color-text-muted); border-left-color: var(--color-border); }
.prose a { color: var(--color-accent); }
.prose a:hover { text-decoration: underline; }

/* ======================================================= */
/* 6. NEW ANIMATED THEME SWITCH STYLES                     */
/* ======================================================= */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
}
.theme-switch {
    display: inline-block;
    height: 34px;
    width: 60px;
    position: relative;
}
.theme-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--color-switch-bg);
    transition: .4s;
    border-radius: 34px;
    overflow: hidden; /* Hide parts of icons that go outside */
}
.slider:before {
    position: absolute;
    content: "";
    height: 26px;
    width: 26px;
    left: 4px;
    bottom: 4px;
    background-color: var(--color-switch-thumb);
    /* Bouncy transition for the thumb */
    transition: .4s cubic-bezier(0.68, -0.55, 0.27, 1.55);
    border-radius: 50%;
    z-index: 1; /* Ensure thumb is above the background but below icons if needed */
}
input:checked + .slider:before {
    transform: translateX(26px);
}

/* Sun and Moon Icons inside the switch */
.sun-icon, .moon-icon {
    position: absolute;
    width: 20px; /* Slightly larger icon */
    height: 20px;
    transition: all 0.4s ease-in-out;
}

/* Light Mode: Sun is visible, Moon is hidden below */
.sun-icon {
    top: 50%;
    left: 7px; /* Position inside the left part of the switch */
    transform: translateY(-50%);
    opacity: 1;
    color: white;
}
.moon-icon {
    top: 50%;
    left: 33px; /* Position inside the right part of the switch */
    transform: translateY(100%); /* Start below the slider */
    opacity: 0;
    color: white;
}

/* Dark Mode: Sun is hidden below, Moon is visible */
html.dark .sun-icon {
    transform: translateY(100%); /* Move down and out */
    opacity: 0;
}
html.dark .moon-icon {
    transform: translateY(-50%); /* Move up into place */
    opacity: 1;
}
