/* Modern Styles for AapnuPatan Connect */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4e54c8;
    --secondary-color: #8f94fb;
    --accent-color: #ff9966;
    --accent-gradient: linear-gradient(to right, #ff5e62, #ff9966);
    --primary-gradient: linear-gradient(135deg, #4e54c8, #8f94fb);
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: 1px solid rgba(255, 255, 255, 0.3);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --text-main: #2d3436;
    --text-muted: #636e72;
    --bg-body: #f0f2f5;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Outfit', sans-serif;
}

body {
    background: var(--bg-body);
    background-image:
        radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%),
        radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%),
        radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
    background-image: linear-gradient(120deg, #fdfbfb 0%, #ebedee 100%);
    color: var(--text-main);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-speed);
}

ul {
    list-style: none;
}

/* --- Layout Utilities --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* --- Navbar (Glassmorphism) --- */
.navbar {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 8px 20px;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
    height: 60px;
    /* Enforce a max height for consistency */
}

.navbar.scrolled {
    padding: 5px 20px;
    height: 50px;
    background: rgba(255, 255, 255, 0.95);
}

.logo {
    font-size: 1.4rem;
    font-weight: 700;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 0;
    /* Bootstrap override */
}

.nav-links li a {
    color: var(--text-main);
    font-weight: 500;
    font-size: 1rem;
    position: relative;
    padding: 5px 0;
}

.nav-links li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background: var(--primary-gradient);
    transition: width 0.3s;
}

.nav-links li a:hover::after {
    width: 100%;
}

.nav-links li a:hover {
    color: var(--primary-color);
}

/* Buttons in Nav */
.login-btn {
    border: 2px solid var(--primary-color);
    color: var(--primary-color) !important;
    padding: 5px 15px !important;
    font-size: 0.9rem;
    border-radius: 50px;
    transition: all 0.3s;
}

.login-btn:hover {
    background: var(--primary-color);
    color: white !important;
}

.cta-btn {
    background: var(--primary-gradient);
    color: white !important;
    padding: 5px 15px !important;
    font-size: 0.9rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(78, 84, 200, 0.3);
}

.cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(78, 84, 200, 0.4);
}

/* --- Hero Section --- */
.hero {
    min-height: 85vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 120px 20px 60px;
    background: linear-gradient(rgba(0, 0, 0, 0.5), rgba(0, 0, 0, 0.5)), url('https://images.unsplash.com/photo-1522202176988-66273c2fd55f?ixlib=rb-4.0.3&auto=format&fit=crop&w=1951&q=80');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: white;
}

.hero h1 {
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 20px;
    line-height: 1.2;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero p {
    font-size: 1.3rem;
    max-width: 700px;
    margin-bottom: 40px;
    opacity: 0.9;
}

.btn-group {
    display: flex;
    gap: 20px;
    justify-content: center;
}

/* Modern Buttons */
.btn {
    padding: 12px 30px;
    border-radius: 50px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
    display: inline-block;
}

.btn-primary {
    background: var(--primary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(78, 84, 200, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(78, 84, 200, 0.5);
    color: white;
}

.btn-outline {
    background: transparent;
    border: 2px solid white;
    color: white;
}

.btn-outline:hover {
    background: white;
    color: var(--primary-color);
}

/* --- Features / Cards --- */
.section-title {
    text-align: center;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 60px;
    color: var(--text-main);
    position: relative;
    padding-bottom: 15px;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 4px;
    background: var(--accent-gradient);
    border-radius: 2px;
}

.feature-grid,
.job-grid,
.scheme-grid,
.post-feed {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    padding: 0 20px;
    max-width: 1200px;
    margin: 0 auto;
}

.card-common {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-common::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: var(--primary-gradient);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.card-common:hover::before {
    transform: scaleX(1);
}

.card-common:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
}

.card-icon {
    font-size: 3rem;
    margin-bottom: 20px;
    background: var(--primary-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.card-common h3 {
    font-size: 1.5rem;
    margin-bottom: 15px;
    color: var(--text-main);
}

.card-common p {
    color: var(--text-muted);
    margin-bottom: 20px;
    flex-grow: 1;
}

/* Apply specific classes to new generic card */
.feature-card,
.job-card,
.scheme-card,
.post-card {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: var(--card-shadow);
    transition: all 0.3s ease;
    border: 1px solid rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

/* Reuse the hover and before effects */
.feature-card:hover,
.job-card:hover,
.scheme-card:hover,
.post-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
}

.feature-card .icon {
    font-size: 3rem;
    margin-bottom: 20px;
    display: inline-block;
}

.job-card h3,
.scheme-card h3,
.post-card h3 {
    color: var(--primary-color);
    font-size: 1.4rem;
    margin-bottom: 10px;
}

.apply-btn {
    align-self: flex-start;
    background: var(--accent-gradient);
    color: white;
    padding: 10px 25px;
    border-radius: 50px;
    font-weight: 500;
    margin-top: auto;
    box-shadow: 0 4px 15px rgba(255, 94, 98, 0.3);
}

.apply-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(255, 94, 98, 0.4);
}

/* --- Forms (Login, Post Job, Forum) --- */
.form-section {
    padding: 120px 20px 60px;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.form-card {
    background: rgba(255, 255, 255, 0.95);
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
}

.post-job-card,
.post-form {
    max-width: 800px;
    /* Wider for job posting */
    width: 100%;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    margin: 0 auto;
}

.form-group {
    margin-bottom: 25px;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.95rem;
}

.form-input,
.form-textarea,
.post-input,
.post-textarea {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid #eef1f5;
    background: #f8f9fa;
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s;
    color: var(--text-main);
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary-color);
    background: white;
    outline: none;
    box-shadow: 0 0 0 4px rgba(78, 84, 200, 0.1);
}

.form-textarea {
    resize: vertical;
    min-height: 120px;
}

.search-bar {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 50px;
    padding: 10px;
    background: white;
    border-radius: 50px;
    box-shadow: var(--card-shadow);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.search-input {
    border: none;
    flex-grow: 1;
    padding: 15px 25px;
    font-size: 1rem;
    border-radius: 50px;
    outline: none;
}

.search-btn {
    border-radius: 50px;
    padding: 12px 30px;
    background: var(--primary-gradient);
    color: white;
    font-weight: 600;
    border: none;
}

/* --- Footer --- */
footer {
    background: #2d3436;
    color: white;
    padding: 60px 20px;
    text-align: center;
    margin-top: 60px;
}

.footer-content p {
    opacity: 0.7;
    margin-bottom: 20px;
}

.footer-links a {
    color: white;
    margin: 0 15px;
    opacity: 0.8;
    position: relative;
    padding-bottom: 2px;
}

.footer-links a:hover {
    opacity: 1;
    color: var(--accent-color);
}

/* --- Mobile Responsiveness --- */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 2.5rem;
    }

    .navbar {
        padding: 8px 15px;
    }

}

/* Standard Mobile Menu Styles */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: var(--text-main);
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: absolute;
        top: 60px;
        /* Match navbar height */
        left: 0;
        width: 100%;
        background: rgba(255, 255, 255, 0.98);
        padding: 20px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
        backdrop-filter: blur(10px);
        gap: 15px;
        border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    }

    .nav-links.active {
        display: flex;
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links li a {
        display: block;
        padding: 10px;
        font-size: 1.1rem;
    }
}

/* --- Dark Mode --- */
body.dark-mode {
    background: #1a1a2e;
    color: #f1f1f1;
    background-image: radial-gradient(at 0% 0%, hsla(253, 16%, 7%, 1) 0, transparent 50%), radial-gradient(at 50% 0%, hsla(225, 39%, 30%, 1) 0, transparent 50%), radial-gradient(at 100% 0%, hsla(339, 49%, 30%, 1) 0, transparent 50%);
}

body.dark-mode .navbar {
    background: rgba(26, 26, 46, 0.9);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

body.dark-mode .nav-links li a {
    color: #f1f1f1;
}

body.dark-mode .card-common,
body.dark-mode .feature-card,
body.dark-mode .job-card,
body.dark-mode .scheme-card,
body.dark-mode .post-card,
body.dark-mode .post-job-card,
body.dark-mode .post-form,
body.dark-mode .form-card,
body.dark-mode .search-bar {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

body.dark-mode h1,
body.dark-mode h2,
body.dark-mode h3,
body.dark-mode .text-main,
body.dark-mode .section-title {
    color: #f1f1f1;
}

body.dark-mode p,
body.dark-mode .text-muted {
    color: #b0b0b0 !important;
    /* Force override bootstrap text-muted */
}

body.dark-mode .form-input,
body.dark-mode .form-textarea,
body.dark-mode .post-input,
body.dark-mode .post-textarea,
body.dark-mode .search-input {
    background: rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.1);
    color: #f1f1f1;
}

body.dark-mode .form-input:focus,
body.dark-mode .form-textarea:focus {
    border-color: var(--primary-color);
    background: rgba(0, 0, 0, 0.3);
}

body.dark-mode input::placeholder,
body.dark-mode textarea::placeholder {
    color: #777;
}

body.dark-mode .btn-outline {
    border-color: #f1f1f1;
    color: #f1f1f1;
}

body.dark-mode .btn-outline:hover {
    background: #f1f1f1;
    color: #333;
}