/* 
    DRIVER PORTAL «ООО ПЕРВЫЙ ПАРК»
    DESIGN SYSTEM: Game UI / Blue-Cyan RP Style
*/

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;600;700;800&family=Outfit:wght@300;400;600;700;900&display=swap');

:root {
    /* Основные цвета компании */
    --brand-primary: #0088ff;       /* Глубокий синий */
    --brand-accent: #00d2ff;        /* Яркий голубой/циан */
    --brand-glow: rgba(0, 210, 255, 0.4);
    
    /* Темный фон в стиле RP */
    --bg-deep: #080a12;             /* Самый темный фон */
    --bg-surface: #121625;          /* Фон карточек */
    --bg-glass: rgba(18, 22, 37, 0.7);
    
    /* Текстовые цвета */
    --text-main: #ffffff;
    --text-muted: #8b9bb4;
    --text-dim: #546076;

    /* Функциональные цвета */
    --success: #00e676;
    --warning: #ffb300;
    --danger: #ff1744;
    --repair: #7c4dff;

    /* Параметры UI */
    --radius-lg: 20px;
    --radius-md: 14px;
    --shadow-glow: 0 0 20px var(--brand-glow);
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    background: var(--bg-deep);
    color: var(--text-main);
    font-family: 'Inter', sans-serif;
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100vh;
    /* Фоновый градиент для глубины */
    background: radial-gradient(circle at 50% 0%, #151b33 0%, #080a12 60%);
}

h1, h2, h3, .brand-font {
    font-family: 'Outfit', sans-serif;
}

/* ─────────────────────────────────────────────
   LAYOUT
   ───────────────────────────────────────────── */

.app-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header & Nav */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 0;
    margin-bottom: 30px;
}

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

.brand-logo {
    width: 45px;
    height: 45px;
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.brand-name {
    font-weight: 900;
    font-size: 1.5rem;
    letter-spacing: -0.5px;
    text-transform: uppercase;
    background: linear-gradient(to right, #fff, var(--brand-accent));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.nav-bar {
    background: var(--bg-glass);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px;
    border-radius: 100px;
    display: flex;
    gap: 5px;
}

.nav-item {
    padding: 10px 20px;
    border-radius: 100px;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-item:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.05);
}

.nav-item.active {
    background: var(--brand-primary);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 136, 255, 0.4);
}

/* ─────────────────────────────────────────────
   HERO / WELCOME
   ───────────────────────────────────────────── */

.hero-card {
    background: linear-gradient(135deg, rgba(0, 136, 255, 0.1), rgba(0, 210, 255, 0.05));
    border: 1px solid rgba(0, 210, 255, 0.2);
    border-radius: var(--radius-lg);
    padding: 40px;
    margin-bottom: 30px;
    position: relative;
    overflow: hidden;
}

.hero-card::after {
    content: "";
    position: absolute;
    top: -50%;
    right: -10%;
    width: 300px;
    height: 300px;
    background: var(--brand-primary);
    filter: blur(120px);
    opacity: 0.2;
    z-index: 0;
}

.hero-content {
    position: relative;
    z-index: 1;
}

.hero-badge {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(0, 210, 255, 0.15);
    color: var(--brand-accent);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    margin-bottom: 12px;
    border: 1px solid rgba(0, 210, 255, 0.3);
}

.hero-title {
    font-size: 2.5rem;
    margin-bottom: 10px;
}

/* ─────────────────────────────────────────────
   WIDGETS & CARDS
   ───────────────────────────────────────────── */

.grid-layout {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.card {
    background: var(--bg-surface);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    padding: 24px;
    transition: var(--transition);
    position: relative;
}

.card:hover {
    border-color: var(--brand-primary);
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.stats-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.stats-value {
    font-size: 2.5rem;
    font-weight: 900;
    color: var(--brand-accent);
    line-height: 1;
}

.stats-label {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    font-weight: 700;
    margin-top: 5px;
}

/* Driver Info */
.driver-profile {
    display: flex;
    align-items: center;
    gap: 20px;
}

.driver-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 3px solid var(--brand-accent);
    padding: 4px;
    box-shadow: var(--shadow-glow);
}

.driver-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.driver-details h2 {
    font-size: 1.4rem;
    margin-bottom: 2px;
}

.driver-rank {
    color: var(--brand-accent);
    font-weight: 700;
    font-size: 0.9rem;
}

/* ─────────────────────────────────────────────
   TABLE STYLING (LDR BRD / USERS)
   ───────────────────────────────────────────── */

.table-container {
    overflow-x: auto;
    background: var(--bg-glass);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: var(--radius-md);
    margin-top: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th {
    text-align: left;
    padding: 16px 24px;
    color: var(--text-dim);
    text-transform: uppercase;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 1px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

td {
    padding: 16px 24px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    font-size: 0.95rem;
}

tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

.rank-badge {
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid rgba(255,255,255,0.1);
}

/* Цвета по рангам */
.rank-tier-mgmt { background: rgba(255, 23, 68, 0.15); color: #ff1744; border-color: rgba(255, 23, 68, 0.3); }
.rank-tier-rs { background: rgba(124, 77, 255, 0.15); color: #7c4dff; border-color: rgba(124, 77, 255, 0.3); }
.rank-tier-staff { background: rgba(0, 210, 255, 0.15); color: #00d2ff; border-color: rgba(0, 210, 255, 0.3); }
.rank-tier-trainee { background: rgba(255, 255, 255, 0.05); color: var(--text-muted); }

.user-identity {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-avatar-small {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(255,255,255,0.03);
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255,255,255,0.08);
    color: var(--brand-accent);
    font-size: 1rem;
}

.punish-box {
    display: flex;
    gap: 6px;
}

.punish-badge {
    padding: 2px 8px;
    border-radius: 5px;
    font-size: 0.7rem;
    font-weight: 800;
    border: 1px solid transparent;
}

.pun-reprimand { background: rgba(255, 23, 68, 0.1); color: #ff1744; border-color: rgba(255, 23, 68, 0.2); }
.pun-warning { background: rgba(255, 179, 0, 0.1); color: #ffb300; border-color: rgba(255, 179, 0, 0.2); }

.activity-status {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.8rem;
    color: var(--text-dim);
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}
.dot-online { background: var(--success); box-shadow: 0 0 10px var(--success); }
.dot-offline { background: var(--text-dim); }

/* Action Search Bar */
.search-bar {
    width: 100%;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 14px 20px;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    margin-bottom: 20px;
    transition: var(--transition);
}

.search-bar:focus {
    outline: none;
    border-color: var(--brand-primary);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 15px rgba(0, 136, 255, 0.2);
}

/* ─────────────────────────────────────────────
   MODALS & SCHEMAS
   ───────────────────────────────────────────── */

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(8px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-header {
    background: rgba(255, 255, 255, 0.05);
    padding: 20px 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.5rem;
    cursor: pointer;
    transition: var(--transition);
}

.close-btn:hover {
    color: #fff;
    transform: rotate(90deg);
}

.schema-img-container {
    padding: 20px;
    text-align: center;
}

.schema-img-container img {
    max-width: 100%;
    max-height: 70vh;
    border-radius: var(--radius-md);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.6);
}

/* ─────────────────────────────────────────────
   ORDERS & PENALTIES
   ───────────────────────────────────────────── */

.order-preview-box {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--brand-primary);
    border-radius: 12px;
    padding: 20px;
    font-family: 'Courier New', Courier, monospace;
    font-size: 0.9rem;
    line-height: 1.6;
    color: #e0e0e0;
    white-space: pre-wrap;
    max-height: 350px;
    overflow-y: auto;
    margin-top: 10px;
    box-shadow: inset 0 0 20px rgba(0,0,0,0.5);
}

.penalty-link {
    color: var(--danger);
    cursor: pointer;
    transition: var(--transition);
    font-size: 1rem;
    opacity: 0.6;
    margin-left: 8px;
}

.penalty-link:hover {
    opacity: 1;
    transform: scale(1.15);
}

/* Переключатель в модалке (Segmented Control) */
.segmented-control {
    display: flex;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 5px;
    gap: 5px;
    margin-top: 10px;
}

.segment {
    flex: 1;
    padding: 12px;
    text-align: center;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-muted);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.segment i {
    font-size: 0.9rem;
    opacity: 0.7;
}

.segment:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
}

.segment.active {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.segment.active i {
    opacity: 1;
}

.modal-body label {
    display: block;
    margin-bottom: 10px;
    font-size: 0.75rem;
    font-family: var(--font-main);
    color: var(--brand-accent);
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
}

/* Кастомные поля ввода */
.themed-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 12px 15px;
    color: #fff;
    font-family: inherit;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
}

.themed-input:focus {
    border-color: var(--brand-accent);
    box-shadow: 0 0 15px rgba(0, 210, 255, 0.2);
    background: rgba(0, 0, 0, 0.6);
}

select.themed-input {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='white' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14 2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    padding-right: 40px;
    color-scheme: dark; /* Важно для темных выпадающих списков в Chrome */
}

/* Кнопки в модалках */
.modal-btn {
    padding: 12px 25px;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    border: 1px solid transparent;
    font-size: 0.9rem;
    letter-spacing: 0.5px;
}

.modal-btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 210, 255, 0.3);
}

.modal-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 210, 255, 0.5);
    filter: brightness(1.1);
}

.modal-btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-muted);
    border-color: rgba(255, 255, 255, 0.1);
}

.modal-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border-color: var(--brand-accent);
}

.modal-btn-danger {
    background: linear-gradient(135deg, #ff416c, #ff4b2b);
    color: #fff;
    box-shadow: 0 4px 15px rgba(255, 75, 43, 0.3);
}

.modal-btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 75, 43, 0.5);
}

.modal-content {
    background: var(--bg-surface);
    width: 100%;
    max-width: 900px;
    border-radius: 20px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    overflow: hidden;
    position: relative;
    box-shadow: 0 25px 80px rgba(0, 0, 0, 0.8), 0 0 30px rgba(0, 210, 255, 0.1);
}

.modal-body {
    padding: 30px;
}

/* ─────────────────────────────────────────────
   RESPONSIVE
   ───────────────────────────────────────────── */

@media (max-width: 768px) {
    header {
        flex-direction: column;
        gap: 20px;
    }
    
    .nav-bar {
        width: 100%;
        overflow-x: auto;
        justify-content: flex-start;
        border-radius: 12px;
    }
    
    .hero-title {
        font-size: 1.8rem;
    }
}

/* ─────────────────────────────────────────────
   AUTH / LOGIN OVERLAY
   ───────────────────────────────────────────── */

.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(15px);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    background: var(--bg-surface);
    width: 100%;
    max-width: 400px;
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(0, 210, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 40px rgba(0, 210, 255, 0.1);
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-icon {
    font-size: 3rem;
    color: var(--brand-accent);
    margin-bottom: 15px;
    filter: drop-shadow(0 0 10px var(--brand-glow));
}

.login-header h2 {
    font-size: 1.8rem;
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group {
    position: relative;
    margin-bottom: 20px;
}

.input-group i {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--brand-accent);
    opacity: 0.7;
    font-size: 1.1rem;
}

.input-group input {
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 15px 15px 15px 50px;
    border-radius: 14px;
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    transition: var(--transition);
    outline: none;
}

.input-group input:focus {
    border-color: var(--brand-primary);
    background: rgba(0, 0, 0, 0.6);
    box-shadow: 0 0 20px rgba(0, 136, 255, 0.2);
}

.full-width {
    width: 100%;
}

.login-hint {
    font-size: 0.85rem;
    color: var(--brand-accent);
    margin-bottom: 15px;
    background: rgba(0, 210, 255, 0.1);
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(0, 210, 255, 0.2);
    line-height: 1.4;
}

.login-error {
    margin-top: 20px;
    padding: 12px;
    background: rgba(255, 23, 68, 0.1);
    color: #ff1744;
    border-radius: 10px;
    font-size: 0.85rem;
    border: 1px solid rgba(255, 23, 68, 0.2);
    animation: shake 0.4s ease;
    font-weight: 600;
}

.btn-primary, .btn-success {
    padding: 16px 25px;
    border-radius: 14px;
    border: none;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.9rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--brand-primary), var(--brand-accent));
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 136, 255, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 25px rgba(0, 136, 255, 0.5);
}

.btn-success {
    background: linear-gradient(135deg, var(--success), #00b0ff);
    color: #fff;
    box-shadow: 0 4px 15px rgba(0, 230, 118, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    filter: brightness(1.1);
    box-shadow: 0 8px 25px rgba(0, 230, 118, 0.5);
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-dim);
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    margin-top: 5px;
}

.btn-text:hover {
    color: var(--brand-accent);
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-8px); }
    75% { transform: translateX(8px); }
}

/* Animation Utilities */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeIn 0.6s ease forwards;
}
