/*
========================================
THEME & COLOR VARIABLES
========================================
*/
:root {
    --primary-color: #007bff;
    --primary-hover: #0056b3;
    --secondary-color: #28a745;
    --secondary-hover: #218838;

    /* Light Theme Variables */
    --bg-color: #f4f7f6;
    --text-color: #333;
    --card-bg: #ffffff;
    --border-color: #ddd;
    --header-bg: #ffffff;
    --footer-bg: #2c3e50;
    --footer-text: #ecf0f1;
}

body.dark-mode {
    /* Dark Theme Variables */
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --card-bg: #1e1e1e;
    --border-color: #444;
    --header-bg: #1e1e1e;
    --footer-bg: #1e1e1e;
    --footer-text: #e0e0e0;
}

/*
========================================
GENERAL STYLING
========================================
*/
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.6;
    transition: background-color 0.3s, color 0.3s;
}

h1,
h2,
h3 {
    line-height: 1.2;
}

a {
    color: var(--primary-color);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

main {
    max-width: 1100px;
    margin: 0 auto;
    padding: 1rem;
}

section {
    margin-bottom: 3rem;
}

.button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    text-decoration: none;
    font-weight: bold;
    transition: background-color 0.3s, transform 0.2s;
}

.button:hover {
    text-decoration: none;
    transform: translateY(-2px);
}

/*
========================================
HEADER, NAVIGATION & SEARCH
========================================
*/
header {
    background-color: var(--header-bg);
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.header-container {
    max-width: 1100px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 a {
    color: var(--text-color);
    text-decoration: none;
    font-size: 1.5rem;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

nav {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    /* ADD THIS LINE */
}

.nav-button {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);

}

.nav-button-primary {
    background-color: var(--primary-color);
    color: white;
    border: 1px solid var(--primary-color);
}

.nav-button:hover {
    background-color: #e9f4ff;
}

.nav-button-primary:hover {
    background-color: var(--primary-hover);
}

/* --- Search Bar Styling --- */
.search-bar {
    display: flex;
    align-items: center;
    background-color: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 25px;
    padding: 0 5px 0 15px;
    transition: all 0.3s ease;
}

.search-bar:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

.search-bar input {
    border: none;
    outline: none;
    background: transparent;
    color: var(--text-color);
    width: 200px;
    height: 38px;
    font-size: 0.9rem;
}

.search-bar input::placeholder {
    color: var(--text-color);
    opacity: 0.6;
}

.search-bar button {
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
}

.search-bar button:hover {
    background-color: var(--primary-hover);
}

/* --- Theme Switch Styling --- */
.theme-switch-wrapper {
    display: flex;
    align-items: center;
    margin-right: 1rem;
}

.theme-switch {
    display: inline-block;
    height: 34px;
    position: relative;
    width: 60px;
}

.theme-switch input {
    display: none;
}

.slider {
    background-color: #ccc;
    bottom: 0;
    cursor: pointer;
    left: 0;
    position: absolute;
    right: 0;
    top: 0;
    transition: .4s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 5px;
}

.slider.round {
    border-radius: 34px;
}

.slider.round:before {
    border-radius: 50%;
    background-color: white;
    bottom: 4px;
    content: "";
    height: 26px;
    left: 4px;
    position: absolute;
    transition: .4s;
    width: 26px;
}

input:checked+.slider {
    background-color: var(--primary-color);
}

input:checked+.slider:before {
    transform: translateX(26px);
}

.slider i {
    color: #f0c420;
    transition: opacity 0.4s;
}

.slider .fa-moon {
    opacity: 0;
}

.slider .fa-sun {
    opacity: 1;
}

input:checked+.slider .fa-moon {
    opacity: 1;
}

input:checked+.slider .fa-sun {
    opacity: 0;
}

/*
========================================
PAGE SECTIONS
========================================
*/

/* --- Hero Section --- */
.hero {
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1510915228340-29c85a43dcfe?q=80&w=2070&auto=format&fit=crop') no-repeat center center/cover;
    color: white;
    text-align: center;
    padding: 6rem 1rem;
    border-radius: 8px;
    margin: 1rem;
}

.hero-content h2 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.hero-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
}

.hero-button {
    background-color: var(--secondary-color);
    color: white;
    font-size: 1.1rem;
}

.hero-button:hover {
    background-color: var(--secondary-hover);
}


/* --- Featured Resources & Cards --- */
.featured-resources h2,
.forum-list h2 {
    text-align: center;
    margin-bottom: 2rem;
    font-size: 2rem;
}

.resource-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.card {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s, box-shadow 0.3s, background-color 0.3s, border-color 0.3s;
}

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

.card-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.card h3 {
    margin-bottom: 0.5rem;
}

.card a {
    font-weight: bold;
    margin-top: 1rem;
    display: inline-block;
}

/* --- Forum Category Styling --- */
.category {
    background-color: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    /* The new blur outline/glow */
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    /* Updated transition for all effects */
    transition:
        border-left 0.3s,
        background-color 0.3s,
        border-color 0.3s,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.category:hover {
    border-left: 5px solid var(--primary-color);
    /* The new scaling animation */
    transform: scale(1.02);
    /* A more intense glow on hover */
    box-shadow: 0 8px 30px rgba(0, 123, 255, 0.15);
}

.category h3 a {
    color: var(--text-color);
    text-decoration: none;
}

.category p {
    color: #666;
}

body.dark-mode .category {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    /* A subtle dark shadow */
}

body.dark-mode .category:hover {
    box-shadow: 0 8px 30px rgba(0, 123, 255, 0.25);
    /* A blue glow for dark mode */
}

body.dark-mode .category p {
    color: #aaa;
}


/*
========================================
FOOTER
========================================
*/
footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    padding-top: 3rem;
    margin-top: 3rem;
    transition: background-color 0.3s, color 0.3s;
}

.footer-container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-container h4 {
    color: white;
    margin-bottom: 1rem;
    border-bottom: 1px solid #777;
    padding-bottom: 0.5rem;
}

body.dark-mode .footer-container h4 {
    color: var(--text-color);
}


.footer-links ul {
    list-style: none;
    padding: 0;
}

.footer-links ul li a {
    color: var(--footer-text);
    margin-bottom: 0.5rem;
    display: block;
}

.footer-links ul li a:hover {
    color: var(--primary-color);
    text-decoration: none;
}

.footer-social a {
    color: var(--footer-text);
    font-size: 1.5rem;
    margin-right: 1rem;
}

.footer-social a:hover {
    color: var(--primary-color);
}

.footer-bottom {
    text-align: center;
    margin-top: 2rem;
    padding: 1rem;
    border-top: 1px solid #777;
}

/*
========================================
ANIMATIONS
========================================
*/
.hidden {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.visible {
    opacity: 1;
    transform: translateY(0);
}

/*
========================================
REGISTER & LOGIN PAGE STYLES
========================================
*/

/* --- Styles for Register Page --- */
.register-page {
    /* Animated Gradient Background */
    background: linear-gradient(-45deg, #0f2027, #203a43, #2c5364, #007bff);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
}

@keyframes gradientBG {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.register-container {
    display: flex;
    width: 900px;
    height: 600px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.2);
    overflow: hidden;
}

.form-panel {
    flex: 1;
    padding: 3rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.form-header {
    text-align: center;
    margin-bottom: 2rem;
    animation: fadeIn 1s ease-in-out;
}

.form-header h1 {
    font-size: 2.2rem;
    color: #333;
}

.form-content .form-group {
    position: relative;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    border-bottom: 2px solid #ccc;
    transition: border-bottom-color 0.3s;
    animation: fadeIn 1s ease-in-out forwards;
    opacity: 0;
}

.form-content .form-group:nth-child(1) {
    animation-delay: 0.2s;
}

.form-content .form-group:nth-child(2) {
    animation-delay: 0.4s;
}

.form-content .form-group:nth-child(3) {
    animation-delay: 0.6s;
}

.form-content .form-group:focus-within {
    border-bottom-color: var(--primary-color);
}

.form-content .form-group label {
    color: #999;
    margin-right: 10px;
    font-size: 1.1rem;
}

.form-content .form-group input {
    border: none;
    outline: none;
    background: none;
    width: 100%;
    padding: 0.5rem 0;
    font-size: 1rem;
}

.form-content .form-group input::placeholder {
    color: #aaa;
}

.form-button {
    width: 100%;
    padding: 0.8rem;
    background-color: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    border: none;
    margin-top: 1rem;
    cursor: pointer;
    animation: fadeIn 1s ease-in-out 0.8s forwards;
    opacity: 0;
}

.form-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

.form-footer {
    text-align: center;
    margin-top: 1.5rem;
    animation: fadeIn 1s ease-in-out 1s forwards;
    opacity: 0;
}

.form-footer a {
    font-weight: bold;
}

.info-panel {
    flex: 1;
    background: #2d3748;
    /* This is the dark gray we changed */
    color: white;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
    text-align: center;
    animation: slideIn 1s ease-in-out;
}

.info-content h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.info-content p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
}

.info-content ul {
    list-style: none;
    padding: 0;
    text-align: left;
    display: inline-block;
    margin-bottom: 2rem;
}

.info-content ul li {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.info-content ul li i {
    margin-right: 10px;
    color: var(--secondary-color);
}

.info-button {
    background-color: white;
    color: var(--primary-color);
    border: 1px solid white;
}

.info-button:hover {
    background-color: transparent;
    color: white;
}


/* --- Styles for Login Page --- */
.login-page {
    background-color: #111827;
    margin: 0;
    padding: 0;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

#particles-js {
    position: absolute;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.login-card {
    background: rgba(31, 41, 55, 0.5);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    padding: 2.5rem 3rem;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
    z-index: 1;
    animation: fadeInScale 0.8s ease-out forwards;
}

.login-header {
    text-align: center;
    color: #fff;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.login-header h2 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #ccc;
}

.login-form .input-group {
    position: relative;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    background: rgba(17, 24, 39, 0.5);
    border-radius: 10px;
    transition: box-shadow 0.3s;
}

.login-form .input-group:focus-within {
    box-shadow: 0 0 0 2px var(--primary-color);
}

.login-form .input-group i {
    color: #9ca3af;
    padding: 0 1rem;
}

.login-form .input-group input {
    width: 100%;
    border: none;
    outline: none;
    background: none;
    padding: 1rem 1rem 1rem 0;
    font-size: 1rem;
    color: #fff;
}

.login-form .input-group input::placeholder {
    color: #9ca3af;
}

.forgot-password {
    display: block;
    text-align: right;
    margin-bottom: 1.5rem;
    color: #9ca3af;
    font-size: 0.9rem;
}

.login-button {
    width: 100%;
    padding: 1rem;
    background: var(--primary-color);
    color: white;
    font-size: 1.1rem;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.2s;
}

.login-button:hover {
    background-color: var(--primary-hover);
    transform: translateY(-3px);
}

.login-footer {
    text-align: center;
    margin-top: 2rem;
    color: #9ca3af;
}

.login-footer a {
    color: var(--primary-color);
    font-weight: bold;
}


/* --- Keyframe Animations for Register/Login Pages --- */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* --- Styles for Animated "View more/less" --- */
.hidden-category {
    /* Collapsed state */
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    padding-top: 0;
    padding-bottom: 0;
    margin-bottom: 0;
    border-width: 0;
    transition: all 0.6s ease-in-out;
}

.hidden-category.is-visible {
    /* Expanded state */
    max-height: 500px;
    /* A value larger than the content will ever be */
    opacity: 1;
    border-width: 1px;
    /* Re-apply original spacing */
    padding-top: 1.5rem;
    padding-bottom: 1.5rem;
    margin-bottom: 1rem;
}

.view-more-container {
    text-align: center;
    margin-top: 1.5rem;
}

#viewMoreBtn {
    background-color: var(--primary-color);
    color: white;
    padding: 0.8rem 2.5rem;
    transition: background-color 0.3s, transform 0.2s ease;
}

#viewMoreBtn:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
}

#viewMoreBtn:active {
    /* Cool press-down animation */
    transform: translateY(0px) scale(0.98);
}