:root {
    --primary-color: #4a6cf7;
    --secondary-color: #8a74f9;
    --accent-color: #6cae75;
    --light-bg: #f8fafc;
    --dark-text: #1e293b;
    --light-text: #64748b;
    --white: #ffffff;
    --shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
    --card-bg: #ffffff;
    --header-bg: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    --section-bg: #f8fafc;
}

.dark-mode {
    --primary-color: #6d8bff;
    --secondary-color: #9d8aff;
    --light-bg: #0f172a;
    --dark-text: #e2e8f0;
    --light-text: #94a3b8;
    --card-bg: #1e293b;
    --header-bg: linear-gradient(120deg, #334155, #475569);
    --section-bg: #0f172a;
}

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

body {
    font-family: 'Montserrat', sans-serif;
    color: var(--dark-text);
    line-height: 1.6;
    background-color: var(--section-bg);
    min-height: 100vh;
    transition: var(--transition);
}

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

/* Header Styles */
header {
    background: var(--header-bg);
    color: var(--white);
    padding: 20px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

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

.logo {
    font-family: 'Playfair Display', serif;
    font-size: 28px;
    font-weight: 800;
    display: flex;
    align-items: center;
}

.logo span {
    color: #c4f0eb;
    margin-left: 5px;
}

.logo i {
    margin-right: 10px;
    font-size: 30px;
}

nav ul {
    display: flex;
    list-style: none;
}

nav ul li {
    margin-left: 30px;
    position: relative;
}

nav ul li a {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    padding: 5px 0;
}

nav ul li a:hover {
    color: #c4f0eb;
}

nav ul li a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 0;
    background-color: #c4f0eb;
    transition: var(--transition);
}

nav ul li a:hover::after {
    width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.theme-toggle {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    width: 50px;
    height: 26px;
    border-radius: 50px;
    position: relative;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 0 3px;
}

.theme-toggle span {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: white;
    position: absolute;
    transition: var(--transition);
    left: 3px;
}

.theme-toggle.dark span {
    left: calc(100% - 23px);
}

/* Hero Section */
.hero {
    padding: 100px 0 80px;
    text-align: center;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100" viewBox="0 0 100 100"><rect fill-opacity="0.05" fill="%234a6cf7" width="50" height="50"/><rect fill-opacity="0.05" fill="%234a6cf7" x="50" y="50" width="50" height="50"/></svg>');
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -50%;
    width: 100%;
    height: 200%;
    background: radial-gradient(circle, rgba(74, 108, 247, 0.1) 0%, transparent 70%);
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero h1 {
    font-family: 'Playfair Display', serif;
    font-size: 3.2rem;
    margin-bottom: 20px;
    color: var(--primary-color);
    line-height: 1.2;
}

.hero p {
    font-size: 1.2rem;
    max-width: 800px;
    margin: 0 auto 30px;
    color: var(--light-text);
}

.search-box {
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    box-shadow: var(--shadow);
    border-radius: 50px;
    overflow: hidden;
}

.search-box input {
    width: 100%;
    padding: 18px 25px;
    border: none;
    border-radius: 50px;
    font-size: 16px;
    background: var(--card-bg);
    color: var(--dark-text);
    transition: var(--transition);
}

.search-box input:focus {
    outline: none;
    box-shadow: 0 0 0 2px var(--primary-color);
}

.search-box button {
    position: absolute;
    right: 5px;
    top: 5px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 13px 25px;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
}

.search-box button:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
}

/* View Toggle */
.view-toggle {
    display: flex;
    justify-content: flex-end;
    margin: 30px 0;
    gap: 10px;
}

.view-btn {
    background: var(--card-bg);
    border: 1px solid var(--light-text);
    color: var(--light-text);
    padding: 8px 15px;
    border-radius: 8px;
    cursor: pointer;
    transition: var(--transition);
}

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

/* Filters Section */
.filters {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 15px;
    box-shadow: var(--shadow);
    margin: 40px auto;
    max-width: 1000px;
    transition: var(--transition);
}

.filter-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.filter-title {
    color: var(--primary-color);
    font-weight: 700;
    font-size: 1.2rem;
}

.clear-filters {
    color: var(--primary-color);
    background: none;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: var(--transition);
}

.clear-filters:hover {
    color: var(--secondary-color);
}

.filter-options {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 12px;
}

.filter-option {
    background: var(--light-bg);
    padding: 10px 20px;
    border-radius: 50px;
    cursor: pointer;
    transition: var(--transition);
    border: 1px solid transparent;
    color: var(--dark-text);
    font-weight: 500;
}

.filter-option:hover, .filter-option.active {
    background: var(--primary-color);
    color: var(--white);
    transform: translateY(-2px);
}

/* Psychologists Grid */
.psychologists-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin: 50px 0;
}

.psychologists-container.list-view {
    grid-template-columns: 1fr;
}

.psychologist-card {
    background-color: var(--card-bg);
    border-radius: 15px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

.psychologist-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(120deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 20px;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
}

.psychologist-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid rgba(255, 255, 255, 0.3);
}

.psychologist-info {
    flex: 1;
}

.psychologist-name {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    margin-bottom: 5px;
}

.rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-top: 5px;
}

.rating i {
    color: #ffc107;
    font-size: 14px;
}

.rating-count {
    font-size: 14px;
    opacity: 0.9;
}

.card-body {
    padding: 20px;
}

.price {
    font-weight: 700;
    color: var(--secondary-color);
    font-size: 20px;
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.price i {
    font-size: 16px;
}

.experience {
    background-color: rgba(104, 211, 145, 0.2);
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-size: 14px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.experience i {
    color: var(--accent-color);
}

.specialization {
    margin: 15px 0;
    font-size: 14px;
}

.specialization span {
    font-weight: 600;
    color: var(--primary-color);
}

.specialization-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.tag {
    background: var(--light-bg);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    color: var(--dark-text);
}

.address {
    color: var(--light-text);
    font-style: italic;
    margin: 15px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.address i {
    color: var(--secondary-color);
}

.card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 25px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: var(--secondary-color);
    transform: translateY(-3px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

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

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

.btn-favorite {
    background: transparent;
    color: var(--light-text);
    padding: 8px;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-favorite:hover {
    color: #e74c3c;
    background: rgba(231, 76, 60, 0.1);
}

.btn-favorite.active {
    color: #e74c3c;
}

/* Psychologist card in list view */
.psychologist-card.list-view {
    display: flex;
    flex-direction: row;
    padding: 0;
}

.psychologist-card.list-view .card-header {
    flex-direction: column;
    justify-content: center;
    min-width: 200px;
    text-align: center;
}

.psychologist-card.list-view .card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.psychologist-card.list-view .card-footer {
    margin-top: 0;
}

/* Footer */
footer {
    background: var(--header-bg);
    color: var(--white);
    padding: 50px 0 20px;
    margin-top: 80px;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 30px;
}

.footer-section h3 {
    font-family: 'Playfair Display', serif;
    font-size: 22px;
    margin-bottom: 20px;
}

.footer-section p, .footer-section a {
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 10px;
    display: block;
    text-decoration: none;
    transition: var(--transition);
}

.footer-section a:hover {
    color: var(--white);
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
}

.social-icons a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transition: var(--transition);
}

.social-icons a:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-3px);
}

.copyright {
    text-align: center;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* Mobile Navigation */
.mobile-menu-btn {
    display: none;
    font-size: 24px;
    background: none;
    border: none;
    color: var(--white);
    cursor: pointer;
}

/* Loading animation */
.loader {
    display: inline-block;
    width: 80px;
    height: 80px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
}

.loader:after {
    content: " ";
    display: block;
    width: 64px;
    height: 64px;
    margin: 8px;
    border-radius: 50%;
    border: 6px solid var(--primary-color);
    border-color: var(--primary-color) transparent var(--primary-color) transparent;
    animation: loader 1.2s linear infinite;
}

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

/* Back to top button */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    cursor: pointer;
    transition: var(--transition);
    opacity: 0;
    visibility: hidden;
    z-index: 999;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: var(--secondary-color);
    transform: translateY(-5px);
}

/* Responsive Styles */
@media (max-width: 992px) {
    .psychologist-card.list-view {
        flex-direction: column;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    nav ul {
        margin-top: 20px;
        flex-direction: column;
        gap: 15px;
    }
    
    nav ul li {
        margin: 0;
    }
    
    .hero h1 {
        font-size: 2rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .psychologists-container {
        grid-template-columns: 1fr;
    }
    
    .mobile-menu-btn {
        display: block;
        position: absolute;
        top: 20px;
        right: 20px;
    }
    
    nav {
        display: none;
        width: 100%;
    }
    
    nav.active {
        display: block;
    }
    
    .header-actions {
        margin-top: 15px;
    }
    
    .filter-options {
        justify-content: center;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.psychologist-card {
    animation: fadeIn 0.5s ease-out;
}