/*
 * E4SP Core Stylesheet
 * =====================
 * Centralized design tokens, base styles, and shared UI components
 * for the E4SP Operational Portal ecosystem.
 *
 * Loaded via: <link rel="stylesheet" href="/public/css/e4sp-core.css">
 * after Bootstrap 5 and FontAwesome in the shared head partial.
 */

/* ── Design Tokens ──────────────────────────────────────────────── */
:root {
    /* Enreach brand */
    --enreach-blue: #00A9E0;
    --enreach-dark: #003057;
    --primary-gradient: linear-gradient(135deg, #003057 0%, #00A9E0 100%);
    --glass-bg: rgba(255, 255, 255, 0.95);

    /* Functional palette */
    --primary-color: #0d6efd;
    --success-color: #198754;
    --dark-bg: #212529;
}

/* ── Base ────────────────────────────────────────────────────────── */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background-color: #f7f9fc;
    color: #334155;
}

/* ── Navbar ──────────────────────────────────────────────────────── */
.navbar {
    background: var(--enreach-dark) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 0.75rem 1.5rem;
}

.navbar-brand {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    letter-spacing: -0.5px;
    color: white !important;
}

.nav-link {
    color: rgba(255, 255, 255, 0.85) !important;
    font-weight: 500;
    transition: all 0.2s ease;
}

.nav-link:hover {
    color: white !important;
    transform: translateY(-1px);
}

/* ── Footer ──────────────────────────────────────────────────────── */
footer {
    background: #fff;
    border-top: 1px solid #e2e8f0;
    padding: 2rem 0;
    color: #64748b;
    margin-top: auto;
}

/* ── Cards ───────────────────────────────────────────────────────── */

/* Base card */
.card {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.card:hover {
    box-shadow: 0 1rem 3rem rgba(0, 0, 0, .08) !important;
}

/*
 * App card — reusable card with dark info panel + white content panel.
 * Used by: find-my-platform, sewanc5, alphalinkc5, cloudtelecomc5.
 *
 * Split-panel layout (side by side):
 *   .app-card > .row.g-0
 *     > .col-md-5.app-card-info  (dark side)
 *     > .col-md-7.app-card-content (white side)
 *
 * Stacked layout (header + body):
 *   .app-card
 *     > .app-card-info   (dark header strip)
 *     > .app-card-content (white body)
 */
.app-card {
    border-radius: 16px;
    border: none;
    background: white;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.app-card-info {
    background: var(--dark-bg);
    color: white;
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.app-card-info h6,
.app-card-info h5,
.app-card-info h4,
.app-card-info h3 {
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
}

.app-card-info .badge {
    font-weight: 600;
    padding: 0.5em 1em;
}

.app-card-content {
    background: white;
    padding: 2rem;
}

.app-card-content .input-group-text {
    background-color: #f8f9fa;
}

/* Dashboard tile — clickable module link cards on the main dashboard */
.dashboard-tile {
    border-radius: 20px;
    background: #fff;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    border: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit !important;
    position: relative;
    overflow: hidden;
}

.dashboard-tile::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, #0d6efd, #0dcaf0);
    opacity: 0;
    transition: opacity 0.3s;
}

.dashboard-tile:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border-color: rgba(13, 110, 253, 0.1);
}

.dashboard-tile:hover::before {
    opacity: 1;
}

.dashboard-tile-icon {
    width: 64px;
    height: 64px;
    background: #f8fafc;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: #0d6efd;
    font-size: 1.75rem;
    transition: all 0.3s ease;
    border: 1px solid #f1f5f9;
}

.dashboard-tile:hover .dashboard-tile-icon {
    background: #0d6efd;
    color: #fff;
    transform: rotate(-5deg) scale(1.05);
    box-shadow: 0 10px 20px rgba(13, 110, 253, 0.2);
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.btn-primary {
    background-color: var(--enreach-blue);
    border: none;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border-radius: 8px;
}

.btn-primary:hover {
    background-color: #0091c2;
    box-shadow: 0 4px 12px rgba(0, 169, 224, 0.3);
}

.btn-success {
    background-color: var(--success-color);
    border: none;
}

.btn-success:hover {
    background-color: #146c43;
}

.btn-action {
    border-radius: 6px;
    padding: 4px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
}

/* ── Tables ──────────────────────────────────────────────────────── */
.table-hover tbody tr:hover {
    background-color: rgba(13, 110, 253, 0.04);
}

/* ── Forms ───────────────────────────────────────────────────────── */
.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.15);
}

.form-label-custom {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #6c757d;
    margin-bottom: 0.5rem;
    display: block;
}

/* ── Badges ──────────────────────────────────────────────────────── */
.badge {
    font-weight: 500;
    letter-spacing: 0.3px;
    padding: 0.5em 0.8em;
    border-radius: 6px;
}

/* ── Loading Overlay ─────────────────────────────────────────────── */
#loadingOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    display: none;
    z-index: 9999;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(5px);
}

/* ── Animations ──────────────────────────────────────────────────── */
.fade-out {
    transition: opacity 0.5s ease-out;
    opacity: 0;
    pointer-events: none;
}

/* ── Shared Components ───────────────────────────────────────────── */
.search-card {
    border-radius: 12px;
    border: none;
    background: white;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
}

.table-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

/* ── Dashboard Layout ────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
}

/* ── Utility Classes ─────────────────────────────────────────────── */
.ls-1 {
    letter-spacing: 0.5px;
}

.outfit {
    font-family: 'Outfit', sans-serif;
}
