/* Service Hub Styles */
:root {
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-card: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #94a3b8;
    --border-color: #475569;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.4);
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Screen Management */
.screen {
    display: none;
    min-height: 100vh;
}

.screen.active {
    display: flex;
}

/* Login Screen */
#login-screen {
    align-items: center;
    justify-content: center;
    padding: 2rem;
    background: linear-gradient(135deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
}

.login-container {
    width: 100%;
    max-width: 420px;
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.logo i {
    font-size: 2rem;
    color: var(--primary-color);
}

.logo span {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Login Tabs */
.login-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
    background: var(--bg-primary);
    padding: 0.25rem;
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    padding: 0.75rem;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.tab-btn:hover {
    color: var(--text-primary);
}

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

/* Forms */
.auth-form {
    display: none;
}

.auth-form.active {
    display: block;
}

.form-group {
    margin-bottom: 1.25rem;
}

.form-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.form-group input::placeholder {
    color: var(--text-secondary);
    opacity: 0.6;
}

.form-group .hint {
    display: block;
    margin-top: 0.375rem;
    font-size: 0.8rem;
    color: var(--text-secondary);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 1rem;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    padding: 0.625rem 1rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-primary);
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-secondary:hover {
    background: var(--bg-secondary);
    border-color: var(--primary-color);
}

.btn-logout {
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    color: var(--danger-color);
    background: rgba(239, 68, 68, 0.1);
}

/* Message */
.message {
    margin-top: 1rem;
    padding: 0.875rem;
    border-radius: 8px;
    font-size: 0.9rem;
    display: none;
}

.message.show {
    display: block;
}

.message.success {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

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

/* Dashboard Layout */
#dashboard-screen {
    display: none;
}

#dashboard-screen.active {
    display: flex;
}

.sidebar {
    width: 260px;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.sidebar-header .logo {
    justify-content: flex-start;
    margin-bottom: 0;
}

.sidebar-header .logo i {
    font-size: 1.5rem;
}

.sidebar-header .logo span {
    font-size: 1.25rem;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 0.875rem 1.5rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    color: var(--text-primary);
    background: rgba(99, 102, 241, 0.05);
}

.nav-item.active {
    color: var(--primary-color);
    background: rgba(99, 102, 241, 0.1);
    border-left-color: var(--primary-color);
}

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

.sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-primary);
    font-weight: 500;
}

.user-info i {
    font-size: 1.5rem;
    color: var(--primary-color);
}

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

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.page-header p {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.2s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

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

.stat-icon.connected {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.stat-icon.requests {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.stat-icon.security {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.stat-icon.activity {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-secondary);
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.stat-info p {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Dashboard Content */
.dashboard-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
}

.section-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1rem;
}

.service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.2s ease;
}

.service-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.service-card.connected {
    border-color: var(--success-color);
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: var(--primary-color);
    flex-shrink: 0;
}

.service-info {
    flex: 1;
}

.service-info h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.service-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-bottom: 0.75rem;
}

.service-status {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.service-status.ready {
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
}

.service-status.connected {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.service-status.not-configured {
    background: rgba(100, 116, 139, 0.1);
    color: var(--text-secondary);
}

.service-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.btn-connect {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-connect:hover {
    background: var(--primary-dark);
}

.btn-disconnect {
    padding: 0.5rem 1rem;
    border: 1px solid var(--danger-color);
    border-radius: 6px;
    background: transparent;
    color: var(--danger-color);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.btn-disconnect:hover {
    background: var(--danger-color);
    color: white;
}

/* Services List (Services Page) */
.services-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.service-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.25rem;
    transition: all 0.2s ease;
}

.service-item:hover {
    border-color: var(--primary-color);
}

.service-item .service-icon {
    width: 56px;
    height: 56px;
    font-size: 1.5rem;
}

.service-item .service-info {
    flex: 1;
}

.service-item .service-info h3 {
    font-size: 1.1rem;
    margin-bottom: 0.375rem;
}

.service-item .service-info p {
    font-size: 0.875rem;
}

.service-item .service-actions {
    flex-direction: row;
}

/* Admin Grid */
.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.admin-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.2s ease;
}

.admin-card:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
}

.admin-card h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.admin-card p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    font-size: 1.25rem;
    font-weight: 600;
}

.modal-close {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.modal-close:hover {
    color: var(--text-primary);
}

.modal-body {
    padding: 1.5rem;
}

/* Content Sections */
.content-section {
    display: none;
}

.content-section.active {
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        position: relative;
        height: auto;
    }

    .main-content {
        margin-left: 0;
    }

    #dashboard-screen {
        flex-direction: column;
    }

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

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

    .service-item {
        flex-direction: column;
        text-align: center;
    }

    .service-item .service-actions {
        width: 100%;
        justify-content: center;
    }
}

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

.stat-card, .service-card, .admin-card {
    animation: fadeIn 0.3s ease forwards;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

/* Admin Styles */
.admin-tab {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%) !important;
    color: white !important;
}

.admin-tab:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%) !important;
}

.btn-primary.admin-btn {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

.btn-primary.admin-btn:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.4);
}

/* Admin Content */
.admin-content {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
}

/* Admin Users List */
.admin-users-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.admin-user-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.admin-user-card:hover {
    border-color: var(--primary-color);
}

.admin-user-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.25rem;
    background: rgba(99, 102, 241, 0.05);
    cursor: pointer;
    transition: all 0.2s ease;
}

.admin-user-header:hover {
    background: rgba(99, 102, 241, 0.1);
}

.admin-user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.admin-user-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
}

.admin-user-details h3 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.admin-user-details p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.admin-user-stats {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.admin-user-stat {
    text-align: center;
}

.admin-user-stat span {
    display: block;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--primary-color);
}

.admin-user-stat label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-user-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-view {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 6px;
    background: var(--primary-color);
    color: white;
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-delete {
    padding: 0.5rem 1rem;
    border: 1px solid var(--danger-color);
    border-radius: 6px;
    background: transparent;
    color: var(--danger-color);
    font-size: 0.8rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-delete:hover {
    background: var(--danger-color);
    color: white;
}

.admin-user-services {
    padding: 1.25rem;
    border-top: 1px solid var(--border-color);
    display: none;
}

.admin-user-services.show {
    display: block;
}

.admin-user-services h4 {
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.admin-service-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem;
    background: var(--bg-primary);
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.admin-service-item:last-child {
    margin-bottom: 0;
}

.admin-service-info h5 {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
}

.admin-service-info p {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.admin-service-credentials {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    text-align: right;
}

.admin-service-credentials span {
    font-size: 0.8rem;
    color: var(--text-secondary);
    font-family: monospace;
}

.admin-service-credentials .label {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-secondary);
    opacity: 0.7;
}

/* Admin Services List */
.admin-services-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1rem;
}

.admin-service-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    transition: all 0.2s ease;
}

.admin-service-card:hover {
    border-color: var(--success-color);
    transform: translateY(-2px);
}

.admin-service-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.admin-service-card-header h4 {
    font-size: 1rem;
    font-weight: 600;
}

.admin-service-owner {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.25rem 0.75rem;
    background: rgba(99, 102, 241, 0.1);
    color: var(--primary-color);
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.admin-service-data {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

.admin-service-data-item {
    background: var(--bg-primary);
    padding: 0.625rem;
    border-radius: 6px;
}

.admin-service-data-item label {
    display: block;
    font-size: 0.7rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.25rem;
}

.admin-service-data-item span {
    font-size: 0.85rem;
    color: var(--text-primary);
    font-family: monospace;
    word-break: break-all;
}

.admin-service-data-item .service-link,
.admin-service-credentials .service-link {
    font-size: 0.85rem;
    color: var(--primary-color);
    text-decoration: none;
    word-break: break-all;
    font-family: inherit;
}

.admin-service-data-item .service-link:hover,
.admin-service-credentials .service-link:hover {
    text-decoration: underline;
}

/* Expand/Collapse Icon */
.expand-icon {
    transition: transform 0.2s ease;
    color: var(--text-secondary);
}

.expand-icon.rotated {
    transform: rotate(180deg);
}

/* No Data Message */
.no-data {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-data i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-data p {
    font-size: 1rem;
}

/* Responsive Admin */
@media (max-width: 768px) {
    .admin-user-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .admin-user-stats {
        width: 100%;
        justify-content: space-between;
    }

    .admin-user-actions {
        width: 100%;
    }

    .btn-view, .btn-delete {
        flex: 1;
    }

    .admin-services-list {
        grid-template-columns: 1fr;
    }

    .admin-service-data {
        grid-template-columns: 1fr;
    }
}

/* Recent Activity Section */
.recent-activity-section {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(217, 119, 6, 0.05) 100%);
    border: 2px solid rgba(245, 158, 11, 0.3);
    margin-bottom: 2rem;
}

.recent-activity-section .section-header {
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.recent-activity-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #d97706;
}

.recent-activity-section h2 i {
    color: #f59e0b;
}

/* Live Indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.pulse {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.last-update {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
}

/* Recent Activity List */
.recent-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.loading-activity {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading-activity i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #f59e0b;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-item:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.activity-item.new-activity {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    animation: highlightNew 2s ease;
}

@keyframes highlightNew {
    0% {
        background: rgba(34, 197, 94, 0.3);
    }
    100% {
        background: rgba(34, 197, 94, 0.1);
    }
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-icon.connect {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.activity-icon.disconnect {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.activity-icon.register {
    background: rgba(99, 102, 241, 0.15);
    color: #4f46e5;
}

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

.activity-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.activity-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-family: monospace;
}

/* Empty Activity State */
.no-activity {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-activity i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-activity h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.no-activity p {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Recent Activity Section */
.recent-activity-section {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08) 0%, rgba(217, 119, 6, 0.03) 100%);
    border: 2px solid rgba(245, 158, 11, 0.25);
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.recent-activity-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #f59e0b, #d97706, #f59e0b);
    background-size: 200% 100%;
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.recent-activity-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(245, 158, 11, 0.2);
    padding-bottom: 1rem;
    margin-bottom: 1rem;
}

.recent-activity-section h2 {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #d97706;
    font-size: 1.25rem;
}

.recent-activity-section h2 i {
    color: #f59e0b;
}

/* Live Indicator */
.live-indicator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
    padding: 0.35rem 0.75rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(34, 197, 94, 0.3);
    animation: pulse-border 2s infinite;
}

@keyframes pulse-border {
    0%, 100% {
        border-color: rgba(34, 197, 94, 0.3);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.2);
    }
    50% {
        border-color: rgba(34, 197, 94, 0.6);
        box-shadow: 0 0 0 4px rgba(34, 197, 94, 0);
    }
}

.live-indicator .pulse {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse-animation 1.5s infinite;
}

@keyframes pulse-animation {
    0% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
    }
    70% {
        transform: scale(1);
        box-shadow: 0 0 0 10px rgba(34, 197, 94, 0);
    }
    100% {
        transform: scale(0.95);
        box-shadow: 0 0 0 0 rgba(34, 197, 94, 0);
    }
}

.last-update {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-style: italic;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.last-update::before {
    content: '';
    width: 6px;
    height: 6px;
    background: var(--text-secondary);
    border-radius: 50%;
    opacity: 0.5;
}

/* Recent Activity List */
.recent-activity-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 0.5rem;
}

.recent-activity-list::-webkit-scrollbar {
    width: 6px;
}

.recent-activity-list::-webkit-scrollbar-track {
    background: rgba(245, 158, 11, 0.1);
    border-radius: 3px;
}

.recent-activity-list::-webkit-scrollbar-thumb {
    background: rgba(245, 158, 11, 0.4);
    border-radius: 3px;
}

.recent-activity-list::-webkit-scrollbar-thumb:hover {
    background: rgba(245, 158, 11, 0.6);
}

.loading-activity {
    text-align: center;
    padding: 2rem;
    color: var(--text-secondary);
}

.loading-activity i {
    font-size: 2rem;
    margin-bottom: 0.5rem;
    color: #f59e0b;
}

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    transition: all 0.2s ease;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.activity-item:hover {
    border-color: #f59e0b;
    background: rgba(245, 158, 11, 0.05);
}

.activity-item.new-activity {
    border-color: #22c55e;
    background: rgba(34, 197, 94, 0.1);
    animation: highlightNew 2s ease;
}

@keyframes highlightNew {
    0% {
        background: rgba(34, 197, 94, 0.3);
    }
    100% {
        background: rgba(34, 197, 94, 0.1);
    }
}

.activity-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.activity-icon.connect {
    background: rgba(34, 197, 94, 0.15);
    color: #16a34a;
}

.activity-icon.disconnect {
    background: rgba(239, 68, 68, 0.15);
    color: #dc2626;
}

.activity-icon.register {
    background: rgba(99, 102, 241, 0.15);
    color: #4f46e5;
}

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

.activity-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.activity-details p {
    font-size: 0.85rem;
    color: var(--text-secondary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    white-space: nowrap;
    font-family: monospace;
}

/* Empty Activity State */
.no-activity {
    text-align: center;
    padding: 3rem;
    color: var(--text-secondary);
}

.no-activity i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-activity h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.no-activity p {
    font-size: 0.9rem;
    opacity: 0.7;
}

/* Hidden class for modal steps */
.hidden {
    display: none !important;
}

/* Available Services List in Modal */
.available-services-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
}

.available-service-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.available-service-item:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.available-service-item.connected {
    opacity: 0.6;
    cursor: not-allowed;
}

.available-service-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.available-service-info {
    flex: 1;
}

.available-service-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.available-service-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.available-service-info .already-connected {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--success-color);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
}

.available-service-arrow {
    color: var(--text-secondary);
}

/* Selected Service Header */
.selected-service-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.selected-service-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
}

.selected-service-header h3 span {
    color: var(--primary-color);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
}

/* Add Service Button */
#add-service-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    width: auto;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

#add-service-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.4);
}

/* Available Services List in Modal */
.available-services-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    max-height: 400px;
    overflow-y: auto;
    margin-top: 1rem;
}

.available-service-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.available-service-item:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
    transform: translateX(4px);
}

.available-service-item.connected {
    opacity: 0.6;
    cursor: not-allowed;
}

.available-service-item.connected:hover {
    transform: none;
    border-color: var(--border-color);
}

.available-service-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-color);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    color: white;
    flex-shrink: 0;
}

.available-service-info {
    flex: 1;
}

.available-service-info h4 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--text-primary);
}

.available-service-info p {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.available-service-info .already-connected {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: var(--success-color);
    color: white;
    border-radius: 4px;
    font-size: 0.75rem;
}

.available-service-arrow {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Selected Service Header */
.selected-service-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.selected-service-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
}

.selected-service-header h3 span {
    color: var(--primary-color);
}

.btn-back {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-back:hover {
    background: var(--bg-card);
    border-color: var(--primary-color);
}

/* Cancel button in modal */
.cancel-btn {
    margin-left: 1rem;
}

/* Force modal to show when show class is added */
.modal.show {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
}
