/**
 * SPRC Hub — Hub Launcher Styles
 *
 * Login page and app tile dashboard specific to the hub launcher.
 */

/* ============================================
   LOGIN PAGE
   ============================================ */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--space-md);
    background: linear-gradient(135deg, var(--deep-navy) 0%, var(--slate-blue) 100%);
}

.login-card {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-xl) var(--space-lg);
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-lg);
    text-align: center;
}

.login-logo {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-md);
    object-fit: cover;
    margin-bottom: var(--space-md);
}

.login-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--deep-navy);
    margin-bottom: var(--space-xs);
}

.login-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: var(--space-lg);
}

.google-sign-in-btn {
    width: 100%;
    padding: 12px 20px;
    background: #fff;
    color: #3c4043;
    border: 1px solid #dadce0;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.15s ease;
}

.google-sign-in-btn:hover {
    background: #f8f9fa;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.google-sign-in-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ============================================
   DASHBOARD — App Tiles
   ============================================ */
.dashboard-container {
    max-width: 900px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

.dashboard-header {
    margin-bottom: var(--space-xl);
}

.dashboard-greeting {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--deep-navy);
    margin-bottom: var(--space-xs);
}

.dashboard-subtext {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.app-tiles {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-lg);
}

.app-tile {
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    padding: var(--space-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--border-light);
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    color: inherit;
    display: block;
}

.app-tile:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
    border-color: var(--soft-blue-gray);
}

.app-tile-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    object-fit: cover;
}

.app-tile-info {
    min-width: 0;
}

.app-tile-name {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
}

.app-tile-desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.4;
}

/* ============================================
   ROLE BADGE
   ============================================ */
.role-badge {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.role-badge.super_user {
    background: #EBF4FF;
    color: #2B6CB0;
}

.role-badge.admin {
    background: #F0FFF4;
    color: #276749;
}

.role-badge.standard {
    background: #F7FAFC;
    color: #718096;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 480px) {
    .login-card {
        padding: var(--space-lg) var(--space-md);
    }

    .login-logo {
        width: 64px;
        height: 64px;
    }

    .dashboard-container {
        padding: var(--space-md) var(--space-sm);
    }

    .dashboard-header {
        margin-bottom: var(--space-md);
    }

    .app-tiles {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .app-tile {
        padding: 12px 16px;
        display: flex;
        flex-direction: row;
        align-items: center;
        gap: 14px;
    }

    .app-tile-icon {
        width: 42px;
        height: 42px;
        margin-bottom: 0;
        flex-shrink: 0;
    }

    .app-tile-info {
        display: flex;
        align-items: center;
        gap: 8px;
        flex: 1;
        min-width: 0;
    }

    .app-tile-name {
        font-size: 0.92rem;
        margin-bottom: 0;
        white-space: nowrap;
        flex-shrink: 0;
    }

    .app-tile-desc {
        font-size: 0.72rem;
        line-height: 1.3;
        color: var(--text-muted);
    }
}

/* ============================================
   Tutorial Overlay & Tooltip
   ============================================ */

/* Full-screen overlay with spotlight cutout */
.tutorial-overlay {
    position: fixed;
    inset: 0;
    z-index: 2000;
    pointer-events: auto;
    transition: opacity 0.2s ease;
    opacity: 0;
}

.tutorial-overlay.active {
    opacity: 1;
}

/* Spotlight cutout via box-shadow on a positioned pseudo-element */
.tutorial-overlay::before {
    content: '';
    position: absolute;
    top: var(--spot-top, -9999px);
    left: var(--spot-left, -9999px);
    width: var(--spot-width, 0);
    height: var(--spot-height, 0);
    border-radius: var(--radius-md);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
    pointer-events: none;
    z-index: 2001;
}

/* Tooltip */
.tutorial-tooltip {
    position: fixed;
    z-index: 2002;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
    padding: 24px;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    pointer-events: auto;
}

.tutorial-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.tutorial-tooltip-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.tutorial-tooltip-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--deep-navy);
}

.tutorial-tooltip-close {
    width: 28px;
    height: 28px;
    border: none;
    background: #F1EFEA;
    border-radius: 50%;
    font-size: 1.1rem;
    line-height: 1;
    color: var(--text-muted);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.tutorial-tooltip-close:hover {
    background: #DF3F32;
    color: #fff;
}

.tutorial-tooltip-desc {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 16px;
}

.tutorial-tooltip-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.tutorial-progress {
    font-size: 0.78rem;
    color: var(--text-muted);
    font-weight: 500;
}

.tutorial-nav {
    display: flex;
    gap: 8px;
}

.tutorial-btn {
    padding: 4px 16px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s ease;
}

.tutorial-btn-next {
    background: var(--deep-navy);
    color: #fff;
}

.tutorial-btn-next:hover {
    background: var(--slate-blue);
}

.tutorial-btn-back {
    background: #F1EFEA;
    color: var(--text-primary);
}

.tutorial-btn-back:hover {
    background: #EFE7DC;
}

/* Help button in hub nav (dark background — use light colors) */
.tutorial-help-btn {
    background: none;
    border: 1.5px solid var(--soft-blue-gray);
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--soft-blue-gray);
    cursor: pointer;
    transition: all 0.15s ease;
    flex-shrink: 0;
}

.tutorial-help-btn:hover {
    border-color: #fff;
    color: #fff;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .tutorial-tooltip {
        padding: 16px;
        max-width: calc(100vw - 24px);
    }

    .tutorial-tooltip-title {
        font-size: 0.95rem;
    }

    .tutorial-tooltip-desc {
        font-size: 0.82rem;
    }
}

/* Mobile nav — hide role badge, shrink help button */
@media (max-width: 480px) {
    .role-badge {
        display: none;
    }

    .tutorial-help-btn {
        width: 24px;
        height: 24px;
        font-size: 0.75rem;
        border-width: 1px;
    }
}
