:root {
    --primary: #7B2CBF;
    --secondary: #FF9E80;
    --dark: #1A1A2E;
    --light: #F8F9FA;
    --gray: #6C757D;
    --light-purple: #E2C2FF;
    --light-orange: rgba(255, 158, 128, 0.15);
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: #E6E6FA;
    color: var(--dark);
    overflow-x: hidden;
}

/* Navbar */
.navbar {
    padding: 1rem 0;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.05);
    background-color: white !important;
}

.navbar-brand img {
    width: 150px;
    height: auto;
    transition: all 0.3s ease;
    object-fit: contain;
}

.navbar-brand img:hover {
    transform: scale(1.05);
}

.nav-link {
    font-weight: 500;
    color: var(--dark) !important;
    margin: 0 0.5rem;
    position: relative;
    padding: 0.5rem 0;
}

/* Updated Navbar Active State */
.nav-item .nav-link.active {
    color: var(--primary) !important;
    background-color: transparent !important;
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    border-radius: 3px;
}

.nav-link:hover {
    color: var(--primary) !important;
}

/* Remove Bootstrap's default active state */
.dropdown-item.active, .dropdown-item:active {
    background-color: transparent !important;
    color: var(--primary) !important;
}

.dropdown-menu {
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 0.5rem;
}

.dropdown-item {
    border-radius: 8px;
    padding: 0.5rem 1rem;
    margin: 0.15rem 0;
    font-weight: 400;
}

.dropdown-item:hover {
    background-color: var(--light-purple);
    color: var(--primary);
}

.dropdown-submenu .dropdown-menu {
    margin-left: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #9D4EDD);
    border: none;
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    box-shadow: 0 4px 15px rgba(123, 44, 191, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 44, 191, 0.4);
}

/* User Dropdown */
.user-dropdown {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    margin-right: 0.5rem;
    transition: all 0.3s ease;
}

.user-name {
    font-weight: 500;
    color: var(--dark);
    transition: all 0.3s ease;
}

.user-dropdown:hover .user-avatar {
    transform: scale(1.1);
}

.user-dropdown:hover .user-name {
    color: var(--primary);
}

.user-dropdown-menu {
    min-width: 200px;
    border: none;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
    border-radius: 12px;
    padding: 0.5rem;
    margin-top: 0.5rem;
}

.user-dropdown-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(0,0,0,0.05);
    margin-bottom: 0.25rem;
}

.user-dropdown-header .user-email {
    font-size: 0.8rem;
    color: var(--gray);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.user-dropdown-item i {
    width: 20px;
    text-align: center;
    color: var(--primary);
}

.user-dropdown-item:hover {
    background-color: var(--light-purple);
    color: var(--primary);
}

.user-dropdown-divider {
    margin: 0.5rem 0;
    border-top: 1px solid rgba(0,0,0,0.05);
}

/* Profile Section */
.profile-section {
    padding: 4rem 0;
}

.profile-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    border: 2px solid rgba(255, 255, 255, 0.9);
    transition: all 0.3s ease;
}

.profile-card:hover {
    border-color: white;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
}

.profile-header {
    background: linear-gradient(135deg, #6a1b9a, #7B2CBF, #FF9E80);
    padding: 2rem;
    text-align: center;
    color: white;
    position: relative;
}

.profile-pic-wrapper {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.profile-pic {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    border: 4px solid white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.upload-label {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 36px;
    height: 36px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
}

.upload-label:hover {
    background: var(--secondary);
    transform: scale(1.1);
}

.upload-input {
    display: none;
}

.profile-name {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.profile-bio {
    opacity: 0.9;
    max-width: 400px;
    margin: 0 auto;
}

.profile-body {
    padding: 2rem;
}

.profile-detail-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
}

.profile-detail-item:last-child {
    border-bottom: none;
}

.detail-label {
    font-weight: 600;
    color: var(--gray);
}

.detail-value {
    font-weight: 500;
    color: var(--dark);
}

.profile-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    margin: 2rem 0;
}

.stat-card {
    background: rgba(123, 44, 191, 0.05);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(123, 44, 191, 0.1);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 1.5rem;
}

.stories-stat .stat-icon {
    background: rgba(123, 44, 191, 0.15);
    color: var(--primary);
}

.poems-stat .stat-icon {
    background: rgba(255, 158, 128, 0.15);
    color: var(--secondary);
}

.purchases-stat .stat-icon {
    background: rgba(25, 135, 84, 0.15);
    color: #198754;
}

.stat-number {
    font-size: 1.75rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.9rem;
    color: var(--gray);
}

.profile-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 2rem;
}

.action-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.edit-btn {
    background: linear-gradient(135deg, var(--primary), #9D4EDD);
    color: white;
}

.edit-btn:hover {
    background: linear-gradient(135deg, #9D4EDD, #FFBEA6);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(123, 44, 191, 0.3);
    color: white;
}

.password-btn {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
}

.password-btn:hover {
    background: rgba(220, 53, 69, 0.2);
    color: #dc3545;
}

.save-btn {
    background: rgba(25, 135, 84, 0.1);
    color: #198754;
}

.save-btn:hover {
    background: rgba(25, 135, 84, 0.2);
    color: #198754;
}

/* Modal Styles */
.modal-content {
    border-radius: 16px;
    border: none;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.modal-header {
    background: linear-gradient(135deg, #6a1b9a, #7B2CBF);
    color: white;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    border-bottom: none;
}

.modal-title {
    font-weight: 600;
}

.btn-close {
    filter: invert(1);
}

.modal-footer {
    border-top: 1px solid rgba(0, 0, 0, 0.08);
}

/* Footer */
.footer {
    background-color: var(--dark);
    color: white;
    padding: 4rem 0 2rem;
}

.footer-brand {
    font-weight: 700;
    font-size: 1.5rem;
    margin-bottom: 1rem;
    display: inline-block;
}

.footer-brand span:first-child {
    color: var(--primary);
}

.footer-brand span:last-child {
    color: var(--secondary);
}

.footer-text {
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 1.5rem;
}

.social-icons {
    display: flex;
    gap: 1rem;
}

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

.social-icons a:hover {
    background: var(--primary);
    transform: translateY(-3px);
}

.footer-title {
    font-weight: 600;
    margin-bottom: 1.5rem;
    position: relative;
    padding-bottom: 0.75rem;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 2px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
}

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

.footer-links li {
    margin-bottom: 0.75rem;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.footer-links a:hover {
    color: white;
    transform: translateX(5px);
}

.copyright {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
    margin-top: 3rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

.copyright a {
    color: var(--secondary);
    text-decoration: none;
}

.brand-name {
    font-weight: 700;
}
.brand-name span:first-child {
    color: var(--primary);
}
.brand-name span:last-child {
    color: var(--secondary);
}

.gradient-text {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    font-weight: 600;
    text-decoration: none;
    position: relative;
    display: inline-block;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .profile-stats {
        grid-template-columns: 1fr;
    }
    
    .profile-actions {
        flex-direction: column;
    }
    
    .action-btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .footer {
        text-align: center;
    }
    
    .footer-title::after {
        left: 50%;
        transform: translateX(-50%);
    }
    
    .social-icons {
        justify-content: center;
    }
}