/* PhishTank Premium Design System - Glassmorphism & Enterprise Aesthetics */

:root {
    /* Color Palette - Cyber Indigo & Deep Slate */
    --primary: #818cf8;
    --primary-glow: rgba(129, 140, 248, 0.4);
    --primary-dark: #6366f1;
    --accent: #c084fc;
    --success: #10b981;
    --danger: #f43f5e;
    --warning: #fbbf24;
    --info: #38bdf8;

    /* Theme Colors */
    --bg-base: #030712;
    --bg-glass: rgba(17, 24, 39, 0.7);
    --bg-card: rgba(31, 41, 55, 0.5);
    --bg-hover: rgba(55, 65, 81, 0.8);
    --border-glass: rgba(255, 255, 255, 0.08);

    --text-main: #f3f4f6;
    --text-sub: #9ca3af;
    --text-dim: #6b7280;

    /* Shadows & Effects */
    --shadow-premium: 0 8px 32px 0 rgba(0, 0, 0, 0.8);
    --glass-blur: blur(12px);
}

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

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: radial-gradient(circle at 50% 0%, #1e1b4b 0%, var(--bg-base) 100%);
    color: var(--text-main);
    line-height: 1.6;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* App Layout Grid */
.app-layout {
    display: flex;
    min-height: 100vh;
}

.auth-layout {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: var(--bg-main);
}

.auth-layout .main-wrapper {
    width: 100%;
    max-width: 500px;
}

/* Sidebar Navigation */
.sidebar {
    width: 240px;
    height: 100vh;
    background: var(--bg-glass);
    backdrop-filter: var(--glass-blur);
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    padding: 1.25rem 1rem;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.sidebar-header {
    margin-bottom: 2rem;
    padding-left: 0.5rem;
}

.nav-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo {
    font-size: 1.5rem;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.brand-text {
    font-weight: 800;
    font-size: 1.25rem;
    background: linear-gradient(to right, #818cf8, #c084fc);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.02em;
}

.nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex-grow: 1;
}

.nav-link {
    color: var(--text-sub);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 0.65rem 0.85rem;
    border-radius: 0.6rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.25rem;
}

.nav-icon {
    font-size: 1.1rem;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

.nav-link:hover .nav-icon,
.nav-link.active .nav-icon {
    opacity: 1;
    filter: drop-shadow(0 0 5px var(--primary-glow));
}

.nav-link:hover,
.nav-link.active {
    color: var(--text-main);
    background: var(--bg-hover);
    box-shadow: inset 0 0 0 1px var(--border-glass);
}

.nav-user {
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    padding-left: 0.5rem;
    margin-bottom: 0.5rem;
}

.user-name {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-main);
}

.user-role-badge {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--primary);
    letter-spacing: 0.05em;
    opacity: 0.9;
    background: rgba(129, 140, 248, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    margin-top: 2px;
}

.btn-logout {
    width: 100%;
    justify-content: flex-start;
    padding: 0.65rem 0.85rem;
    color: var(--danger);
    background: rgba(244, 63, 94, 0.05);
    border: 1px solid rgba(244, 63, 94, 0.1);
}

.btn-logout:hover {
    background: rgba(244, 63, 94, 0.15);
    border-color: rgba(244, 63, 94, 0.3);
}

/* Layout */
.main-wrapper {
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.main-content {
    padding: 2.5rem 4rem;
    width: 100%;
}

.page-header {
    margin-bottom: 2.5rem;
}

.page-header h1 {
    font-size: 2.25rem;
    font-weight: 800;
    letter-spacing: -0.03em;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-sub);
    font-size: 1rem;
}

/* Grid System */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* Premium Cards */
.card {
    background: var(--bg-card);
    backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    overflow: hidden;
    transition: transform 0.3s, border-color 0.3s;
    box-shadow: var(--shadow-premium);
}

.card:hover {
    transform: translateY(-4px);
    border-color: rgba(129, 140, 248, 0.3);
}

.card-header {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    background: rgba(255, 255, 255, 0.02);
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-sub);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.card-body {
    padding: 1.5rem;
}

/* Tables */
.table-container {
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border-glass);
    overflow: hidden;
    margin-top: 1.5rem;
}

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

.table th {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.1em;
}

.table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--border-glass);
    vertical-align: middle;
}

.table tr:hover td {
    background: rgba(255, 255, 255, 0.03);
}

.score-bar-fill {
    height: 100%;
    background: var(--primary);
    border-radius: 2px;
    width: var(--score-width, 0%);
}

/* Components */
.badge {
    padding: 0.25rem 0.75rem;
    border-radius: 2rem;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

.badge-outline {
    border: 1px solid var(--border-glass);
    color: var(--text-sub);
}

.badge-primary {
    background: rgba(129, 140, 248, 0.15);
    color: var(--primary);
    border: 1px solid rgba(129, 140, 248, 0.3);
}

.btn {
    padding: 0.6rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 600;
    border-radius: 0.6rem;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--accent) 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.5);
}

.btn-ghost {
    color: var(--text-sub);
    background: transparent;
}

.btn-ghost:hover {
    background: var(--bg-hover);
    color: var(--text-main);
}

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.75rem;
}

.btn-outline {
    border: 1px solid var(--border-glass);
    color: var(--text-sub);
}

/* Score Indicators */
.score-circle {
    width: 140px;
    height: 140px;
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.03);
    border: 3px solid var(--border-glass);
}

.score-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
}

.score-label {
    font-size: 0.7rem;
    color: var(--text-dim);
}

/* Simulation Special Views */
.region-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1rem;
}

.region-card {
    padding: 1.5rem;
    background: var(--bg-card);
    border-radius: 1rem;
    border: 1px solid var(--border-glass);
    text-decoration: none;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.region-card:hover {
    border-color: var(--primary);
    background: var(--bg-hover);
}

.region-card h4 {
    color: var(--text-main);
    font-size: 1.1rem;
}

.region-card p {
    color: var(--text-dim);
    font-size: 0.8rem;
}

/* Enterprise Stats Overview */
.stats-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2.5rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    padding: 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: all 0.3s ease;
}

.stat-card:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.stat-icon {
    font-size: 1.75rem;
    filter: drop-shadow(0 0 8px var(--primary-glow));
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 0.25rem;
    background: linear-gradient(to bottom, #fff, #9ca3af);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.stat-label {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Section Styling */
.section-header {
    margin: 3rem 0 1.5rem;
    border-left: 3px solid var(--primary);
    padding-left: 1rem;
}

.section-header h2 {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

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

/* Enterprise Region Cards */
.region-card.enterprise {
    padding: 1.75rem;
    justify-content: space-between;
}

.region-meta {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.region-flag {
    font-size: 2rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.2));
}

.region-stats {
    display: flex;
    gap: 1.5rem;
    margin: 1.25rem 0;
    padding: 1rem 0;
    border-top: 1px solid var(--border-glass);
    border-bottom: 1px solid var(--border-glass);
}

.mini-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mini-stat .label {
    font-size: 0.65rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 700;
}

.mini-stat .value {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-main);
}

.region-link {
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--primary);
    transition: gap 0.2s;
}

/* Dashboard Action Buttons */
.card-actions .card-body {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.action-btn {
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem 1.25rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-glass);
    border-radius: 0.75rem;
    color: var(--text-main);
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.2s;
}

.action-btn:hover {
    background: var(--bg-hover);
    border-color: var(--primary);
    transform: translateX(4px);
}

.action-icon {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(129, 140, 248, 0.1);
    border-radius: 0.5rem;
    color: var(--primary);
}

/* Tier Badges */
.tier-badge {
    padding: 0.2rem 0.6rem;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
}

.tier-starter {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.tier-basic {
    background: rgba(56, 189, 248, 0.1);
    color: #38bdf8;
    border: 1px solid rgba(56, 189, 248, 0.2);
}

.tier-advanced {
    background: rgba(244, 63, 94, 0.1);
    color: #f43f5e;
    border: 1px solid rgba(244, 63, 94, 0.2);
}

/* Blueprint Info */
.blueprint-info {
    display: flex;
    flex-direction: column;
}

.blueprint-name {
    font-weight: 700;
    color: var(--text-main);
}

.blueprint-id {
    font-size: 0.7rem;
    color: var(--text-dim);
    font-family: monospace;
}

.vector-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

/* Persona Card Enterprise */
.persona-header {
    display: flex;
    align-items: center;
    gap: 1.25rem;
    margin-bottom: 1.5rem;
}

.persona-avatar-wrap {
    position: relative;
    width: 50px;
    height: 50px;
    background: rgba(129, 140, 248, 0.1);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    border: 1px solid rgba(129, 140, 248, 0.2);
}

.persona-status-online {
    position: absolute;
    bottom: -2px;
    right: -2px;
    width: 12px;
    height: 12px;
    background: var(--success);
    border: 2px solid var(--bg-card);
    border-radius: 50%;
}

.persona-title h3 {
    font-size: 1.1rem;
    font-weight: 700;
    margin-bottom: 0.1rem;
}

.persona-role {
    font-size: 0.75rem;
    color: var(--text-dim);
    font-weight: 600;
}

.persona-meta-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.25rem;
    padding: 1rem;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
}

.meta-item .label {
    display: block;
    font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
    font-weight: 800;
    margin-bottom: 0.2rem;
}

.meta-item .value {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-sub);
}

.persona-actions {
    display: flex;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--border-glass);
}

/* Responsive */
@media (max-width: 1024px) {
    .sidebar {
        width: 80px;
        padding: 1.5rem 0.75rem;
    }

    .brand-text,
    .user-info,
    .nav-link span {
        display: none;
    }

    .nav-link {
        justify-content: center;
        padding: 0.75rem;
    }
}

@media (max-width: 768px) {
    .app-layout {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        padding: 0.75rem 1.5rem;
        position: fixed;
        bottom: 0;
        top: auto;
        border-right: none;
        border-top: 1px solid var(--border-glass);
    }

    .sidebar-header,
    .nav-user {
        margin: 0;
        padding: 0;
        border: none;
    }

    .nav-links {
        flex-direction: row;
        gap: 1.5rem;
    }

    .main-content {
        padding: 1.5rem 1rem 5rem 1rem;
    }
}

/* Empty State Styling */
.empty-state {
    padding: 3rem;
    text-align: center;
    color: var(--text-dim);
    font-style: italic;
}

/* Simulation Dashboard Context */
.context-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.context-section h4 {
    font-size: 0.75rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
    border-bottom: 1px solid var(--border-glass);
    padding-bottom: 0.5rem;
}

.mini-persona-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.mini-persona {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 0.5rem;
}

.persona-icon {
    font-size: 1.25rem;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(129, 140, 248, 0.1);
    border-radius: 6px;
}

.persona-info {
    display: flex;
    flex-direction: column;
}

.persona-info .name {
    font-size: 0.85rem;
    font-weight: 700;
}

.persona-info .role {
    font-size: 0.7rem;
    color: var(--text-dim);
}

.blueprint-mini-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.blueprint-tag {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.8rem;
    color: var(--text-sub);
    padding: 0.4rem 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 4px;
    border-left: 2px solid var(--primary);
}

.blueprint-tag .dot {
    width: 6px;
    height: 6px;
    background: var(--primary);
    border-radius: 50%;
    box-shadow: 0 0 5px var(--primary-glow);
}

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

/* Mail Client UI */
.mail-client {
    display: flex;
    height: calc(100vh - 5rem);
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-glass);
    border-radius: 1rem;
    overflow: hidden;
}

.mail-folders {
    width: 200px;
    background: rgba(0, 0, 0, 0.2);
    border-right: 1px solid var(--border-glass);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.mail-folders-header h3 {
    font-size: 0.7rem;
    text-transform: uppercase;
    color: var(--text-dim);
    letter-spacing: 0.1em;
    margin-bottom: 0.5rem;
}

.folder-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 0.8rem;
    border-radius: 0.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-sub);
    cursor: pointer;
    transition: all 0.2s;
}

.folder-item.active {
    background: rgba(129, 140, 248, 0.1);
    color: var(--primary);
}

.folder-item:hover:not(.active) {
    background: rgba(255, 255, 255, 0.05);
}

.mail-list-pane {
    width: 320px;
    border-right: 1px solid var(--border-glass);
    display: flex;
    flex-direction: column;
}

.pane-header {
    padding: 1rem;
    border-bottom: 1px solid var(--border-glass);
}

.search-box {
    width: 100%;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-glass);
    border-radius: 0.5rem;
    color: var(--text-main);
    font-size: 0.8rem;
}

.mail-items {
    overflow-y: auto;
    flex: 1;
}

.mail-item {
    padding: 1.25rem 1rem;
    border-bottom: 1px solid var(--border-glass);
    cursor: pointer;
    transition: all 0.2s;
}

.mail-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.mail-item.selected {
    background: rgba(129, 140, 248, 0.05);
    border-left: 3px solid var(--primary);
}

.mail-item.unread .subject {
    font-weight: 800;
    color: var(--text-main);
}

.mail-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-dim);
    margin-bottom: 0.25rem;
}

.mail-item .subject {
    font-size: 0.9rem;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-item .preview {
    font-size: 0.75rem;
    color: var(--text-dim);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mail-view-pane {
    flex: 1;
    background: rgba(0, 0, 0, 0.1);
    position: relative;
    display: flex;
    flex-direction: column;
}

.mail-view-empty {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.empty-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.mail-view-active {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.mail-content-header {
    padding: 1.5rem 2rem;
    border-bottom: 1px solid var(--border-glass);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.mail-info h2 {
    font-size: 1.25rem;
    margin-bottom: 1rem;
}

.sender-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.sender-info .avatar {
    width: 40px;
    height: 40px;
    background: var(--bg-hover);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.sender-info div {
    display: flex;
    flex-direction: column;
}

.sender-info .name {
    font-weight: 700;
    font-size: 0.9rem;
}

.sender-info .target {
    font-size: 0.75rem;
    color: var(--text-dim);
}

.mail-body-container {
    padding: 2rem;
    overflow-y: auto;
    flex: 1;
}

.mail-body {
    background: white;
    color: #1f2937;
    padding: 2rem;
    border-radius: 0.5rem;
    min-height: 300px;
}

@media (max-width: 1024px) {
    .mail-folders {
        display: none;
    }
}

@media (max-width: 768px) {
    .mail-list-pane {
        display: none;
    }
}