/* Profile Page Styles */

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --text-color: #1a202c;
    --text-light: #5a6270;
    --border-color: #e5e7eb;
    --bg-light: #f8f9fc;
}

.profile-main {
    min-height: calc(100vh - 80px);
    background: var(--bg-light);
    padding-bottom: 60px;
}

/* User Menu in Navigation */
.user-menu {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-left: 20px;
}

.user-avatar {
    position: relative;
    width: 45px;
    height: 45px;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--primary-color);
}

.online-indicator {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--success-color);
    border: 2px solid white;
    border-radius: 50%;
}

.user-dropdown {
    position: relative;
}

.dropdown-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    background: none;
    border: none;
    color: var(--text-color);
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.dropdown-toggle:hover {
    background: var(--bg-light);
}

.dropdown-toggle i {
    font-size: 0.8rem;
    transition: transform 0.3s ease;
}

.dropdown-toggle.active i {
    transform: rotate(180deg);
}

.dropdown-menu {
    position: absolute;
    top: calc(100% + 10px);
    right: 0;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    min-width: 220px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 1000;
}

.dropdown-menu.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 20px;
    color: var(--text-color);
    text-decoration: none;
    transition: all 0.3s ease;
}

.dropdown-menu a:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-menu a:last-child {
    border-radius: 0 0 12px 12px;
}

.dropdown-menu a:hover {
    background: var(--bg-light);
    color: var(--primary-color);
}

.dropdown-menu a i {
    width: 20px;
    text-align: center;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 8px 0;
}

.logout-link {
    color: var(--danger-color) !important;
}

.logout-link:hover {
    background: #fee2e2 !important;
}

/* Profile Header */
.profile-header {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    margin-top: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.profile-cover {
    height: 200px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
}

.cover-gradient {
    position: absolute;
    inset: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1200 120"><path d="M0,0V46.29c47.79,22.2,103.59,32.17,158,28,70.36-5.37,136.33-33.31,206.8-37.5C438.64,32.43,512.34,53.67,583,72.05c69.27,18,138.3,24.88,209.4,13.08,36.15-6,69.85-17.84,104.45-29.34C989.49,25,1113-14.29,1200,52.47V0Z" opacity=".25"/><path d="M0,0V15.81C13,36.92,27.64,56.86,47.69,72.05,99.41,111.27,165,111,224.58,91.58c31.15-10.15,60.09-26.07,89.67-39.8,40.92-19,84.73-46,130.83-49.67,36.26-2.85,70.9,9.42,98.6,31.56,31.77,25.39,62.32,62,103.63,73,40.44,10.79,81.35-6.69,119.13-24.28s75.16-39,116.92-43.05c59.73-5.85,113.28,22.88,168.9,38.84,30.2,8.66,59,6.17,87.09-7.5,22.43-10.89,48-26.93,60.65-49.24V0Z" opacity=".5"/><path d="M0,0V5.63C149.93,59,314.09,71.32,475.83,42.57c43-7.64,84.23-20.12,127.61-26.46,59-8.63,112.48,12.24,165.56,35.4C827.93,77.22,886,95.24,951.2,90c86.53-7,172.46-45.71,248.8-84.81V0Z"/></svg>') no-repeat bottom;
    background-size: cover;
    opacity: 0.3;
}

.profile-info-section {
    padding: 0 40px 30px;
    display: flex;
    align-items: flex-end;
    gap: 30px;
    position: relative;
}

.profile-avatar-container {
    margin-top: -60px;
    position: relative;
}

.profile-avatar {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid white;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-edit-btn {
    position: absolute;
    bottom: 5px;
    right: 5px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    border: 3px solid white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.avatar-edit-btn:hover {
    background: var(--secondary-color);
    transform: scale(1.1);
}

.profile-details {
    flex: 1;
}

.profile-details h1 {
    font-size: 2rem;
    color: var(--text-color);
    margin: 0 0 8px 0;
}

.profile-email {
    color: var(--text-light);
    margin: 0 0 12px 0;
    font-size: 1rem;
}

.profile-badges {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.badge {
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    background: var(--bg-light);
    color: var(--text-color);
}

.badge-verified {
    background: #d1fae5;
    color: var(--success-color);
}

.profile-actions {
    display: flex;
    gap: 12px;
}

/* Profile Content */
.profile-content {
    display: grid;
    grid-template-columns: 350px 1fr;
    gap: 30px;
    margin-top: 30px;
}

/* Sidebar */
.profile-sidebar {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.sidebar-card {
    background: white;
    border-radius: 16px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.sidebar-card h3 {
    font-size: 1.1rem;
    color: var(--text-color);
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.info-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.info-item:last-child {
    border-bottom: none;
}

.info-item i {
    width: 20px;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.info-item label {
    display: block;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 4px;
}

.info-item p {
    margin: 0;
    color: var(--text-color);
    font-weight: 500;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid var(--border-color);
}

.stat-item:last-child {
    border-bottom: none;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
}

.stat-info h4 {
    margin: 0 0 4px 0;
    font-size: 1.5rem;
    color: var(--text-color);
}

.stat-info p {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-light);
}

/* Main Content */
.profile-main-content {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.content-card {
    background: white;
    border-radius: 16px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.content-card h2 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0 0 25px 0;
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Edit Profile Form */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    color: var(--text-color);
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-group input:disabled {
    background: var(--bg-light);
    cursor: not-allowed;
}

.form-group small {
    display: block;
    margin-top: 6px;
    color: var(--text-light);
    font-size: 0.85rem;
}

.form-buttons {
    display: flex;
    gap: 12px;
    margin-top: 25px;
}

/* Courses Grid */
.courses-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
}

.empty-state i {
    font-size: 4rem;
    color: var(--border-color);
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    color: var(--text-color);
    margin: 0 0 10px 0;
}

.empty-state p {
    color: var(--text-light);
    margin: 0 0 25px 0;
}

/* Security Options */
.security-options {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.security-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.3s ease;
}

.security-item:hover {
    border-color: var(--primary-color);
    background: var(--bg-light);
}

.security-info h4 {
    margin: 0 0 6px 0;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.security-info p {
    margin: 0;
    color: var(--text-light);
    font-size: 0.9rem;
}

.btn-danger {
    background: var(--danger-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    backdrop-filter: blur(5px);
}

.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 1024px) {
    .profile-content {
        grid-template-columns: 1fr;
    }
    
    .profile-sidebar {
        order: 2;
    }
    
    .profile-main-content {
        order: 1;
    }
}

@media (max-width: 768px) {
    .profile-info-section {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 0 20px 30px;
    }
    
    .profile-avatar-container {
        margin-top: -75px;
    }
    
    .profile-details {
        width: 100%;
    }
    
    .profile-badges {
        justify-content: center;
    }
    
    .profile-actions {
        width: 100%;
        flex-direction: column;
    }
    
    .profile-actions .btn {
        width: 100%;
    }
    
    .user-menu {
        margin-left: auto;
    }
    
    .dropdown-toggle span {
        display: none;
    }
    
    .security-item {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .security-item button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .content-card {
        padding: 20px;
    }
    
    .sidebar-card {
        padding: 20px;
    }
    
    .profile-details h1 {
        font-size: 1.5rem;
    }
    
    .form-buttons {
        flex-direction: column;
    }
    
    .form-buttons .btn {
        width: 100%;
    }
}
