:root {
    --bg-core: #030305;
    --glass: rgba(15, 15, 20, 0.4);
    --glass-hover: rgba(25, 25, 35, 0.6);
    --glass-border: rgba(255, 255, 255, 0.05);
    --primary: #00f2fe;
    --secondary: #4facfe;
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.5);
    --status-active: #00e676;
    --status-maintenance: #ffea00;
    --status-key: #d500f9;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: var(--bg-core);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

#bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    pointer-events: none;
}

.main-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.hero-header {
    text-align: center;
    padding: 50px 0 30px 0;
    animation: fadeInDown 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.main-title {
    font-size: 3.5rem;
    font-weight: 900;
    letter-spacing: 4px;
    margin-bottom: 30px;
    background: linear-gradient(to right, #ffffff 0%, var(--primary) 50%, #ffffff 100%);
    background-size: 200% auto;
    -webkit-background-clip: text;
    color: transparent;
    animation: shineTextGlow 4s linear infinite;
    text-shadow: 0 0 30px rgba(0, 242, 254, 0.3);
}

@keyframes shineTextGlow {
    0% { background-position: 0% center; }
    100% { background-position: 200% center; }
}

.stats-board {
    display: flex;
    justify-content: center;
    gap: 20px;
    flex-wrap: wrap;
    margin-bottom: 40px;
}

.stat-item {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 20px 30px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: inset 0 0 20px rgba(255, 255, 255, 0.02);
}

.stat-item:hover {
    transform: translateY(-5px) scale(1.02);
    background: var(--glass-hover);
    border-color: rgba(0, 242, 254, 0.2);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(0, 242, 254, 0.05);
}

.stat-label {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-main);
}

#runtime-display {
    background: linear-gradient(90deg, #ff007f, #7928ca, #00f2fe);
    background-size: 200% auto;
    -webkit-background-clip: text;
    color: transparent;
    animation: shineTextGlow 3s linear infinite;
    text-shadow: 0 0 15px rgba(121, 40, 202, 0.4);
}

.search-box {
    max-width: 600px;
    margin: 0 auto 20px auto;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 16px 25px;
    border-radius: 30px;
    border: 1px solid var(--glass-border);
    background: rgba(10, 10, 15, 0.6);
    color: var(--text-main);
    font-size: 1.05rem;
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    outline: none;
    transition: all 0.4s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.search-box input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 25px rgba(0, 242, 254, 0.15), inset 0 0 10px rgba(0, 242, 254, 0.05);
    background: rgba(15, 15, 20, 0.8);
}

.search-feedback {
    text-align: center;
    color: var(--primary);
    font-size: 0.9rem;
    height: 20px;
    margin-bottom: 20px;
    opacity: 0.8;
}

.api-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
    padding-bottom: 50px;
    position: relative;
}

.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
    font-size: 1.2rem;
    animation: fadeInUp 0.4s ease;
}

.api-card {
    background: var(--glass);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 25px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeInUp 0.6s backwards;
    display: flex;
    flex-direction: column;
}

.api-card::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(0,242,254,0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.5s;
    pointer-events: none;
}

.api-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 242, 254, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 0 0 20px rgba(0, 242, 254, 0.1);
}

.api-card:hover::after {
    opacity: 1;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    z-index: 1;
}

.api-title {
    font-size: 1.25rem;
    font-weight: 700;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 20px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid var(--glass-border);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-active .status-dot { background: var(--status-active); box-shadow: 0 0 10px var(--status-active); animation: pulseDot 2s infinite; }
.status-maintenance .status-dot { background: var(--status-maintenance); }
.status-key .status-dot { background: var(--status-key); }

.api-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 25px;
    line-height: 1.6;
    height: 45px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    z-index: 1;
}

.api-stats {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: var(--text-muted);
    background: rgba(0, 0, 0, 0.2);
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    z-index: 1;
}

.api-stats span strong {
    color: var(--text-main);
}

.detail-btn {
    width: 100%;
    padding: 12px;
    background: transparent;
    border: 1px solid var(--primary);
    color: var(--primary);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
    z-index: 1;
    position: relative;
    overflow: hidden;
    margin-top: auto;
}

.detail-btn:hover {
    background: var(--primary);
    color: #000;
    box-shadow: 0 0 20px rgba(0, 242, 254, 0.4);
}

.click-ripple {
    position: fixed;
    border-radius: 50%;
    border: 2px solid var(--primary);
    pointer-events: none;
    transform: translate(-50%, -50%);
    animation: rippleAnim 0.6s cubic-bezier(0.1, 0.8, 0.3, 1) forwards;
    z-index: 9999;
}

@keyframes rippleAnim {
    0% { width: 0; height: 0; opacity: 1; }
    100% { width: 120px; height: 120px; opacity: 0; border-width: 0px; }
}

@keyframes pulseDot {
    0% { opacity: 1; }
    50% { opacity: 0.3; }
    100% { opacity: 1; }
}

@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-30px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.footer-area { 
    text-align: center; 
    padding: 30px 0; 
    margin-top: auto; 
    z-index: 1; 
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    border-top: 1px solid var(--glass-border);
    background: linear-gradient(0deg, rgba(0,0,0,0.8) 0%, transparent 100%);
}

.rainbow-text {
    font-size: 13px; 
    font-weight: 800; 
    letter-spacing: 2px;
    background-image: linear-gradient(90deg, #00f2fe, #4facfe, #d500f9, #00f2fe);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    color: transparent;
    animation: shineTextGlow 4s infinite linear;
    display: inline-block;
    margin-bottom: 15px;
    text-transform: uppercase;
}

.footer-contacts { 
    display: flex; 
    flex-direction: row; 
    justify-content: center; 
    align-items: center;
    gap: 25px; 
    font-size: 0.85rem; 
    color: var(--text-muted); 
    flex-wrap: wrap; 
    width: 100%;
}

.footer-contacts span { 
    display: flex; 
    align-items: center; 
    gap: 6px; 
    transition: color 0.3s;
}

.footer-contacts span:hover {
    color: var(--primary);
}

.footer-contacts i { 
    color: var(--primary); 
    font-size: 1.1rem;
}

.custom-modal-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}

.custom-modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal-content {
    background: #0f0f14;
    border: 1px solid rgba(0, 242, 254, 0.3);
    border-radius: 16px;
    padding: 35px;
    max-width: 420px;
    width: 90%;
    text-align: center;
    transform: scale(0.8) translateY(20px);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 20px 50px rgba(0,0,0,0.8), inset 0 0 20px rgba(0, 242, 254, 0.05);
}

.custom-modal-overlay.active .custom-modal-content {
    transform: scale(1) translateY(0);
}

.custom-modal-content p {
    margin-bottom: 25px;
    font-size: 1.1rem;
    line-height: 1.6;
    color: #fff;
}

.custom-modal-content button {
    padding: 12px 40px;
    border-radius: 8px;
    border: none;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: #000;
    font-weight: 800;
    cursor: pointer;
    transition: filter 0.3s, transform 0.2s;
    font-size: 1rem;
}

.custom-modal-content button:hover {
    filter: brightness(1.2);
    transform: scale(1.05);
}

@media (max-width: 768px) {
    .main-title { font-size: 2.5rem; }
    .stats-board { gap: 15px; }
    .stat-item { padding: 15px; flex: 1 1 calc(50% - 15px); text-align: center; }
    .footer-contacts { flex-direction: column; gap: 12px; }
    .api-grid { grid-template-columns: 1fr; }
}
