/* Professional UI Components - Modern Design System */

/* Enhanced Sidebar */
.sidebar {
    background: linear-gradient(180deg, var(--bg-secondary) 0%, #0a0a1f 100%);
    border-right: 1px solid rgba(139, 92, 246, 0.1);
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.3);
    padding: 1.5rem;
    height: 100vh;
    position: sticky;
    top: 0;
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
    overflow-y: auto;
    transition: all 0.3s ease;
}

.sidebar:hover {
    border-right-color: rgba(139, 92, 246, 0.2);
}

/* Logo Section */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    text-decoration: none;
    padding: 1rem;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    margin-bottom: 0.5rem;
}

.sidebar-logo:hover {
    background: rgba(139, 92, 246, 0.1);
    transform: translateX(4px);
}

.sidebar-logo-icon {
    width: 44px;
    height: 44px;
    background: var(--gradient-primary);
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 800;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    background-image: url('../icon_proper.ico');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

.sidebar-logo-text {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.375rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-light) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* User Profile Card */
.sidebar-user {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    border: 1px solid rgba(139, 92, 246, 0.2);
    border-radius: var(--radius-lg);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.sidebar-user::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--gradient-primary);
}

.sidebar-user:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(139, 92, 246, 0.2);
}

.sidebar-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: var(--gradient-primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.25rem;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    position: relative;
}

.sidebar-avatar::after {
    content: '';
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--bg-secondary);
    border-radius: 50%;
}

.sidebar-user-info {
    flex: 1;
    min-width: 0;
}

.sidebar-user-email {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: normal;
    word-break: break-word;
    overflow-wrap: break-word;
    line-height: 1.4;
    margin-bottom: 0.5rem;
}

.sidebar-user-plan {
    font-size: 0.875rem;
    color: var(--primary);
    font-weight: 500;
    line-height: 1.4;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Navigation Menu */
.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    flex: 1;
    padding: 0.5rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1rem;
    color: var(--text-muted);
    text-decoration: none;
    border-radius: var(--radius-lg);
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
    overflow: hidden;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--gradient-primary);
    border-radius: 0 2px 2px 0;
    transition: height 0.3s ease;
}

.nav-item:hover {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1) 0%, rgba(59, 130, 246, 0.05) 100%);
    color: var(--text-secondary);
    transform: translateX(4px);
}

.nav-item:hover::before {
    height: 70%;
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.2) 0%, rgba(59, 130, 246, 0.1) 100%);
    color: var(--primary);
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.15);
}

.nav-item.active::before {
    height: 100%;
}

.nav-icon {
    font-size: 1.25rem;
    width: 24px;
    height: 24px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.nav-item:hover .nav-icon {
    transform: scale(1.1);
}

.nav-item.active .nav-icon {
    color: var(--primary);
}

/* Enhanced Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s ease, height 0.6s ease;
}

.btn:active::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    border: 1px solid var(--border-secondary);
}

.btn-secondary:hover {
    background: var(--bg-card);
    border-color: var(--border-primary);
    transform: translateY(-1px);
}

.btn-outline {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-secondary);
}

.btn-outline:hover {
    background: var(--bg-tertiary);
    border-color: var(--primary);
    color: var(--primary);
}

.btn-full {
    width: 100%;
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.8125rem;
}

.btn-large {
    padding: 0.875rem 2rem;
    font-size: 1rem;
}

/* Enhanced Cards */
.stat-card {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(26, 26, 53, 0.8) 100%);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.3), transparent);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(139, 92, 246, 0.15);
    border-color: rgba(139, 92, 246, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

/* Enhanced Tabs */
.tabs {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-tertiary);
    padding: 0.25rem;
    border-radius: var(--radius-lg);
}

.tab-btn {
    padding: 0.625rem 1.25rem;
    background: transparent;
    border: none;
    border-radius: var(--radius-md);
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    position: relative;
}

.tab-btn:hover {
    background: rgba(139, 92, 246, 0.1);
    color: var(--text-secondary);
}

.tab-btn.active {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(139, 92, 246, 0.3);
}

/* Enhanced Forms */
.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    color: var(--text-primary);
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
    background: var(--bg-card);
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
}

/* Enhanced Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    animation: fadeIn 0.3s ease;
}

.modal {
    background: linear-gradient(135deg, var(--bg-card) 0%, rgba(26, 26, 53, 0.95) 100%);
    border: 1px solid var(--border-primary);
    border-radius: var(--radius-xl);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(139, 92, 246, 0.3);
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Enhanced Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: slideInRight 0.3s ease;
    z-index: 10000;
}

@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Enhanced Loading Spinner */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-secondary);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Enhanced Dropdown */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--bg-card);
    border: 1px solid var(--border-secondary);
    border-radius: var(--radius-lg);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.4);
    min-width: 200px;
    z-index: 1000;
    animation: fadeIn 0.2s ease;
}

.dropdown-item {
    display: block;
    padding: 0.75rem 1rem;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
}

.dropdown-item:hover {
    background: var(--bg-tertiary);
    color: var(--text-primary);
}

.dropdown-item:first-child {
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* Enhanced Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.stat-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-muted);
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-lg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card-value {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.stat-card-change {
    font-size: 0.8125rem;
    color: var(--text-muted);
}
