/**
 * IAStriker Tipster Sidebar - B2B Dashboard Styles
 */

:root {
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --purple-500: #8b5cf6;
    --purple-600: #7c3aed;
    --green-500: #22c55e;
    --green-600: #16a34a;
    --red-500: #ef4444;
    --yellow-500: #eab308;
    --orange-500: #f97316;
    --cyan-500: #06b6d4;
}

/* Sidebar Container */
.sidebar {
    position: fixed;
    left: 0;
    top: 0;
    width: 260px;
    height: 100vh;
    background: white;
    border-right: 1px solid var(--gray-200);
    padding: 1.5rem;
    z-index: 50;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

/* Logo */
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 2rem;
    text-decoration: none;
}

.logo-icon {
    width: 42px;
    height: 42px;
    min-width: 42px;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
}

.logo-badge {
    font-size: 10px;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    margin-left: 4px;
}

/* Tipster Info */
.tipster-info {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--gray-50);
    border-radius: 12px;
    margin-bottom: 1.5rem;
}

.tipster-avatar {
    width: 44px;
    height: 44px;
    min-width: 44px;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 16px;
}

.tipster-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.tipster-details {
    flex: 1;
    min-width: 0;
}

.tipster-name {
    font-weight: 600;
    color: var(--gray-900);
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tipster-plan {
    font-size: 12px;
    color: var(--gray-500);
    display: flex;
    align-items: center;
    gap: 6px;
}

.plan-badge {
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.plan-badge.starter { background: var(--gray-100); color: var(--gray-600); }
.plan-badge.pro { background: rgba(59, 130, 246, 0.1); color: var(--blue-600); }
.plan-badge.elite { background: rgba(139, 92, 246, 0.1); color: var(--purple-600); }
.plan-badge.agency { background: linear-gradient(135deg, var(--purple-500), var(--blue-500)); color: white; }

/* Navigation */
.nav-section {
    margin-bottom: 1.5rem;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--gray-400);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-items {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: var(--gray-600);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
    cursor: pointer;
}

.nav-item:hover {
    background: var(--gray-50);
    color: var(--gray-900);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.1), rgba(59, 130, 246, 0.1));
    color: var(--purple-600);
}

.nav-item i {
    width: 20px;
    text-align: center;
    font-size: 16px;
}

.nav-item .badge {
    margin-left: auto;
    background: var(--gray-100);
    color: var(--gray-600);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
}

.nav-item .badge.new {
    background: var(--green-500);
    color: white;
}

.nav-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-item.disabled:hover {
    background: transparent;
    color: var(--gray-600);
}

/* Subscription Status */
.subscription-status {
    margin-top: auto;
    padding: 16px;
    background: var(--gray-50);
    border-radius: 12px;
}

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

.subscription-label {
    font-size: 12px;
    color: var(--gray-500);
}

.subscription-badge {
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.subscription-badge.active { background: rgba(34, 197, 94, 0.1); color: var(--green-600); }
.subscription-badge.trial { background: rgba(249, 115, 22, 0.1); color: var(--orange-500); }
.subscription-badge.expired { background: rgba(239, 68, 68, 0.1); color: var(--red-500); }

.subscription-days {
    font-size: 14px;
    font-weight: 600;
    color: var(--gray-900);
}

.upgrade-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 10px;
    margin-top: 12px;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

/* Main Content */
.main-content {
    margin-left: 260px;
    padding: 32px;
    min-height: 100vh;
}

/* Page Header */
.page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

.page-header p {
    color: var(--gray-500);
    margin-top: 4px;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--gray-200);
}

.stat-card-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.stat-icon.blue { background: rgba(59, 130, 246, 0.1); color: var(--blue-500); }
.stat-icon.green { background: rgba(34, 197, 94, 0.1); color: var(--green-500); }
.stat-icon.purple { background: rgba(139, 92, 246, 0.1); color: var(--purple-500); }
.stat-icon.orange { background: rgba(249, 115, 22, 0.1); color: var(--orange-500); }
.stat-icon.cyan { background: rgba(6, 182, 212, 0.1); color: var(--cyan-500); }

.stat-label {
    font-size: 13px;
    color: var(--gray-500);
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--gray-900);
}

.stat-change {
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 4px;
    margin-top: 8px;
}

.stat-change.positive { color: var(--green-500); }
.stat-change.negative { color: var(--red-500); }

/* Cards */
.card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    border: 1px solid var(--gray-200);
    margin-bottom: 24px;
}

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

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--gray-900);
}

.card-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    margin-top: 2px;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-200);
}

.btn-outline {
    background: transparent;
    border: 1px solid var(--gray-200);
    color: var(--gray-700);
}

.btn-outline:hover {
    border-color: var(--gray-300);
    background: var(--gray-50);
}

/* API Key Display */
.api-key-display {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: var(--gray-50);
    border-radius: 8px;
    border: 1px solid var(--gray-200);
    font-family: 'Monaco', 'Consolas', monospace;
    font-size: 13px;
}

.api-key-display .key {
    flex: 1;
    color: var(--gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
}

.api-key-display .copy-btn {
    padding: 6px 12px;
    background: white;
    border: 1px solid var(--gray-200);
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    color: var(--gray-600);
}

.api-key-display .copy-btn:hover {
    background: var(--gray-100);
}

/* Progress Bar */
.progress-bar {
    width: 100%;
    height: 8px;
    background: var(--gray-100);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    border-radius: 4px;
    transition: width 0.3s ease;
}

.progress-fill.warning {
    background: var(--orange-500);
}

.progress-fill.danger {
    background: var(--red-500);
}

/* Form Elements */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--gray-700);
    margin-bottom: 8px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--gray-200);
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--purple-500);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, 0.1);
}

.form-input::placeholder {
    color: var(--gray-400);
}

/* Toggle Switch */
.toggle-wrapper {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid var(--gray-100);
}

.toggle-label {
    font-size: 14px;
    color: var(--gray-700);
}

.toggle-description {
    font-size: 12px;
    color: var(--gray-500);
    margin-top: 2px;
}

.toggle {
    position: relative;
    width: 44px;
    height: 24px;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--gray-200);
    transition: .3s;
    border-radius: 24px;
}

.toggle-slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .3s;
    border-radius: 50%;
}

.toggle input:checked + .toggle-slider {
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
}

.toggle input:checked + .toggle-slider:before {
    transform: translateX(20px);
}

/* Alert Messages */
.alert {
    padding: 16px;
    border-radius: 12px;
    margin-bottom: 20px;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: var(--blue-600);
}

.alert-success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--green-600);
}

.alert-warning {
    background: rgba(249, 115, 22, 0.1);
    border: 1px solid rgba(249, 115, 22, 0.2);
    color: var(--orange-500);
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    color: var(--red-500);
}

/* Feature Lock */
.feature-locked {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.feature-locked::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.5);
    border-radius: inherit;
}

.lock-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 1;
}

.lock-overlay i {
    font-size: 32px;
    color: var(--gray-400);
    margin-bottom: 8px;
}

.lock-overlay p {
    font-size: 14px;
    color: var(--gray-600);
    font-weight: 500;
}

/* Responsive */
@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
        padding: 20px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
}
