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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #000000;
    color: #ffffff;
    line-height: 1.6;
    min-height: 100vh;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
.header {
    padding: 20px 0;
    border-bottom: 1px solid #333333;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.logo {
    height: 40px;
    margin-bottom: 0;
    margin-top: -27px;
    border-radius: 8px;
}

.brand {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
}

.nav-links {
    display: flex;
    gap: 24px;
    margin-top: 12px;
}

.nav-link {
    color: #999999;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
    color: #ffffff;
}

.title {
    font-family: 'Inter', monospace;
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: -5px;
    letter-spacing: -0.02em;
}

.accent {
    color: #ffffff;
    background: linear-gradient(135deg, #666666 0%, #ffffff 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 0.9rem;
    color: #999999;
    font-weight: 400;
}

/* User menu */
.user-menu {
    position: relative;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 8px;
    transition: background 0.2s ease;
}

.user-info:hover {
    background: #111111;
}

.user-avatar, .user-avatar-placeholder {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.user-avatar-placeholder {
    background: #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
}

.username {
    color: #ffffff;
    font-weight: 500;
}

.user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: #111111;
    border: 1px solid #333333;
    border-radius: 8px;
    margin-top: 8px;
    min-width: 150px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.2s ease;
    z-index: 100;
}

.user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: #ffffff;
    text-decoration: none;
    transition: background 0.2s ease;
}

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

.dropdown-item:first-child {
    border-radius: 8px 8px 0 0;
}

.dropdown-item:last-child {
    border-radius: 0 0 8px 8px;
}

/* Discord button */
.btn-discord {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: #5865F2;
    color: #ffffff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.btn-discord:hover {
    background: #4752C4;
    transform: translateY(-2px);
}

/* Hero section */
.hero-section {
    padding: 80px 0 40px;
    text-align: center;
}

.hero-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 16px;
    line-height: 1.2;
}

.hero-description {
    font-size: 1.1rem;
    color: #999999;
    max-width: 600px;
    margin: 0 auto;
}

.main {
    flex: 1;
    padding-bottom: 60px;
}

.search-container {
    max-width: 600px;
    margin: 0 auto 60px;
}

.search-box {
    display: flex;
    background: #111111;
    border: 1px solid #333333;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
}

.search-box:focus-within {
    border-color: #555555;
    box-shadow: 0 4px 20px -4px rgba(255, 255, 255, 0.1);
}

#searchInput {
    flex: 1;
    padding: 18px 24px;
    background: transparent;
    border: none;
    color: #ffffff;
    font-size: 1rem;
    font-family: inherit;
    outline: none;
}

#searchInput::placeholder {
    color: #666666;
}

#searchInput:focus::placeholder {
    color: #444444;
}

.search-btn {
    padding: 18px 20px;
    background: transparent;
    border: none;
    color: #999999;
    cursor: pointer;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.search-btn:hover {
    color: #ffffff;
}

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

.search-info {
    text-align: center;
    margin-top: 16px;
    color: #666666;
    font-size: 0.9rem;
}

.results {
    max-width: 1000px;
    margin: 0 auto;
}

.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 2px solid #333333;
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    animation: fadeIn 0.5s ease;
}

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

.api-card {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 16px;
    padding: 24px;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.api-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #666666, #ffffff);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.api-card:hover {
    border-color: #555555;
    transform: translateY(-4px);
    box-shadow: 0 12px 24px -8px rgba(255, 255, 255, 0.1);
}

.api-card:hover::before {
    transform: scaleX(1);
}

.api-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.api-card-title-section {
    display: flex;
    align-items: center;
    gap: 12px;
}

.api-card-icon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #333333, #555555);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
}

.api-card-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
}

.api-name {
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
    color: #ffffff;
}

.api-category {
    display: inline-block;
    background: #222222;
    color: #999999;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
    border: 1px solid #333333;
    margin: 0;
}

.api-description {
    color: #999999;
    font-size: 0.9rem;
    line-height: 1.5;
    margin: 0;
}

.api-endpoints {
    background: #1a1a1a;
    border-radius: 12px;
    padding: 16px;
    border: 1px solid #2a2a2a;
}

.api-endpoints h4 {
    font-size: 0.8rem;
    color: #666666;
    margin: 0 0 12px 0;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.api-endpoints ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.api-endpoints li {
    margin: 0;
}

.api-endpoints code {
    background: #333333;
    padding: 6px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    color: #ffffff;
    border: 1px solid #444444;
    font-family: 'Courier New', monospace;
}

.api-actions {
    margin-top: auto;
    display: flex;
    justify-content: flex-end;
}

.btn-docs {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: #333333;
    color: #ffffff;
    border: none;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-docs:hover {
    background: #555555;
    transform: translateY(-1px);
}

.btn-copy-example {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    background: #333333;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
    margin-top: 8px;
}

.btn-copy-example:hover {
    background: #555555;
}

.examples-modal {
    max-width: 500px;
    max-height: 400px;
    overflow-y: auto;
}

.examples-modal h4 {
    color: #ffffff;
    margin-bottom: 16px;
    font-size: 1rem;
}

.example-item {
    margin-bottom: 16px;
    padding: 12px;
    background: #222222;
    border-radius: 6px;
}

.example-item h5 {
    color: #ffffff;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.example-item pre {
    margin: 0 0 8px 0;
    background: #333333;
    padding: 8px;
    border-radius: 4px;
    overflow-x: auto;
}

.example-item code {
    color: #ffffff;
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
}

.no-results {
    text-align: center;
    padding: 80px 20px;
    color: #666666;
}

.no-results svg {
    margin-bottom: 24px;
    opacity: 0.3;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 8px;
    font-weight: 600;
}

.no-results p {
    color: #555555;
}

/* Dashboard styles */
.header-dashboard {
    padding: 40px 0;
    border-bottom: 1px solid #333333;
}

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

.user-info {
    display: flex;
    align-items: center;
    gap: 16px;
}

.avatar, .avatar-placeholder {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
}

.avatar-placeholder {
    background: #333333;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.btn-primary, .btn-secondary, .btn-logout {
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.2s ease;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: #ffffff;
    color: #000000;
}

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

.btn-secondary {
    background: #111111;
    color: #ffffff;
    border: 1px solid #333333;
}

.btn-secondary:hover {
    background: #222222;
    border-color: #555555;
}

.btn-logout {
    background: #f44336;
    color: #ffffff;
}

.btn-logout:hover {
    background: #d32f2f;
}

.main-dashboard {
    padding: 40px 0;
}

.stats-section, .keys-section, .apis-section {
    margin-bottom: 60px;
}

.section-title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 24px;
    color: #ffffff;
}

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

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.stat-card {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 24px;
    text-align: center;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: #ffffff;
    margin-bottom: 8px;
}

.stat-label {
    color: #999999;
    font-size: 0.9rem;
}

.keys-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
}

.key-card {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 12px;
    padding: 24px;
    transition: all 0.3s ease;
}

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

.key-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #ffffff;
}

.btn-delete {
    background: #f44336;
    color: #ffffff;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-delete:hover {
    background: #d32f2f;
}

.key-value {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.key-value code {
    flex: 1;
    background: #222222;
    padding: 8px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
    word-break: break-all;
    color: #ffffff;
}

.key-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.btn-copy, .btn-toggle, .btn-regenerate {
    background: #333333;
    color: #ffffff;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: background 0.2s ease;
    white-space: nowrap;
}

.btn-copy:hover, .btn-toggle:hover, .btn-regenerate:hover {
    background: #555555;
}

.key-meta {
    display: flex;
    gap: 16px;
    font-size: 0.8rem;
    color: #666666;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666666;
}

.empty-state svg {
    margin-bottom: 16px;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 8px;
    color: #999999;
}

.apis-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

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

.modal-content {
    background: #111111;
    border: 1px solid #333333;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: #ffffff;
}

.modal-close {
    background: none;
    border: none;
    color: #999999;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 4px;
    line-height: 1;
}

.modal-close:hover {
    color: #ffffff;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #ffffff;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    background: #222222;
    border: 1px solid #333333;
    border-radius: 8px;
    color: #ffffff;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #555555;
}

.form-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

@media (max-width: 768px) {
    .title {
        font-size: 1.5rem;
    }
    
    .hero-title {
        font-size: 2rem;
    }
    
    .header-dashboard .header-content {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .apis-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 24px;
        margin: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .key-value {
        flex-direction: column;
        align-items: stretch;
    }
}

/* Error page styles */
.error-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 0;
}

.error-content {
    text-align: center;
    max-width: 500px;
}

.error-icon {
    margin-bottom: 24px;
    opacity: 0.3;
}

.error-title {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: #ffffff;
}

.error-message {
    color: #999999;
    margin-bottom: 32px;
    line-height: 1.5;
}

.error-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .error-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .error-actions .btn-primary,
    .error-actions .btn-secondary {
        width: 200px;
    }
}
