/* ===============================
   CSS Reset and Box Sizing
   =============================== */
   *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ===============================
   Custom Properties (Variables) - Dark Theme (Default)
   =============================== */
:root {
    /* Dark Theme Colors */
    --primary-color: #2b6cb0;         /* Blue */
    --secondary-color: #1a4971;       /* Darker Blue */
    --text-color: #f0f0f0;            /* Off-White */
    --background-color: #111827;      /* Dark Blue-Black */
    --card-background: #1f2937;       /* Slightly Lighter Blue-Black */
    --border-color: #374151;          /* Dark Blue-Gray */
    --hover-color: #10b981;           /* Green */

    /* Effects */
    --shadow-color: rgba(0, 0, 0, 0.25);
    --modal-overlay: rgba(0, 0, 0, 0.8);

    /* Transitions */
    --transition-fast: 0.3s ease;
    --transition-medium: 0.5s ease-out;
}

/* ===============================
   Custom Properties (Variables) - Light Theme
   =============================== */
:root.light-theme {
    /* Light Theme Colors */
    --primary-color: #007bff;         /* Lighter Blue */
    --secondary-color: #0056b3;       /* Darker Light Blue */
    --text-color: #333;               /* Dark Gray for Text */
    --background-color: #f8f9fa;      /* Light Gray Background */
    --card-background: #ffffff;       /* White Cards */
    --border-color: #ced4da;          /* Light Gray Border */
    --hover-color: #28a745;           /* Light Green */
    --shadow-color: rgba(0, 0, 0, 0.1); /* Lighter Shadow */
}


/* ===============================
   Base Styles
   =============================== */
body {
    font-family: 'Roboto', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--background-color), #1f2937); /* Default dark background */
    color: var(--text-color); /* Default dark text color */
    line-height: 1.6;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

/* Light theme body background override */
body.light-theme {
    background: linear-gradient(135deg, var(--background-color), #ffffff); /* Light background */
}


.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

/* ===============================
   Typography
   =============================== */
a {
    color: var(--hover-color);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 1rem;
    font-weight: 700;
    line-height: 1.2;
}

h1 {
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 3px;
    text-align: center;
    position: relative;
    display: inline-block;
    text-shadow: 2px 2px 4px var(--shadow-color);
}

h1::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    width: 50%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-color), var(--hover-color));
    transform: translateX(-50%);
}

/* ===============================
   Header Section
   =============================== */
header {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    height: 100%;
    padding: 20px;
}

header h1 {
    margin: 0;
    font-size: 2rem;
}

header p {
    margin: 5px 0;
    font-size: 1rem;
}

#modeToggle {
    margin-top: 10px;
    padding: 10px 20px;
}
/* ======================== Form Elements ======================== */
/* Text input field styles */
input[type="text"] {
    width: 100%;
    max-width: 600px;
    padding: 0.75rem;
    font-size: 1rem;
    border: 2px solid var(--border-color);
    background-color: var(--card-background);
    color: var(--text-color);
    border-radius: 0.5rem;
    transition: all var(--transition-fast); /* Smooth transition effect */
}

/* Focused input field styling */
input[type="text"]:focus {
    outline: none;
    border-color: var(--primary-color); /* Highlight border on focus */
    box-shadow: 0 0 0 3px rgba(43, 108, 176, 0.3); /* Subtle glow effect */
}

/* ========================== Buttons ========================== */
/* Category buttons container */
.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

/* Individual category button styling */
.category-button {
    background-color: var(--primary-color);
    color: #ffffff;
    border: none;
    padding: 0.75rem 1.25rem;
    border-radius: 0.5rem;
    cursor: pointer;
    font-weight: 600;
    transition: all var(--transition-fast); /* Smooth transition effect */
}

/* Hover effect for category buttons */
.category-button:hover {
    background-color: var(--secondary-color); /* Change background color */
    transform: translateY(-2px); /* Slight upward shift */
    box-shadow: 0 4px 6px var(--shadow-color); /* Drop shadow on hover */
}

/* Active state for category button */
.active-button {
    background-color: var(--secondary-color); /* Different background color */
    transform: translateY(-2px); /* Maintain hover effect */
}

/* =========================== Cards =========================== */
/* Tool card styling */
.tool-card {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all var(--transition-fast); /* Smooth transition effect */
    position: relative;
    animation: fadeIn var(--transition-medium); /* Fade-in effect */
    border: 1px solid var(--border-color);
}

/* Hover effect for tool cards */
.tool-card:hover {
    transform: translateY(-5px); /* Slight upward shift */
    box-shadow: 0 10px 20px var(--shadow-color); /* Larger shadow on hover */
    border-color: var(--hover-color); /* Change border color on hover */
}

/* Tool card name styling */
.tool-name {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

/* Tool card company name styling */
.tool-company {
    font-size: 0.9rem;
    color: #9ca3af; /* Light grey color */
    margin-bottom: 0.5rem;
}

/* Tool card category name styling */
.tool-category {
    font-size: 0.9rem;
    color: var(--hover-color); /* Highlighted category color */
    font-weight: bold;
}

/* =========================== Timeline ========================= */
/* Timeline container styling */
.timeline {
    background-color: var(--card-background);
    border-radius: 0.75rem;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px var(--shadow-color); /* Shadow for depth */
}

/* Individual timeline event styling */
.timeline-event {
    position: relative;
    padding-left: 30px;
    margin-bottom: 1.5rem;
}

/* Timeline event marker styling (circle before the event) */
.timeline-event::before {
    content: '';
    position: absolute;
    left: 0;
    top: 5px;
    width: 12px;
    height: 12px;
    background-color: var(--hover-color); /* Event marker color */
    border-radius: 50%; /* Circular shape */
    box-shadow: 0 0 0 4px rgba(16, 185, 129, 0.3); /* Soft shadow around marker */
}

/* Navigation */
.nav-menu {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.nav-list {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-item a {
    color: var(--text-color);
    font-weight: 500;
    transition: color var(--transition-fast);
}

.nav-item a:hover {
    color: var(--hover-color);
}

/* Grid Layout */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Search and Filters */
.search-filter {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.search-filter input {
    width: 100%;
    max-width: 600px;
}

/* Modal Component */
.modal {
    display: none;
    position: fixed;
    inset: 0;
    background-color: var(--modal-overlay);
    z-index: 1000;
}

.modal-content {
    background-color: var(--card-background);
    margin: 15% auto;
    padding: 2rem;
    border-radius: 0.75rem;
    width: 90%;
    max-width: 600px;
    position: relative;
    border: 1px solid var(--border-color);
}

.close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 1.5rem;
    color: var(--primary-color);
    cursor: pointer;
    transition: color var(--transition-fast);
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
    background-color: var(--card-background);
    border-top: 1px solid var(--border-color);
}


.theme-toggle {
    background: none;
    border: 2px solid var(--border-color);
    color: var(--text-color);
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all var(--transition-fast);
}

.theme-toggle:hover {
    border-color: var(--hover-color);
    color: var(--hover-color);
}

.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background-color: var(--primary-color);
    color: white;
    width: 3rem;
    height: 3rem;
    border-radius: 50%;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease-in-out;
    box-shadow: 0 4px 10px var(--shadow-color);
    z-index: 999;
}

.back-to-top:hover {
    background-color: var(--hover-color);
    transform: translateY(-3px);
    box-shadow: 0 6px 15px var(--shadow-color);
}

/* State Components */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 200px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--card-background);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.error-message {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid #ef4444;
    color: #ef4444;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    text-align: center;
}

.success-message {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--hover-color);
    color: var(--hover-color);
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
    text-align: center;
}

/* Tooltips */
.tooltip {
    position: relative;
    display: inline-block;
}

.tooltip .tooltip-text {
    visibility: hidden;
    background-color: var(--card-background);
    color: var(--text-color);
    text-align: center;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid var(--border-color);
    position: absolute;
    z-index: 1;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    white-space: nowrap;
    opacity: 0;
    transition: opacity var(--transition-fast);
}

.tooltip:hover .tooltip-text {
    visibility: visible;
    opacity: 1;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.visible {
    display: block !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

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

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

/* Focus Styles */
*:focus-visible {
    outline: 2px solid var(--hover-color);
    outline-offset: 2px;
}

/* Media Queries */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    h1 {
        font-size: 2rem;
    }

    .tools-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
        gap: 1rem;
    }

    .tool-card {
        padding: 1.25rem;
    }

    .back-to-top {
        bottom: 1rem;
        right: 1rem;
        width: 2.5rem;
        height: 2.5rem;
        font-size: 1.25rem;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }
}
