:root {
    --primary-color: #3498db;
    --secondary-color: #2c3e50;
    --bg-color: #ededed; /* Darkened from #f8f9fa */
    --card-bg: #f7f7f7;   /* Darkened from #ffffff */
    --text-color: #333;
    --sidebar-width: 260px;
    --header-height: 70px;
    --border-color: #dcdcdc; /* Darkened from #e9ecef */
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.07);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    overflow-x: hidden;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-color: var(--card-bg);
}

.container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styling */
.sidebar {
    width: var(--sidebar-width);
    background-color: var(--card-bg);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
}

.logo {
    height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 0 30px;
    border-bottom: 1px solid var(--border-color);
}

.logo h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--secondary-color);
    letter-spacing: -1px;
}

.side-nav {
    padding: 20px 0;
}

.side-nav ul {
    list-style: none;
}

.side-.nav-divider {
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    color: #aaa;
    margin: 25px 0 10px 0;
    padding: 15px 0 5px 25px;
    letter-spacing: 1.5px;
    border-top: 1px solid #f0f0f0;
    position: relative;
}
.nav-divider::after {
    content: '';
    position: absolute;
    top: 0;
    left: 25px;
    right: 25px;
    height: 1px;
    background: #f0f0f0;
}
.side-nav ul li a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 25px;
    color: #666;
    text-decoration: none;
    font-weight: 600;
    transition: var(--transition);
    border-radius: 0 50px 50px 0;
    margin-right: 20px;
}

.side-nav li a i {
    margin-right: 15px;
    font-size: 1.1rem;
    width: 20px;
}

.side-nav li a:hover {
    background-color: #f0f4f8;
    color: var(--primary-color);
    padding-left: 35px;
}

/* Main Wrapper */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* Top Header */
.top-header {
    height: var(--header-height);
    background-color: var(--card-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 40px;
    position: sticky;
    top: 0;
    z-index: 90;
}

#toggle-sidebar {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #888;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.status-badge {
    font-size: 0.8rem;
    font-weight: 600;
    color: #888;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background-color: #2ecc71;
    position: relative;
    display: inline-block;
}

.status-dot.online {
    background-color: #2ecc71;
}

.status-dot.online::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: inherit;
    animation: pulse 2s infinite;
    opacity: 0.4;
}

.status-dot.offline {
    background-color: #e74c3c;
}

@keyframes pulse {
    0% { transform: translate(-50%, -50%) scale(1); opacity: 0.5; }
    100% { transform: translate(-50%, -50%) scale(3); opacity: 0; }
}

.status-label {
    opacity: 0.6;
}

.status-text {
    color: var(--secondary-color);
    font-weight: 700;
}

.user-greeting {
    font-size: 0.9rem;
    color: #666;
}

.logout-style {
    background: linear-gradient(45deg, #e74c3c, #c0392b) !important;
}

.nav-divider {
    padding: 20px 30px 10px 30px;
    font-size: 0.75rem;
    font-weight: 800;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.signup-btn {
    position: relative;
    padding: 12px 25px;
    border: none;
    border-radius: 10px;
    color: white;
    font-weight: 700;
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(45deg, #1a1a1a, #444);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    transition: transform 0.2s;
}

.signup-btn:active {
    transform: scale(0.95);
}

.signup-btn canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.signup-btn span {
    position: relative;
    z-index: 1;
}

/* Content Area */
.content {
    padding: 40px;
    max-width: 1400px;
    margin: 0 auto;
    width: 100%;
}

/* Ad Grid */
.ad-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.ad-box {
    height: 90px; /* Increased from 80px */
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(5px);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    transition: var(--transition);
}

.ad-box img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Changed from cover to prevent cut-off */
    display: block;
}

.ad-box.placeholder {
    font-size: 0.8rem;
    color: #aaa;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.ad-box:hover {
    border-color: var(--primary-color);
    transform: scale(1.02);
}

/* API Section Styling */
.api-section {
    margin-top: 20px;
}

.api-grid {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.api-card {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 20px;
    transition: var(--transition);
}

.api-card:hover {
    border-color: var(--primary-color);
    transform: translateX(5px);
}

.api-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.api-icon {
    width: 50px;
    height: 50px;
    background-color: #f0f7ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    font-size: 1.3rem;
    flex-shrink: 0;
}

.api-details h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 5px;
}

.api-details p {
    color: #666;
    font-size: 0.95rem;
}

.api-endpoint {
    background-color: #fafbfd;
    border: 1px solid var(--border-color);
    padding: 15px 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow: hidden;
}

.method {
    background-color: #e3f2fd;
    color: var(--primary-color);
    font-size: 0.75rem;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 4px;
    flex-shrink: 0;
}

.endpoint-url {
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    color: #555;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.copy-btn {
    background: none;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 1rem;
    transition: var(--transition);
    padding: 5px;
}

.copy-btn:hover {
    color: var(--primary-color);
    transform: scale(1.1);
}

.copy-btn.copied {
    color: #2ecc71;
}

.page-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--secondary-color);
    margin-left: 20px;
}

.side-nav li a.active {
    background-color: #f0f4f8;
    color: var(--primary-color);
    border-left: 4px solid var(--primary-color);
}


/* Info Grid */
.info-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
    margin-bottom: 40px;
}

.info-card {
    background-color: var(--card-bg);
    padding: 25px;
    border-radius: 16px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    border: 1px solid transparent;
    transition: var(--transition);
}

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

.info-icon {
    width: 60px;
    height: 60px;
    background-color: #f0f7ff;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 20px;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.info-content h3 {
    font-size: 0.85rem;
    color: #888;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.info-content p {
    font-size: 1.25rem;
    font-weight: 700;
}

/* News Section */
.news-container {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 35px;
    box-shadow: var(--shadow);
    margin-bottom: 40px;
}

.news-header {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border-color);
}

.news-header h2 {
    font-size: 1.2rem;
    color: var(--secondary-color);
    display: flex;
    align-items: center;
    gap: 10px;
}

.news-list {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.news-item {
    display: flex;
    gap: 25px;
    padding: 20px;
    border-radius: 12px;
    background-color: #fafbfd;
    transition: var(--transition);
}

.news-item:hover {
    background-color: #f1f4f9;
}

.news-icon {
    width: 50px;
    height: 50px;
    background-color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-color);
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    flex-shrink: 0;
}

.news-content {
    flex: 1;
}

.news-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 8px;
}

.news-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 12px;
}

.news-date {
    font-size: 0.8rem;
    color: #bbb;
}

/* Footer */
.main-footer {
    padding: 20px 40px;
    background-color: var(--card-bg);
    border-top: 1px solid var(--border-color);
    margin-top: auto;
}

.footer-right {
    text-align: right;
    font-size: 0.9rem;
    color: #888;
    font-weight: 600;
}

/* Responsiveness */
@media (max-width: 1024px) {
    .info-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .ad-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .main-wrapper {
        margin-left: 0 !important;
    }
    .info-grid, .ad-grid {
        grid-template-columns: 1fr;
    }
    .top-header {
        padding: 0 20px;
    }
}
