/* Global Sıfırlama ve Değişkenler */
:root {
    --bg-color: #0f1418;
    --card-bg: #151d24;
    --panel-bg: #1e272e;
    --primary-color: #f97316;
    --primary-hover: #e65100;
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(148, 163, 184, 0.18);
    --danger-color: #ef4444;
    --success-color: #22c55e;
    --warning-color: #eab308;
    --shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Segoe UI', Roboto, Arial, sans-serif;
}

body {
    background:
        radial-gradient(circle at 12% 10%, rgba(249, 115, 22, 0.12), transparent 28%),
        linear-gradient(135deg, #0f1418 0%, #111a21 44%, #0b1014 100%);
    color: var(--text-color);
    line-height: 1.6;
}

/* Giriş Sayfası Tasarımı */
.login-wrapper {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(360px, 420px);
    gap: 44px;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 48px;
    background:
        linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px),
        radial-gradient(circle at 78% 18%, rgba(249, 115, 22, 0.16), transparent 28%),
        linear-gradient(135deg, #0f1418 0%, #101820 52%, #090d11 100%);
    background-size: 34px 34px, 34px 34px, auto, auto;
}

.login-aside {
    max-width: 620px;
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    margin-bottom: 14px;
    color: #fed7aa;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.login-aside h1 {
    color: #ffffff;
    font-size: clamp(36px, 5vw, 64px);
    line-height: 1.02;
    letter-spacing: 0;
    max-width: 720px;
}

.login-aside p {
    max-width: 540px;
    margin-top: 20px;
    color: #cbd5e1;
    font-size: 17px;
}

.login-metrics {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 28px;
}

.login-metrics span {
    padding: 9px 12px;
    color: #f8fafc;
    background: rgba(30, 39, 46, 0.72);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.login-container {
    position: relative;
    overflow: hidden;
    background: linear-gradient(155deg, rgba(30, 39, 46, 0.94), rgba(15, 20, 24, 0.88));
    padding: 40px;
    border-radius: 8px;
    width: 100%;
    max-width: 420px;
    border: 1px solid var(--border-color);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.login-container::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 36%);
    pointer-events: none;
}

.brand-area {
    text-align: center;
    margin-bottom: 28px;
    padding: 20px 18px 16px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(241, 245, 249, 0.96));
    border: 1px solid rgba(226, 232, 240, 0.95);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9), 0 14px 28px rgba(0, 0, 0, 0.16);
}

/* Logo Tasarım Ayarları */
.brand-logo {
    max-width: 155px;
    height: auto;
    margin-bottom: 10px;
    display: inline-block;
}

.brand-area h1 {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 1px;
}

.brand-area p {
    font-size: 13px;
    color: #475569;
    margin-top: 5px;
    font-weight: 700;
}

/* Form Elemanları */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #cbd5e1;
}

.input-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid rgba(148, 163, 184, 0.28);
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background-color: rgba(15, 20, 24, 0.88);
    color: #ffffff;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background-color: #0f1418;
    box-shadow: 0 0 0 3px rgba(249, 115, 22, 0.16);
}

.input-group input::placeholder { color: #64748b; }

/* Butonlar */
.btn-primary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 14px 30px rgba(249, 115, 22, 0.25);
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover), #bf360c);
    transform: translateY(-2px);
    box-shadow: 0 18px 34px rgba(249, 115, 22, 0.32);
}

/* Hata Mesajı */
.error-message {
    color: var(--danger-color);
    font-size: 14px;
    text-align: center;
    margin-top: 15px;
    font-weight: 600;
}

/* Teknik APK indirme sayfası */
.download-page {
    min-height: 100vh;
}

.download-shell {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(340px, 420px);
    gap: 56px;
    align-items: center;
    width: min(1080px, calc(100% - 48px));
    min-height: 100vh;
    margin: 0 auto;
    padding: 48px 0;
}

.download-copy {
    max-width: 620px;
}

.download-copy h1 {
    color: #ffffff;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 1.05;
    letter-spacing: 0;
}

.download-copy > p {
    max-width: 560px;
    margin-top: 18px;
    color: #cbd5e1;
    font-size: 17px;
}

.download-details {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    margin-top: 32px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
}

.download-details div {
    padding: 18px 16px 18px 0;
}

.download-details dt {
    color: var(--text-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.download-details dd {
    margin-top: 4px;
    color: #ffffff;
    font-size: 15px;
    font-weight: 700;
}

.download-details .package-detail {
    grid-column: 1 / -1;
    overflow-wrap: anywhere;
}

.download-panel {
    padding: 36px;
    background: linear-gradient(155deg, rgba(30, 39, 46, 0.96), rgba(15, 20, 24, 0.92));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.download-file-type {
    display: inline-block;
    padding: 5px 9px;
    color: #fed7aa;
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.3);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 800;
}

.download-panel h2 {
    margin-top: 12px;
    color: #ffffff;
    font-size: 28px;
}

.download-description {
    margin: 4px 0 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.download-button {
    display: block;
    text-align: center;
    text-decoration: none;
}

@media (max-width: 800px) {
    .download-shell {
        grid-template-columns: 1fr;
        gap: 32px;
        width: min(100% - 32px, 560px);
        padding: 32px 0;
    }

    .download-details {
        grid-template-columns: 1fr;
    }

    .download-details div {
        padding: 12px 0;
    }

    .download-panel {
        padding: 24px;
    }
}
/* Dashboard Sayfası Tasarım Kuralları (GÜNCELLENDİ: Koyu Tema) */
.dashboard-body {
    min-height: 100vh;
    background:
        radial-gradient(circle at 14% 4%, rgba(249, 115, 22, 0.12), transparent 25%),
        linear-gradient(135deg, #0f1418 0%, #111a21 44%, #0b1014 100%);
    color: #f8fafc;
}

.main-header {
    background: rgba(248, 250, 252, 0.96);
    color: #1e272e;
    padding: 16px 40px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 14px 36px rgba(0,0,0,0.18);
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
    backdrop-filter: blur(12px);
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    max-height: 45px;
    width: auto;
}

.system-title {
    font-size: 14px;
    color: #475569;
    font-weight: 600;
}

.welcome-text {
    font-size: 15px;
    margin-right: 20px;
    font-weight: 600;
    color: #1e293b;
}

.btn-logout {
    padding: 8px 16px;
    background-color: #fff7ed;
    border: 1px solid rgba(239, 68, 68, 0.28);
    color: #b91c1c;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.2s ease;
}

.btn-logout:hover {
    background-color: #ef4444;
    color: white;
}

/* İçerik Düzeni */
.dashboard-container {
    max-width: 1200px;
    margin: 42px auto;
    padding: 0 20px;
}

.page-header {
    margin-bottom: 30px;
    padding: 22px;
    background: linear-gradient(145deg, rgba(30, 39, 46, 0.88), rgba(15, 20, 24, 0.72));
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: var(--shadow);
}

.page-header h2 {
    font-size: clamp(26px, 3vw, 36px);
    line-height: 1.12;
    color: #ffffff;
}

.page-header p {
    color: #94a3b8;
    font-size: 15px;
}

.page-header-row {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
}

.btn-refresh {
    flex: 0 0 auto;
    min-height: 42px;
    padding: 10px 15px;
    color: #ffffff;
    background: linear-gradient(135deg, #f97316, #e65100);
    border: 0;
    border-radius: 8px;
    box-shadow: 0 14px 30px rgba(249, 115, 22, 0.25);
    cursor: pointer;
    font-weight: 800;
    transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-refresh:hover {
    background: linear-gradient(135deg, #e65100, #bf360c);
    box-shadow: 0 18px 34px rgba(249, 115, 22, 0.32);
    transform: translateY(-2px);
}

.scroll-top-btn {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 900;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    color: #ffffff;
    background: linear-gradient(135deg, #f97316, #e65100);
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 999px;
    box-shadow: 0 18px 38px rgba(0, 0, 0, 0.38);
    cursor: pointer;
    font-size: 22px;
    font-weight: 800;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.scroll-top-btn.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

.scroll-top-btn:hover {
    box-shadow: 0 22px 44px rgba(249, 115, 22, 0.28);
    transform: translateY(-2px);
}

/* Cihaz Kartları Izgarası (Grid) */
.device-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 25px;
}

.loading-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: #94a3b8;
    font-size: 16px;
    background: #1e272e;
    border-radius: 8px;
    border: 1px dashed rgba(148, 163, 184, 0.24);
}

/* Cihaz Kartı Yapısı (Koyu Temaya Uyumlu) */
.device-card {
    position: relative;
    overflow: hidden;
    background: linear-gradient(160deg, rgba(30, 39, 46, 0.96), rgba(17, 24, 31, 0.96));
    border-radius: 8px;
    padding: 25px;
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.device-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.07), transparent 32%);
    pointer-events: none;
}

.device-card:hover {
    transform: translateY(-5px);
    border-color: rgba(249, 115, 22, 0.42);
    box-shadow: 0 22px 55px rgba(0,0,0,0.42);
}

.card-header-area {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    margin: 22px 0 18px;
    padding-bottom: 14px;
    border-bottom: 1px solid rgba(148, 163, 184, 0.18);
}

.critical-level-chip {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 1;
    padding: 5px 9px;
    color: #fed7aa;
    background: rgba(249, 115, 22, 0.12);
    border: 1px solid rgba(249, 115, 22, 0.28);
    border-radius: 999px;
    font-size: 11px;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;
}

.device-name {
    font-size: 18px;
    font-weight: 700;
    color: #ffffff;
    padding-right: 86px;
}

.device-id {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 2px;
}

.card-open-indicator {
    color: #94a3b8;
    font-size: 20px;
    line-height: 1;
    transition: color 0.2s ease, transform 0.2s ease;
}

.device-card:hover .card-open-indicator {
    color: #f97316;
    transform: translateX(3px);
}

.status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
}

/* Koyu zemin için badge renkleri tersine çevrildi */
.status-normal { background: #166534; color: #dcfce7; }
.status-warning { background: #854d0e; color: #fef9c3; }
.status-danger { background: #991b1b; color: #fee2e2; }

/* Tank İlerleme Çubuğu (Progress Bar) */
.tank-section {
    margin-bottom: 20px;
}

.tank-info-text {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
    color: #e2e8f0;
}

.progress-bar-bg {
    background-color: rgba(51, 65, 85, 0.82);
    height: 16px;
    border-radius: 8px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 4px rgba(0, 0, 0, 0.32);
}

.progress-bar-fill {
    height: 100%;
    border-radius: 8px;
    transition: width 0.5s ease-in-out;
    box-shadow: inset 0 1px 8px rgba(255, 255, 255, 0.16);
}

/* Dinamik Doluluk Renkleri */
.bg-success { background-color: #22c55e; }
.bg-warning { background-color: #eab308; }
.bg-danger { background-color: #ef4444; }

.card-footer-area {
    font-size: 12px;
    color: #94a3b8;
    border-top: 1px solid #334155;
    padding-top: 12px;
    text-align: right;
}

@media (max-width: 900px) {
    .login-wrapper {
        grid-template-columns: 1fr;
        padding: 28px 18px;
        align-items: start;
        justify-items: center;
    }

    .login-aside {
        width: min(100%, 680px);
        max-width: 100%;
    }
    .login-aside h1 { max-width: 680px; }

    .login-container {
        width: min(100%, 420px);
        justify-self: center;
    }

    .main-header {
        gap: 16px;
        padding: 16px 20px;
        flex-wrap: wrap;
    }

    .header-right {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        justify-content: space-between;
    }

    .welcome-text { margin-right: 0; }

    .device-grid { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
}

@media (max-width: 560px) {
    .login-wrapper { gap: 22px; padding: 18px 16px; }
    .login-aside { text-align: left; }
    .login-aside h1 { font-size: 30px; }
    .login-aside p { margin-top: 14px; font-size: 14px; }
    .login-metrics { margin-top: 18px; gap: 7px; }
    .login-metrics span { padding: 7px 9px; font-size: 11px; }
    .login-container {
        width: 100%;
        max-width: 420px;
        padding: 24px 18px;
    }
    .brand-area { margin-bottom: 22px; padding: 16px 14px 13px; }
    .brand-logo { max-width: 138px; }
    .main-header { padding: 12px 14px; }
    .header-left { gap: 10px; }
    .header-logo { max-height: 38px; }
    .system-title { font-size: 12px; }
    .header-right { gap: 8px; }
    .welcome-text { font-size: 13px; }
    .btn-logout { padding: 7px 11px; font-size: 12px; }
    .dashboard-container { margin-top: 24px; padding: 0 14px; }
    .page-header { padding: 16px; margin-bottom: 16px; }
    .page-header-row { flex-direction: column; gap: 12px; }
    .btn-refresh { width: 100%; }
    .page-header h2 { font-size: 25px; }
    .page-header p { font-size: 13px; }
    .device-grid { grid-template-columns: 1fr; }
    .device-card { padding: 20px 16px 16px; }
    .card-header-area { margin: 24px 0 14px; }
    .device-name { padding-right: 0; margin-top: 16px; }
    .critical-level-chip { left: 20px; right: auto; }
    .tank-section { margin-bottom: 14px; }
    .tank-info-text { font-size: 12px; }
    .progress-bar-bg { height: 12px; }
    .scroll-top-btn { right: 14px; bottom: 14px; width: 40px; height: 40px; font-size: 20px; }
}
