/* Modern OpenClaw Landing Page & Dashboard */

:root {
    --primary: #00D9FF;
    --secondary: #7C3AED;
    --dark: #0F172A;
    --darker: #020617;
    --light: #F8FAFC;
    --gray: #64748B;
    --success: #10B981;
    --warning: #F59E0B;
    --danger: #EF4444;
    --gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--darker);
    color: var(--light);
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navbar */
.navbar {
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
    padding: 1rem 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.btn-login, .btn-logout {
    background: transparent;
    border: 2px solid var(--primary);
    color: var(--primary);
    padding: 0.5rem 1.5rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-login:hover, .btn-logout:hover {
    background: var(--primary);
    color: var(--darker);
    transform: translateY(-2px);
}

/* Hero Section */
.hero {
    padding: 8rem 0 6rem;
    text-align: center;
}

.hero h1 {
    font-size: 5rem;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1rem;
}

.subtitle {
    font-size: 1.5rem;
    color: var(--gray);
    margin-bottom: 3rem;
}

.highlight {
    color: var(--primary);
    font-weight: 700;
}

.hero-stats {
    display: flex;
    justify-content: center;
    gap: 4rem;
    margin-bottom: 3rem;
}

.stat {
    text-align: center;
}

.stat-value {
    font-size: 3rem;
    font-weight: 900;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    color: var(--gray);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.btn-primary {
    background: var(--gradient);
    border: none;
    color: white;
    padding: 1rem 3rem;
    font-size: 1.1rem;
    font-weight: 700;
    border-radius: 12px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(0, 217, 255, 0.5);
}

/* Features Section */
.features {
    padding: 6rem 0;
    background: rgba(15, 23, 42, 0.5);
}

.features h2 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.feature-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    transition: all 0.3s ease;
    position: relative;
}

.feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
}

.feature-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.feature-card h3 {
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.feature-card p {
    color: var(--gray);
}

.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

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

.status-badge.offline {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

/* Services Status */
.services-status {
    padding: 6rem 0;
}

.services-status h2 {
    text-align: center;
    font-size: 3rem;
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}

.service-item {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.service-info h4 {
    color: var(--light);
    margin-bottom: 0.25rem;
}

.service-info p {
    color: var(--gray);
    font-size: 0.9rem;
}

.service-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 10px var(--success);
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* Footer */
.footer {
    padding: 3rem 0;
    text-align: center;
    border-top: 1px solid rgba(0, 217, 255, 0.1);
    color: var(--gray);
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: var(--dark);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 20px;
    padding: 3rem;
    max-width: 400px;
    width: 90%;
    position: relative;
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 2rem;
    cursor: pointer;
    color: var(--gray);
    transition: color 0.3s ease;
}

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

.modal-content h2 {
    margin-bottom: 2rem;
    color: var(--primary);
}

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

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--gray);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    color: var(--light);
    font-size: 1rem;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
}

.error-message {
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 1rem;
    display: none;
}

.error-message.show {
    display: block;
}

/* Page Management */
.page {
    display: none;
}

.page.active {
    display: block;
}

/* Dashboard */
.dashboard-nav {
    background: var(--dark);
}

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

.dashboard-container {
    display: flex;
    min-height: calc(100vh - 70px);
}

.sidebar {
    width: 250px;
    background: var(--dark);
    border-right: 1px solid rgba(0, 217, 255, 0.1);
    padding: 2rem 0;
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 2rem;
    color: var(--gray);
    text-decoration: none;
    transition: all 0.3s ease;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: rgba(0, 217, 255, 0.05);
    color: var(--primary);
}

.nav-item.active {
    background: rgba(0, 217, 255, 0.1);
    color: var(--primary);
    border-left-color: var(--primary);
}

.nav-item .icon {
    font-size: 1.2rem;
}

.dashboard-main {
    flex: 1;
    padding: 3rem;
    overflow-y: auto;
}

.dashboard-page {
    display: none;
}

.dashboard-page.active {
    display: block;
}

.dashboard-main h1 {
    margin-bottom: 2rem;
    font-size: 2.5rem;
}

.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.stat-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: transform 0.3s ease;
}

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

.stat-icon {
    font-size: 2.5rem;
}

.stat-info .stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--light);
}

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

.charts-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
    gap: 2rem;
}

.chart-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
}

.chart-card h3 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.activity-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.activity-item {
    padding: 1rem;
    background: rgba(0, 217, 255, 0.05);
    border-left: 3px solid var(--primary);
    border-radius: 8px;
}

.activity-item .time {
    color: var(--gray);
    font-size: 0.85rem;
}

/* Glitch Effect */
.glitch {
    position: relative;
    animation: glitch-anim 2s infinite;
}

@keyframes glitch-anim {
    0%, 90%, 100% {
        transform: translate(0);
    }
    92% {
        transform: translate(-2px, 2px);
    }
    94% {
        transform: translate(2px, -2px);
    }
    96% {
        transform: translate(-2px, -2px);
    }
    98% {
        transform: translate(2px, 2px);
    }
}

/* Responsive */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 3rem;
    }

    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }

    .dashboard-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid rgba(0, 217, 255, 0.1);
    }

    .charts-row {
        grid-template-columns: 1fr;
    }
}

/* ========================================
   Enhanced Service Cards
   ======================================== */

.service-card-detailed {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.service-card-detailed:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
}

.service-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
}

.service-title-row {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.service-icon-large {
    font-size: 3rem;
}

.service-port {
    color: var(--gray);
    font-size: 0.9rem;
    margin: 0;
}

.service-status-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
}

.service-status-badge.online {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
    border: 1px solid var(--success);
}

.service-status-badge.offline {
    background: rgba(239, 68, 68, 0.2);
    color: var(--danger);
    border: 1px solid var(--danger);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: currentColor;
    animation: pulse 2s infinite;
}

.service-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.service-stat {
    text-align: center;
    padding: 1rem;
    background: rgba(0, 217, 255, 0.05);
    border-radius: 12px;
}

.stat-label {
    display: block;
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

.stat-value {
    display: block;
    color: var(--primary);
    font-size: 1.2rem;
    font-weight: 700;
}

.service-actions {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.btn-service-action {
    flex: 1;
    min-width: 100px;
    padding: 0.75rem 1rem;
    background: rgba(0, 217, 255, 0.1);
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-service-action:hover {
    background: var(--primary);
    color: var(--darker);
    transform: translateY(-2px);
}

.btn-service-action.danger {
    border-color: var(--danger);
    color: var(--danger);
}

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

.btn-service-action.success {
    border-color: var(--success);
    color: var(--success);
}

.btn-service-action.success:hover {
    background: var(--success);
    color: white;
}

/* ========================================
   Notifications
   ======================================== */

.notification {
    position: fixed;
    top: 2rem;
    right: -400px;
    min-width: 300px;
    max-width: 400px;
    padding: 1rem 1.5rem;
    background: var(--dark);
    border: 1px solid rgba(0, 217, 255, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 10000;
    transition: right 0.3s ease;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.notification.show {
    right: 2rem;
}

.notification-icon {
    font-size: 1.5rem;
}

.notification-message {
    flex: 1;
    color: var(--light);
}

.notification-success {
    border-color: var(--success);
}

.notification-error {
    border-color: var(--danger);
}

.notification-warning {
    border-color: var(--warning);
}

.notification-info {
    border-color: var(--primary);
}

/* ========================================
   Logs Container
   ======================================== */

.logs-container {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 8px;
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Courier New', monospace;
}

.log-line {
    padding: 0.5rem;
    border-bottom: 1px solid rgba(0, 217, 255, 0.1);
    font-size: 0.85rem;
    color: var(--light);
}

.log-line:last-child {
    border-bottom: none;
}

/* ========================================
   Activity Items Enhanced
   ======================================== */

.activity-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: rgba(0, 217, 255, 0.05);
    border-left: 3px solid var(--primary);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.activity-item:hover {
    background: rgba(0, 217, 255, 0.1);
    transform: translateX(5px);
}

.activity-icon {
    font-size: 1.5rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 50%;
}

.activity-content {
    flex: 1;
}

.activity-text {
    color: var(--light);
    margin-bottom: 0.25rem;
}

/* ========================================
   Modal Body
   ======================================== */

.modal-body {
    width: 100%;
}

#modal-title {
    color: var(--primary);
    margin-bottom: 1.5rem;
}

#modal-content {
    color: var(--light);
}

/* ========================================
   Service Link
   ======================================== */

.service-link {
    display: inline-block;
    margin-top: 0.5rem;
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.service-link:hover {
    color: var(--secondary);
    transform: translateX(5px);
}

/* ========================================
   Scrollbar Styling
   ======================================== */

.logs-container::-webkit-scrollbar,
.dashboard-main::-webkit-scrollbar {
    width: 8px;
}

.logs-container::-webkit-scrollbar-track,
.dashboard-main::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.logs-container::-webkit-scrollbar-thumb,
.dashboard-main::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 4px;
}

.logs-container::-webkit-scrollbar-thumb:hover,
.dashboard-main::-webkit-scrollbar-thumb:hover {
    background: var(--secondary);
}

/* ========================================
   Enhanced Workflow Cards
   ======================================== */

.workflow-card-enhanced {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
}

.workflow-card-enhanced:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 10px 30px rgba(0, 217, 255, 0.2);
}

.workflow-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.workflow-icon {
    font-size: 2.5rem;
    min-width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 12px;
}

.workflow-title-section {
    flex: 1;
}

.workflow-title-section h3 {
    color: var(--primary);
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
}

.workflow-description {
    color: var(--gray);
    font-size: 0.95rem;
    margin: 0;
}

.workflow-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.workflow-stat {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

/* ========================================
   Enhanced Note Cards (Obsidian)
   ======================================== */

.note-card {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.3s ease;
}

.note-card:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(0, 217, 255, 0.15);
}

.note-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.note-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(124, 58, 237, 0.1);
    border-radius: 10px;
}

.note-info {
    flex: 1;
}

.note-info h4 {
    color: var(--primary);
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.note-meta {
    color: var(--gray);
    font-size: 0.85rem;
    margin: 0;
}

.note-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.tag {
    background: rgba(124, 58, 237, 0.2);
    color: var(--secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 600;
}

.note-actions {
    display: flex;
    gap: 0.75rem;
}

.note-actions .btn-service-action {
    flex: 1;
    min-width: 0;
}

/* ========================================
   Enhanced Activity Cards (GitHub)
   ======================================== */

.activity-card-enhanced {
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(0, 217, 255, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    transition: all 0.3s ease;
}

.activity-card-enhanced:hover {
    transform: translateY(-2px);
    border-color: var(--primary);
    box-shadow: 0 8px 25px rgba(0, 217, 255, 0.15);
}

.activity-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 217, 255, 0.1);
    border-radius: 10px;
    flex-shrink: 0;
}

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

.activity-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap;
}

.activity-type {
    background: rgba(0, 217, 255, 0.2);
    color: var(--primary);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.activity-number,
.activity-hash {
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 600;
}

.activity-status {
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
}

.activity-status.status-open {
    background: rgba(16, 185, 129, 0.2);
    color: var(--success);
}

.activity-status.status-closed {
    background: rgba(100, 116, 139, 0.2);
    color: var(--gray);
}

.activity-status.status-merged {
    background: rgba(124, 58, 237, 0.2);
    color: var(--secondary);
}

.activity-title {
    color: var(--light);
    font-size: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 600;
}

.activity-meta {
    color: var(--gray);
    font-size: 0.85rem;
    margin: 0;
}

.activity-actions {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.activity-actions .btn-service-action {
    min-width: 90px;
}

/* ========================================
   Responsive Enhancements
   ======================================== */

@media (max-width: 768px) {
    .workflow-card-enhanced,
    .activity-card-enhanced {
        flex-direction: column;
    }

    .activity-actions {
        width: 100%;
    }

    .activity-actions .btn-service-action {
        flex: 1;
    }

    .workflow-header {
        flex-direction: column;
        text-align: center;
    }

    .service-actions {
        flex-direction: column;
    }

    .service-actions .btn-service-action {
        width: 100%;
    }
}
