/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #2563eb;
    --secondary-color: #7c3aed;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark: #1f2937;
    --light: #f3f4f6;
    --white: #ffffff;
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background: var(--light);
}

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

/* Header */
.header {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    padding: 1.5rem 0;
    box-shadow: var(--shadow-lg);
    position: sticky;
    top: 0;
    z-index: 1000;
}

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

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

.logo i {
    font-size: 2rem;
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
}

.nav {
    display: flex;
    gap: 2rem;
}

.nav-link {
    color: var(--white);
    text-decoration: none;
    font-weight: 500;
    transition: opacity 0.3s;
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.nav-link:hover,
.nav-link.active {
    background: rgba(255, 255, 255, 0.2);
    opacity: 0.9;
}

/* Dropdown Menu */
.nav-dropdown {
    position: relative;
}

.nav-dropdown:hover .dropdown-menu {
    display: block;
}

.dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    margin-top: 0.5rem;
    overflow: visible;
    z-index: 1001;
    max-height: 80vh;
    overflow-y: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    color: var(--dark);
    text-decoration: none;
    transition: background 0.3s;
    border-bottom: 1px solid #e5e7eb;
    font-size: 0.9rem;
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #f3f4f6;
}

.dropdown-item i {
    color: var(--primary-color);
    font-size: 0.875rem;
    width: 1rem;
    text-align: center;
}

.dropdown-header {
    padding: 0.4rem 1rem 0.3rem 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #6b7280;
    letter-spacing: 0.05em;
    background: #f9fafb;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.dropdown-header i {
    color: var(--primary-color);
    font-size: 0.75rem;
}

.dropdown-divider {
    height: 1px;
    background: #e5e7eb;
    margin: 0.25rem 0;
}

/* Submenu styles */
.dropdown-submenu {
    position: relative;
}

.dropdown-submenu > .dropdown-item {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submenu-arrow {
    font-size: 0.75rem;
    margin-left: auto;
    transition: transform 0.3s;
    opacity: 0.6;
}

.dropdown-submenu:hover .submenu-arrow {
    transform: translateX(3px);
    opacity: 1;
}

.dropdown-submenu-content {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    left: calc(100% + 0.3rem);
    top: 0;
    background: white;
    min-width: 180px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    border-radius: 8px;
    overflow: hidden;
    z-index: 1003;
    transition: opacity 0.2s, visibility 0.2s;
    pointer-events: none;
}

.dropdown-submenu:hover .dropdown-submenu-content {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
}

.dropdown-submenu-content:hover {
    visibility: visible;
    opacity: 1;
    pointer-events: all;
}

.dropdown-submenu-content .dropdown-item {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    border-bottom: 1px solid #f3f4f6;
}

.dropdown-submenu-content .dropdown-item:last-child {
    border-bottom: none;
}

/* Hero Section */
.hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--white);
    padding: 4rem 0;
    text-align: center;
}

.hero-content h2 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.hero-content p {
    font-size: 1.25rem;
    margin-bottom: 2rem;
    opacity: 0.9;
}

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

.stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
}

.stat-label {
    font-size: 1rem;
    opacity: 0.8;
}

/* Services Section */
.services {
    padding: 4rem 0;
    background: var(--white);
}

.section-title {
    font-size: 2.5rem;
    text-align: center;
    margin-bottom: 1rem;
    color: var(--dark);
}

.section-subtitle {
    text-align: center;
    font-size: 1.1rem;
    color: #6b7280;
    margin-bottom: 3rem;
}

.services-grid {
    display: grid;
    gap: 3rem;
}

.service-category h3 {
    font-size: 1.75rem;
    margin-bottom: 1.5rem;
    color: var(--primary-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.service-card {
    background: var(--white);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s, box-shadow 0.3s;
    border-left: 4px solid var(--primary-color);
    margin-bottom: 1.5rem;
}

.service-card.critical {
    border-left-color: var(--danger-color);
    background: linear-gradient(to right, #fef2f2, var(--white));
}

.service-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

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

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

.service-card.critical .service-header i {
    color: var(--danger-color);
}

.service-header h4 {
    font-size: 1.5rem;
    flex: 1;
}

.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
}

.badge-critical {
    background: var(--danger-color);
    color: var(--white);
}

.badge-gpu {
    background: var(--primary-color);
    color: var(--white);
}

.badge-oauth {
    background: var(--warning-color);
    color: var(--white);
}

.badge-ai {
    background: linear-gradient(135deg, #8b5cf6, #ec4899);
    color: var(--white);
}

.service-desc {
    color: #6b7280;
    margin-bottom: 1rem;
    line-height: 1.6;
}

.service-details {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.detail {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--light);
    border-radius: 8px;
    font-size: 0.9rem;
}

.detail i {
    color: var(--primary-color);
}

.service-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
}

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

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--light);
    color: var(--dark);
}

.btn-secondary:hover {
    background: #e5e7eb;
}

.btn-refresh {
    background: var(--success-color);
    color: var(--white);
}

/* Docs Section */
.docs {
    padding: 4rem 0;
    background: var(--light);
}

.docs-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.doc-card {
    background: var(--white);
    padding: 2rem;
    border-radius: 12px;
    text-align: center;
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

.doc-card:hover {
    transform: translateY(-4px);
}

.doc-card i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.doc-card h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
}

.doc-card p {
    color: #6b7280;
    margin-bottom: 1rem;
}

/* Status Section */
.status {
    padding: 4rem 0;
    background: var(--white);
}

.status-container {
    background: var(--light);
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
}

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

.status-content {
    background: var(--white);
    border-radius: 8px;
    padding: 2rem;
}

.loading {
    text-align: center;
    padding: 3rem;
}

.loading i {
    font-size: 3rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
}

.status-grid {
    display: grid;
    gap: 1rem;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: var(--light);
    border-radius: 8px;
    border-left: 4px solid var(--success-color);
}

.status-item.offline {
    border-left-color: var(--danger-color);
}

.status-item.loading {
    border-left-color: var(--warning-color);
}

.status-info h4 {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
}

.status-info p {
    font-size: 0.9rem;
    color: #6b7280;
}

.status-badge {
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-weight: 600;
    font-size: 0.9rem;
}

.status-badge.online {
    background: #d1fae5;
    color: #065f46;
}

.status-badge.offline {
    background: #fee2e2;
    color: #991b1b;
}

.status-badge.loading {
    background: #fef3c7;
    color: #92400e;
}

/* Footer */
.footer {
    background: var(--dark);
    color: var(--white);
    padding: 3rem 0 1rem;
}

.footer-content {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.footer-section h4 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.footer-section a {
    display: block;
    color: #d1d5db;
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s;
}

.footer-section a:hover {
    color: var(--white);
}

.footer-section p {
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

/* Responsive */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
    }
    
    .nav {
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .hero-content h2 {
        font-size: 2rem;
    }
    
    .hero-stats {
        flex-direction: column;
        gap: 2rem;
    }
    
    .service-links {
        flex-direction: column;
    }
    
    .btn {
        width: 100%;
        justify-content: center;
    }
}

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

.service-card,
.doc-card {
    animation: fadeIn 0.6s ease-out;
}
