/* static/css/index.css */
:root {
    --primary-color: #1e88e5;
    --primary-dark: #1565c0;
    --success: #4CAF50;
    --error: #F44336;
    --white: #fff;
    --light-bg: #f8f9fa;
    --light-border: #eaeaea;
    --text: #333;
    --text-light: #666;
    --text-lighter: #aaa;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header Styles */
.header {
    background: linear-gradient(120deg, var(--primary-color), var(--primary-dark));
    color: var(--white);
    padding: 30px 0;
    text-align: center;
    width: 100%;
}

h1 {
    font-size: 2.2rem;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    margin-bottom: 20px;
}

.stats {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.stat-box {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 8px;
    padding: 15px 20px;
    text-align: center;
    min-width: 120px;
}

.stat-number {
    font-size: 1.8rem;
    font-weight: bold;
    margin-bottom: 5px;
}

/* Main Content Styles */
.api-container {
    padding: 30px 5%;
    width: 100%;
    flex: 1;
}

.filter-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    background: #f1f3f5;
    padding: 15px 20px;
    border-radius: 8px;
    flex-wrap: wrap;
    gap: 15px;
}

.search-box {
    display: flex;
    align-items: center;
    background: var(--white);
    border-radius: 4px;
    padding: 8px 15px;
    flex: 1;
    min-width: 250px;
    max-width: 400px;
    border: 1px solid #ddd;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.search-box input {
    border: none;
    padding: 8px;
    width: 100%;
    outline: none;
    font-size: 0.95rem;
}

.filter-options {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.filter-btn {
    background: var(--white);
    border: 1px solid #ddd;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: all 0.2s;
}

.filter-btn:hover, .filter-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
    width: 100%;
}

.api-grid > .error-message {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.api-card {
    background: var(--white);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--light-border);
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.05);
}

.api-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.api-header {
    padding: 18px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
}

.api-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    margin-right: 12px;
    flex-shrink: 0;
}

.status-normal { background-color: var(--success); }
.status-error { background-color: var(--error); }

.api-name {
    font-weight: 600;
    font-size: 1.1rem;
}

.api-body { padding: 20px; }

.api-desc {
    color: var(--text-light);
    margin-bottom: 15px;
    font-size: 0.95rem;
    line-height: 1.5;
}

.api-footer {
    padding: 15px 20px;
    background: var(--light-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.api-link {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.api-link:hover { text-decoration: underline; }

/* Footer Styles */
footer {
    background: #343a40;
    color: var(--white);
    padding: 30px 5%;
    text-align: center;
    width: 100%;
    margin-top: auto;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 25px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.footer-links a {
    color: #ddd;
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover { color: var(--white); }

.copyright {
    margin-top: 15px;
    color: var(--text-lighter);
    font-size: 0.9rem;
}

/* Loading Styles */
.loading {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 20px;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid rgba(30, 136, 229, 0.2);
    border-top: 5px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-text {
    font-size: 1.2rem;
    color: var(--text-light);
    text-align: center;
}

.error-message {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 300px;
    gap: 15px;
    color: var(--error);
    font-size: 1.2rem;
    text-align: center;
}

.error-message .iconify {
    font-size: 3rem;
}

/* Animations */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Icon adjustments */
.search-box .iconify {
    font-size: 1.1rem;
    margin-right: 8px;
    color: #666;
}

.footer-links .iconify {
    font-size: 1rem;
    margin-right: 5px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header { padding: 25px 5%; }
    h1 { font-size: 1.8rem; }
    .stats { gap: 15px; }
    .stat-box { padding: 12px 15px; min-width: 100px; }
    .stat-number { font-size: 1.5rem; }
    .api-container { padding: 20px 4%; }
    .filter-bar { flex-direction: column; align-items: stretch; }
    .search-box { max-width: 100%; }
    .filter-options { justify-content: center; }
    .api-grid { grid-template-columns: 1fr; }
}