* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Segoe UI", Arial, sans-serif;
    background: #0f1419;
    color: #e8eaed;
    min-height: 100vh;
}

body.theme-kameros {
    --accent: #8ab4f8;
    --accent-active: #aecbfa;
    --accent-bg: rgba(138, 180, 248, 0.12);
    --accent-bg-hover: rgba(138, 180, 248, 0.08);
    --content-max: 1400px;
    --muted: #9aa0a6;
}

a {
    color: #8ab4f8;
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.page-header {
    padding: 20px 24px;
    border-bottom: 1px solid #2a3441;
    background: #151b23;
}

.page-header h1 {
    margin: 0;
    font-size: 24px;
    font-weight: 600;
    color: #e8eaed;
}

.page-subtitle {
    color: var(--muted, #9aa0a6);
}

.logout-link {
    font-size: 13px;
    color: #f28b82;
    text-decoration: none;
}

.logout-link:hover {
    text-decoration: underline;
}

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

.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #3c4a5c;
    background: #1f2933;
    color: #e8eaed;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
}

.btn:hover {
    background: #2a3441;
    text-decoration: none;
}

.btn-primary {
    background: #1a73e8;
    border-color: #1a73e8;
}

.btn-primary:hover {
    background: #1557b0;
}

.content {
    padding: 24px;
    max-width: var(--content-max, 1400px);
    margin: 0 auto;
}

.camera-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(360px, 420px));
    justify-content: center;
    gap: 20px;
}

.camera-card {
    width: 100%;
    max-width: 420px;
    background: #151b23;
    border: 1px solid #2a3441;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.camera-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    border-bottom: 1px solid #2a3441;
}

.camera-title {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.camera-meta {
    margin: 2px 0 0;
    font-size: 12px;
    color: #9aa0a6;
}

.status-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #5f6368;
    flex-shrink: 0;
}

.status-dot.online {
    background: #34a853;
    box-shadow: 0 0 8px rgba(52, 168, 83, 0.6);
}

.status-dot.offline {
    background: #ea4335;
}

.camera-viewport {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
}

.camera-viewport img,
.camera-viewport iframe {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center center;
    display: block;
    border: 0;
}

.camera-placeholder {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: #9aa0a6;
    font-size: 14px;
    text-align: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.55);
}

.camera-placeholder[hidden] {
    display: none;
}

.camera-updated {
    position: absolute;
    right: 10px;
    bottom: 10px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(0, 0, 0, 0.65);
    color: #e8eaed;
    font-size: 11px;
    pointer-events: none;
}

.camera-actions {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #2a3441;
}

.empty-state {
    text-align: center;
    padding: 64px 24px;
    background: #151b23;
    border: 1px dashed #3c4a5c;
    border-radius: 12px;
}

.empty-state h2 {
    margin: 0 0 12px;
    font-size: 22px;
}

.empty-state p {
    margin: 0 0 8px;
    color: #9aa0a6;
    line-height: 1.6;
}

.empty-state code {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 12px;
    background: #0f1419;
    border-radius: 6px;
    color: #f28b82;
    font-size: 13px;
}

.info-panel {
    margin-top: 24px;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    padding: 16px 20px;
    background: #151b23;
    border: 1px solid #2a3441;
    border-radius: 12px;
    color: #9aa0a6;
    font-size: 14px;
    line-height: 1.6;
}

.info-panel strong {
    color: #e8eaed;
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.login-box {
    width: 100%;
    max-width: 380px;
    padding: 28px;
    border-radius: 12px;
    background: #151b23;
    border: 1px solid #2a3441;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
}

.login-box h1 {
    margin: 0 0 8px;
    font-size: 24px;
}

.login-subtitle {
    margin: 0 0 20px;
    color: #9aa0a6;
    font-size: 14px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.login-form label {
    font-size: 13px;
    color: #9aa0a6;
}

.login-form input {
    padding: 10px 12px;
    border-radius: 8px;
    border: 1px solid #3c4a5c;
    background: #0f1419;
    color: #e8eaed;
    font-size: 14px;
}

.login-btn {
    justify-content: center;
    margin-top: 8px;
    width: 100%;
}

.login-error {
    margin: 0 0 16px;
    padding: 10px 12px;
    border-radius: 8px;
    background: rgba(234, 67, 53, 0.15);
    border: 1px solid rgba(234, 67, 53, 0.4);
    color: #f28b82;
    font-size: 14px;
}

.login-back {
    margin: 18px 0 0;
    text-align: center;
    font-size: 14px;
}

@media (max-width: 640px) {
    .camera-grid {
        grid-template-columns: 1fr;
    }
}
