/* =========================================
   VARIABLES
   ========================================= */
:root {
    --bg-body: #121216;
    --bg-body-grad: radial-gradient(circle at 50% 0%, #1a1a24 0%, #121216 100%);
    --bg-box: #1c1c24;
    --bg-box-hover: #23232e;
    --border-color: #333;
    --border-light: #3d3d4f;
    --text-main: #eee;
    --text-muted: #a0a0b0;
    --accent: #4fc3f7;
    --accent-hover: #81d4fa;
    --success: #00e676;
    --danger: #ff5252;
    --font-main: 'Signika Negative', sans-serif;
}

/* =========================================
   GLOBALS
   ========================================= */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    font-family: var(--font-main);
    background: var(--bg-body-grad);
    color: var(--text-main);
    min-height: 100vh;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-body);
}

::-webkit-scrollbar-thumb {
    background-color: #444;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background-color: #555;
}

/* =========================================
   LAYOUT
   ========================================= */
.hub-layout {
    padding: 40px 20px;
    display: block;
}

.hub-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1300px;
    margin: 0 auto 20px auto;
    padding: 0 10px;
}

.dashboard-container {
    display: grid;
    grid-template-columns: 300px minmax(400px, 600px) 300px;
    gap: 30px;
    max-width: 1300px;
    margin: 0 auto;
    align-items: start;
    justify-content: center;
}

.side-panel {
    background: #1c1c24;
    padding: 1.5rem;
    border-radius: 8px;
    border: 1px solid #333;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

/* =========================================
   KOMPONENTY (COMPONENTS)
   ========================================= */
.box {
    background: var(--bg-box);
    padding: 2.5rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6);
}

.panel-title {
    font-size: 16px;
    color: var(--accent);
    text-transform: uppercase;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 10px;
    margin-top: 0;
    margin-bottom: 15px;
    letter-spacing: 1px;
}

/* BUTTONS */
.btn {
    padding: 12px 25px;
    border-radius: 6px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    text-align: center;
    display: inline-block;
}

.btn-primary {
    background: var(--accent);
    color: #121216;
}

.btn-primary:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.btn-secondary {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
}

.btn-secondary:hover {
    background: var(--bg-box-hover);
    color: #fff;
    border-color: var(--text-muted);
}

.btn-refresh {
    top: 1.2rem;
    left: 2.5rem;
    background: transparent;
    border: 1px solid #444;
    color: #888;
    padding: 4px 10px 4px 10px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 0.80rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-refresh:hover {
    border-color: #4fc3f7;
    color: #4fc3f7;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #888;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover {
    color: var(--accent);
}

.nav-link:active {
    transform: scale(0.98);
}

/* PROJECT LIST */
.projects-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 25px;
}

.project-actions {
    display: flex;
    align-items: center;
    gap: 15px;
}

.project-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.project-card-link:focus-visible {
    outline: none;
}

.project-card-link:hover .project-item,
.project-card-link:focus-visible .project-item {
    background: #2a2a38;
    border-color: #4fc3f7;
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(79, 195, 247, 0.15), 0 4px 8px rgba(0, 0, 0, 0.4);
}

.project-card-link:hover .project-name {
    color: #fff;
}

.project-card-link:hover .project-arrow,
.project-card-link:focus-visible .project-arrow {
    color: #4fc3f7;
    transform: translateX(6px) scale(1.1);
}

.project-item {
    background: #23232e;
    padding: 18px 20px;
    border-radius: 8px;
    border: 1px solid #3d3d4f;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    text-align: left;
}

.project-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.project-name {
    font-size: 18px;
    font-weight: 600;
    color: #e0e0e0;
    transition: color 0.2s ease;
}

.project-desc {
    margin: 0;
    font-size: 0.85rem;
    color: #a0a0b0;
    line-height: 1.3;
    max-width: 380px;
}

.project-arrow {
    color: #666;
    font-size: 16px;
    transition: transform 0.25s ease, color 0.25s ease;
}

/* STATUS BADGES */

.status-badge {
    font-size: 0.9rem;
    padding: 2px 6px;
    border-radius: 4px;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.status-badge.stable {
    background: rgba(76, 175, 80, 0.15);
    color: #81c784;
    border: 1px solid rgba(76, 175, 80, 0.3);
}

.status-badge.dev {
    background: rgba(255, 152, 0, 0.15);
    color: #ffb74d;
    border: 1px solid rgba(255, 152, 0, 0.3);
}

.status-badge.archived {
    background: rgba(158, 158, 158, 0.15);
    color: #e0e0e0;
    border: 1px solid rgba(158, 158, 158, 0.3);
}

/* SERVER INFO & SERVICES */
.server-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

.server-ip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: #a0a0b0;
    background: rgba(255, 255, 255, 0.04);
    padding: 5px 10px;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 4px;
    user-select: none;
}

.server-ip:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    border-color: rgba(79, 195, 247, 0.4);
    transform: translateY(-1px);
}

.server-ip:active {
    transform: translateY(0);
}

.server-ip.copied {
    background: rgba(76, 193, 100, 0.15);
    color: #4c1;
    border-color: rgba(76, 193, 100, 0.3);
}

a.server-ip {
    text-decoration: none;
    color: var(--text-muted, #a0a0b0);
}

a.server-ip:hover {
    color: #ffffff;
}

.service-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #23232e;
    padding: 10px 15px;
    margin-bottom: 8px;
    border-radius: 4px;
    border: 1px solid #2a2a36;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    text-decoration: none;
    color: inherit;
}

.service-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.service-name {
    font-weight: 600;
    font-size: 14px;
    color: #ddd;
}

.service-status {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    box-shadow: 0 0 8px currentColor;
}

.service-status.up {
    color: #00e676;
    background: #00e676;
}

.service-status.down {
    color: #ff5252;
    background: #ff5252;
}

.service-status.pending {
    color: #ffb74d;
    background: #ffb74d;
}

/* FORMS */
.form-control {
    width: 100%;
    padding: 8px 12px;
    background: #282835;
    border: 1px solid var(--border-light);
    color: var(--text-main);
    border-radius: 6px;
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(79, 195, 247, 0.15);
}

textarea.form-control {
    resize: vertical;
    min-height: 44px;
}

.ips-wrapper .empty-state-text {
    font-size: 12px;
    margin-top: 4px;
}

/* =========================================
   AUTHORIZATION MODULE
   ========================================= */
.global-auth-btn {
    position: fixed;
    bottom: 30px;
    left: 30px;
    z-index: 9000;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    background: rgba(28, 28, 36, 0.75);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    color: var(--text-muted, #a0a0b0);
    border: 1px solid rgba(255, 255, 255, 0.08);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.global-auth-btn:hover {
    background: rgba(35, 35, 46, 0.95);
    color: var(--text-main, #eee);
    border-color: var(--accent, #4fc3f7);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 195, 247, 0.25);
}

.global-auth-btn.logged-in {
    color: var(--success, #00e676);
    border-color: rgba(0, 230, 118, 0.2);
}

.global-auth-btn.logged-in:hover {
    border-color: var(--success, #00e676);
    box-shadow: 0 6px 20px rgba(0, 230, 118, 0.25);
}

.global-auth-btn svg {
    transition: transform 0.3s ease;
}

.global-auth-btn:hover svg {
    transform: scale(1.1);
}

.auth-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(18, 18, 24, 0.85);
    backdrop-filter: blur(4px);
    z-index: 9999;
    display: flex;
    visibility: hidden;
    pointer-events: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-modal-overlay.active {
    visibility: visible;
    pointer-events: auto;
    opacity: 1;
}

.auth-modal-box {
    background: var(--bg-card, #2b2b36);
    border: 1px solid var(--border-light, #3a3a46);
    border-radius: 12px;
    padding: 30px;
    width: 90%;
    max-width: 350px;
    position: relative;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    transform: scale(0.92) translateY(-10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.auth-modal-overlay.active .auth-modal-box {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.auth-modal-close {
    position: absolute;
    top: 15px;
    right: 20px;
    background: none;
    border: none;
    color: var(--text-muted, #a0a0b0);
    font-size: 24px;
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-modal-close:hover {
    color: #ff5252;
}

/* =========================================
   UTILITY & MODAL CLASSES
   ========================================= */
.text-center {
    text-align: center;
}

.flex-center {
    justify-content: center;
    display: flex;
}

.m-0 {
    margin: 0;
}

.mt-0 {
    margin-top: 0;
}

.mb-0 {
    margin-bottom: 0;
}

.w-100 {
    width: 100%;
}

.auth-modal-title {
    margin-top: 0;
}

.auth-modal-input {
    margin-bottom: 15px;
}

.auth-logged-in-status {
    background: rgba(0, 230, 118, 0.1);
    border: 1px solid #00e676;
    color: #00e676;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    margin-bottom: 15px;
}

.auth-logged-in-status span {
    font-weight: bold;
}

.error-code {
    color: #ff5252;
    border: none;
    margin-bottom: 0;
}

.error-desc {
    color: #a0a0b0;
    margin-bottom: 25px;
}

/* =========================================
   MEDIA QUERIES
   ========================================= */
@media (max-width: 1250px) {
    .dashboard-container {
        grid-template-columns: 250px 1fr 250px;
        gap: 20px;
    }
}

@media (max-width: 950px) {
    .dashboard-container {
        grid-template-columns: 1fr;
        max-width: 600px;
    }
}
