@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --background: #F9FAFB;
    --surface: #FFFFFF;
    --text-main: #111827;
    --text-muted: #6B7280;
    --border: #E5E7EB;
    --radius: 12px;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Outfit', sans-serif;
    background-color: var(--background);
    color: var(--text-main);
    line-height: 1.5;
}

a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    font-size: 1rem;
}

.btn-primary {
    background-color: var(--primary);
    color: white;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: white;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Layout */
.navbar {
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    height: 4.5rem;
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.nav-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: -0.5px;
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-link {
    font-weight: 500;
    color: var(--text-muted);
}

.nav-link:hover,
.nav-link.active {
    color: var(--primary);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-left: 1rem;
    padding-left: 1rem;
    border-left: 1px solid var(--border);
}

/* Cards */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: 1.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    transition: transform 0.2s, box-shadow 0.2s;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

/* Forms */
.form-group {
    margin-bottom: 1rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-main);
}

.form-control,
.form-select {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background-color: var(--surface);
    color: var(--text-main);
}

.form-select {
    padding-right: 2.5rem;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236B7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    cursor: pointer;
}

textarea.form-control {
    min-height: 100px;
    resize: vertical;
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
    background-color: white;
}

.form-control:hover,
.form-select:hover {
    border-color: #D1D5DB;
}

.form-control:disabled,
.form-select:disabled {
    background-color: #F3F4F6;
    cursor: not-allowed;
    opacity: 0.7;
}

/* Chrome, Safari, Edge, Opera - Remove autocomplete/datalist default arrow if needed */
.form-control::-webkit-calendar-picker-indicator {
    opacity: 0.4;
    cursor: pointer;
    transition: opacity 0.2s;
    padding: 5px;
}

.form-control::-webkit-calendar-picker-indicator:hover {
    opacity: 1;
}

/* Input Groups refinement */
.input-group {
    display: flex;
    position: relative;
    width: 100%;
    align-items: stretch;
}

.input-group>.form-control,
.input-group>.form-select {
    position: relative;
    flex: 1 1 auto;
    width: 1%;
    min-width: 0;
}

.input-group> :not(:last-child).form-control,
.input-group> :not(:last-child).form-select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right-color: transparent;
}

.input-group> :not(:first-child).form-control,
.input-group> :not(:first-child).form-select {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.input-group>.form-control:focus,
.input-group>.form-select:focus {
    z-index: 3;
}

.input-group .btn {
    z-index: 2;
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.search-category-select {
    flex: 0 0 160px !important;
    border-right: none !important;
}

/* Adjust search box input group for hero */
.search-box .input-group {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
}

@media (min-width: 768px) {
    .search-box .input-group {
        border-radius: 100px;
    }

    .search-category-select {
        flex: 0 0 200px !important;
        padding-left: 1.5rem;
    }
}

.profile-img-container {
    position: relative;
    display: inline-block;
}

.ratio-4x3 {
    aspect-ratio: 4/3;
    overflow: hidden;
}

.ratio-4x3 img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Utilities */
.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1rem;
}

.mb-4 {
    margin-bottom: 1rem;
}

.grid {
    display: grid;
    gap: 1.5rem;
}

.grid-cols-3 {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

/* Hero */
.hero {
    background: linear-gradient(135deg, #4F46E5 0%, #7C3AED 100%);
    color: white;
    padding: 4rem 1.5rem;
    text-align: center;
    border-radius: 0 0 1.5rem 1.5rem;
    margin-bottom: 2rem;
}

.hero h1 {
    font-size: 2.25rem;
    font-weight: 800;
    margin-bottom: 1rem;
    letter-spacing: -1px;
    line-height: 1.1;
}

.hero p {
    font-size: 1.1rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto 2rem;
}

/* Hero Search Overrides */
.search-box .input-group .form-control,
.search-box .input-group .form-select {
    border: none !important;
    background-color: transparent !important;
    box-shadow: none !important;
}

.search-box .input-group .form-control:focus,
.search-box .input-group .form-select:focus {
    background-color: white !important;
}

.mobile-toggle {
    display: block;
    background: none;
    border: none;
    font-size: 1.5rem;
    color: var(--text-main);
    cursor: pointer;
    padding: 0.5rem;
}

/* Desktop override for Hero & Search */
@media (min-width: 768px) {
    .hero {
        padding: 6rem 2rem;
        border-radius: 0 0 2rem 2rem;
        margin-bottom: 3rem;
    }

    .hero h1 {
        font-size: 3.5rem;
    }

    .hero p {
        font-size: 1.25rem;
        margin-bottom: 2.5rem;
    }

    .search-box {
        background: white;
        padding: 0.5rem;
        border-radius: 100px;
        box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    }

    .search-box .btn {
        padding: 0 2.5rem;
        border-radius: 100px;
    }

    .mobile-toggle {
        display: none;
    }

    .nav-links {
        display: flex !important;
        flex-direction: row;
        position: static;
        background: transparent;
        padding: 0;
        border: none;
        box-shadow: none;
    }

    .user-menu {
        border-left: 1px solid var(--border);
        border-top: none;
        padding-top: 0;
        padding-left: 1rem;
        margin-left: 1rem;
        margin-top: 0;
        flex-direction: row;
        align-items: center;
        width: auto;
    }

    .grid-cols-3 {
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}

/* Mobile Menu */
@media (max-width: 768px) {
    .nav-content {
        height: 100%;
        width: 100%;
    }

    .nav-links {
        display: none;
        flex-direction: column;
        position: fixed;
        top: 4.5rem;
        left: 0;
        right: 0;
        bottom: 0;
        background: var(--surface);
        padding: 1.5rem;
        gap: 0.5rem;
        z-index: 1000;
        overflow-y: auto;
        animation: slideDown 0.3s ease-out;
        box-shadow: none;
        border-top: 1px solid var(--border);
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateY(-10px);
        }

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

    .nav-links.show {
        display: flex;
    }

    .nav-link {
        padding: 0.875rem 1rem;
        width: 100%;
        display: flex;
        align-items: center;
        border-radius: var(--radius);
        transition: background-color 0.2s;
    }

    .nav-link:hover,
    .nav-link.active {
        background-color: #F3F4F6;
    }

    .user-menu {
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        border: none;
        margin-left: 0;
        padding-left: 0;
    }

    .user-menu-btn {
        padding: 0.875rem 1rem !important;
        border-radius: var(--radius) !important;
    }

    .grid-cols-3 {
        grid-template-columns: 1fr;
    }

    .modal-dialog {
        margin: 0.5rem;
    }

    .display-5 {
        font-size: 2.25rem !important;
    }

    .display-6 {
        font-size: 1.75rem !important;
    }
}

/* Tables and Lists */
@media (max-width: 768px) {
    .table-responsive {
        border: 0;
    }

    .card-body {
        padding: 1.25rem;
    }
}

.portfolio-item-card {
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.portfolio-item-card:hover {
    transform: scale(1.03);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1) !important;
}

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox-content {
    max-width: 100%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-height: 80vh;
}