/* Premium Light Glassmorphism Dashboard */

:root {
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.5);
    --glass-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    --text-main: #1e293b;
    --text-muted: #64748b;
    
    --color-safe: #3b82f6;
    --color-warn: #eab308;
    --color-danger: #ec4899;
    --color-critical: #ef4444;
}

body.dashboard-body {
    margin: 0;
    font-family: 'Outfit', sans-serif;
    background: #f8fafc;
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    z-index: 0;
}

/* Background Animated Blobs */
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    z-index: -1;
    opacity: 0.5;
    animation: float 10s infinite ease-in-out alternate;
}
.blob-1 {
    top: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: rgba(59, 130, 246, 0.4); /* Blue */
}
.blob-2 {
    bottom: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: rgba(236, 72, 153, 0.4); /* Pink */
    animation-delay: -5s;
}
.blob-3 {
    top: 40%;
    left: 40%;
    width: 400px;
    height: 400px;
    background: rgba(168, 85, 247, 0.3); /* Purple */
    animation-duration: 15s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    100% { transform: translate(30px, 50px) scale(1.1); }
}

/* Navbar */
.dash-navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 40px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.brand {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-main);
}
.brand-icon {
    font-size: 1.6rem;
    color: var(--color-safe);
}

.user-menu {
    display: flex;
    align-items: center;
    gap: 16px;
}
.user-email {
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 500;
}
.btn-signout {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 8px 18px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 0.9rem;
    font-family: 'Outfit', sans-serif;
    font-weight: 600;
    color: var(--text-main);
    transition: all 0.2s;
}
.btn-signout:hover {
    background: #e2e8f0;
    transform: translateY(-1px);
}

/* Layout */
.dash-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.dash-header {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 40px;
    width: 100%;
}
.dash-header h1 {
    font-size: 2.8rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 12px;
    background: linear-gradient(135deg, #1e293b, #3b82f6);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.dash-header p {
    color: var(--text-muted);
    font-size: 1.15rem;
    font-weight: 400;
}

.dash-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 32px;
}
.section-title {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 24px;
    color: var(--text-main);
}

/* Commands Grid */
.control-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

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

.command-card {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    cursor: pointer;
    box-shadow: var(--glass-shadow);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}

/* Stagger cards natively */
.command-card:nth-child(1) { animation-delay: 0.1s; }
.command-card:nth-child(2) { animation-delay: 0.2s; }
.command-card:nth-child(3) { animation-delay: 0.3s; }
.command-card:nth-child(4) { animation-delay: 0.4s; }

.command-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8);
    pointer-events: none;
}

.command-card:hover {
    transform: translateY(-6px);
}

.card-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
    transition: transform 0.3s ease;
}

.command-card:hover .card-icon {
    transform: scale(1.1);
}

.card-info h3 {
    margin: 0 0 8px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}
.card-info p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Specific Card Colors & Glows */
.command-card.safe .card-icon { background: #eff6ff; color: var(--color-safe); }
.command-card.safe:hover { box-shadow: 0 20px 40px -10px rgba(59, 130, 246, 0.2); border-color: rgba(59, 130, 246, 0.3); }

.command-card.warn .card-icon { background: #fefce8; color: var(--color-warn); }
.command-card.warn:hover { box-shadow: 0 20px 40px -10px rgba(234, 179, 8, 0.2); border-color: rgba(234, 179, 8, 0.3); }

.command-card.danger .card-icon { background: #fdf2f8; color: var(--color-danger); }
.command-card.danger:hover { box-shadow: 0 20px 40px -10px rgba(236, 72, 153, 0.2); border-color: rgba(236, 72, 153, 0.3); }

.command-card.critical .card-icon { background: #fef2f2; color: var(--color-critical); }
.command-card.critical:hover { box-shadow: 0 20px 40px -10px rgba(239, 68, 68, 0.2); border-color: rgba(239, 68, 68, 0.3); }

/* Activity Log */
.dash-activity .log-container {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    height: 480px;
    overflow-y: auto;
    padding: 20px;
    box-shadow: var(--glass-shadow);
}

.log-container::-webkit-scrollbar { width: 6px; }
.log-container::-webkit-scrollbar-track { background: transparent; }
.log-container::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

.log-empty {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 50%;
    transform: translateY(-50%);
}

.log-item {
    display: flex;
    flex-direction: column;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.6);
    margin-bottom: 12px;
    border: 1px solid rgba(255,255,255,0.4);
    font-size: 0.85rem;
    color: var(--text-main);
    box-shadow: 0 2px 10px rgba(0,0,0,0.02);
    transition: transform 0.2s;
    animation: slideIn 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.log-item:hover {
    transform: translateX(4px);
}
@keyframes slideIn {
    from { opacity: 0; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

.log-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-weight: 600;
}
.log-msg {
    line-height: 1.4;
    word-wrap: break-word;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(15, 23, 42, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}
.modal-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    padding: 32px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.15);
    transform: scale(0.95);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal-overlay.active .modal-content {
    transform: scale(1);
}

.modal-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    color: var(--color-warn);
}
.modal-content h2 {
    margin: 0 0 12px 0;
    font-size: 1.4rem;
    color: var(--text-main);
}
.modal-content p {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin-bottom: 24px;
    line-height: 1.5;
}
.modal-actions {
    display: flex;
    gap: 12px;
}
.modal-actions button {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.2s, transform 0.2s;
}
.modal-actions button:hover {
    opacity: 0.9;
    transform: translateY(-1px);
}
.btn-cancel {
    background: #e2e8f0;
    color: var(--text-main);
}
.btn-confirm {
    background: var(--color-critical);
    color: white;
}

/* ═══════ Find My Phone — Full-width card ═══════ */
.find-phone-card {
    margin-top: 28px;
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 16px;
    padding: 24px 28px;
    box-shadow: var(--glass-shadow);
    position: relative;
    overflow: hidden;
    animation: fadeUp 0.6s cubic-bezier(0.175, 0.885, 0.32, 1.275) 0.35s backwards;
}
.find-phone-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border-radius: 16px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,0.8);
    pointer-events: none;
}

.find-phone-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
}
.find-phone-header .find-icon {
    background: #eff6ff;
    color: var(--color-safe);
}
.find-phone-text h3 {
    margin: 0 0 6px 0;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-main);
}
.find-phone-text p {
    margin: 0;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.5;
}

/* Controls row: input + send button */
.find-phone-controls {
    display: flex;
    gap: 10px;
    align-items: stretch;
}
.find-msg-input {
    flex: 1;
    min-width: 0;
    padding: 11px 16px;
    border: 1px solid rgba(59, 130, 246, 0.25);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.7);
    font-family: 'Outfit', sans-serif;
    font-size: 0.85rem;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}
.find-msg-input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
}
.find-msg-input:focus {
    border-color: var(--color-safe);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-send-find {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: white;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.3);
    flex-shrink: 0;
}
.btn-send-find:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
}
.btn-send-find:active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}
.btn-send-find ion-icon {
    font-size: 1.05rem;
}

/* Mobile */
@media (max-width: 768px) {
    .dash-navbar { 
        padding: 16px 20px; 
    }
    .brand {
        font-size: 1.2rem;
        white-space: nowrap;
    }
    .brand span {
        display: none; /* Hide '| Dashboard' on mobile */
    }
    .user-email { 
        display: none; /* Hide long email address on mobile */
    }
    .dash-header h1 { font-size: 1.8rem; }
    .dash-layout { grid-template-columns: 1fr; }
    .dash-container { padding: 20px; }
    
    .control-grid { 
        grid-template-columns: 1fr; 
        gap: 16px; 
    }
    
    .command-card { padding: 16px; gap: 12px; }
    .card-icon { width: 48px; height: 48px; font-size: 1.5rem; }
    .log-container { height: 350px; }

    /* Find My Phone mobile */
    .find-phone-card { padding: 18px; }
    .find-phone-controls {
        flex-direction: column;
        gap: 10px;
    }
    .btn-send-find {
        width: 100%;
        justify-content: center;
        padding: 13px 20px;
    }
}
