﻿/* =========================================
   FYP Premium DataTables Theme (global)
   Apply by adding class: .fyp-dt to your table
   ========================================= */

:root {
    /* -----------------------------------------
       BRAND / PRIMARY (CALM – COOL MIST)
       ----------------------------------------- */
    --brand-main: #8FB6D9; /* Soft wave blue */
    --brand-dark: #6D97BF; /* Deeper wave edge */
    --brand-soft: #E6F0FA; /* Misty light blue */
    --brand-text: #1E3A5F; /* Calm deep blue text */
    /* -----------------------------------------
       NEUTRAL / TRUST (BLUE-GREY)
       ----------------------------------------- */
    --neutral-main: #2E415A; /* Primary text */
    --neutral-soft: #6B86A3; /* Secondary text */
    --neutral-light: #D6E3F0; /* Light UI fills */
    --neutral-bg: #F4F8FC; /* Page background */
    /* -----------------------------------------
       SURFACE / READING
       ----------------------------------------- */
    --surface-main: #FFFFFF;
    --surface-soft: #EEF4FA;
    --border-soft: rgba(46, 65, 90, 0.12);
    --text-primary: #24364A;
    --text-secondary: #5E738A;
    --text-disabled: #A6B5C6;
    /* -----------------------------------------
       SUCCESS (POSITIVE FEEDBACK – COOL CALM)
       ----------------------------------------- */
    --success-main: #7FB8C8;
    --success-soft: #E3F2F6;
    --success-text: #1F4E5F;
    /* -----------------------------------------
       WARNING (GENTLE – MUTED)
       ----------------------------------------- */
    --warning-main: #E6C98A;
    --warning-soft: #FBF3DD;
    --warning-text: #6B5A2A;
    /* -----------------------------------------
       DANGER (CLEAR BUT NOT HARSH)
       ----------------------------------------- */
    --danger-main: #B66A6A;
    --danger-dark: #8F4A4A;
    --danger-soft: #F4DADA;
    --danger-text: #5A1F1F;
    /* -----------------------------------------
       EFFECTS
       ----------------------------------------- */
    --glass-bg: rgba(255, 255, 255, 0.72);
    --glass-blur: blur(14px);
    --shadow-soft: 0 12px 34px rgba(46, 65, 90, 0.08);
}



/* Card surface wrapper (optional, if you wrap in .um-surface already, ignore) */
.fyp-dt-surface {
    background: var(--surface-main);
    padding: 12px 14px;
}

/* Table core */
table.dataTable.fyp-dt {
    border-collapse: separate !important;
    border-spacing: 0 10px !important;
    width: 100% !important;
}

    /* Header */
    table.dataTable.fyp-dt thead th {
        border: none !important;
        color: var(--brand-dark) !important;
        font-weight: 900 !important;
        text-transform: uppercase;
        letter-spacing: .08em;
        font-size: .78rem;
        padding: 10px 14px !important;
        background: var(--brand-soft);
    }

    /* Body cells */
    table.dataTable.fyp-dt tbody td {
        border: none !important;
        padding: 10px 14px !important;
        vertical-align: middle;
        color: var(--dt-text);
        
    }

    /* Row “pill card” look */
    table.dataTable.fyp-dt tbody tr {
        background: var(--surface-main);
        border: 1px solid var(--border-soft);
        /* MATCH KPI SHAPE */
        border-radius: 50px;
        /* MATCH KPI SHADOW */
        box-shadow: rgba(0, 0, 0, 0.10) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
        overflow: hidden;
    }

        table.dataTable.fyp-dt tbody tr:hover {
            background: var(--brand-soft);
        }


/* Controls (Search + Length) */
.dataTables_wrapper .dataTables_length label,
.dataTables_wrapper .dataTables_filter label {
    font-weight: 800;
    color: var(--dt-muted);
}

.dataTables_wrapper .dataTables_length select,
.dataTables_wrapper .dataTables_filter input {
    border: 1px solid var(--dt-border) !important;
    border-radius: 12px !important;
    padding: 8px 10px !important;
    background: var(--dt-bg) !important;
    outline: none !important;
}

    .dataTables_wrapper .dataTables_filter input:focus,
    .dataTables_wrapper .dataTables_length select:focus {
        box-shadow: 0 0 0 4px rgba(111,175,138,.18) !important;
        border-color: rgba(111,175,138,.45) !important;
    }

/* Pagination */
.dataTables_wrapper .dataTables_paginate .paginate_button {
    border-radius: 12px !important;
    border: 1px solid transparent !important;
    padding: 6px 10px !important;
    margin: 0 3px !important;
}

    .dataTables_wrapper .dataTables_paginate .paginate_button.current {
        background: rgba(111,175,138,.16) !important;
        border-color: rgba(111,175,138,.30) !important;
        font-weight: 900 !important;
    }



/* ==========================
   datatable split layout (Left card + Right table)
   ========================== */

/* 1/4 + 3/4 layout */
.fyp-split {
    display: grid;
    grid-template-columns: 1fr 3fr;
    gap: 14px;
    align-items: stretch;
    margin-top:3rem;
}

.fyp-side,
.fyp-main {
    min-width: 0; /* prevent overflow */
}

/* Right side stays neutral (no card/background) */
.fyp-main {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

/* Card base (LEFT) */
.fyp-card {
    position: relative;
    height: 100%;
    display: flex;
    flex-direction: column;
    /* Image-only background */
    background-image: url("/images/waves.png");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 1rem;
    overflow: visible;
    /* Soft glass shadow */
    box-shadow: rgba(136, 165, 191, 0.45) 6px 2px 16px 0px, rgba(255, 255, 255, 0.6) -6px -2px 16px 0px;
}


.fyp-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 10px;
    overflow: visible;
}

.fyp-card-title h1 {
    font-weight: 700;
    letter-spacing: -.02em;
    font-size: 1rem;
    color: var(--brand-dark);
}

.fyp-card-sub {
    color: rgba(95,111,120,.95);
    font-weight: 700;
    font-size: .92rem;
    margin: 4px 0 0;
}

.fyp-card-body {
    padding: 12px 18px 18px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1 1 auto;
}

/* Header actions: [+] [i] */
.fyp-head-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
}

/* Icon buttons (plus + info share same sizing) */
.fyp-icon-btn,
.fyp-info-btn {
    width: 30px;
    height: 30px;
    border-radius: 50px;
    border:none;
    background: var(--surface-main);
    display: grid;
    place-items: center;
    color: rgba(47,65,86,.85);
    text-decoration: none;
    padding: 0;
    box-shadow: rgba(50, 50, 93, 0.25) 0px 2px 5px -1px, rgba(0, 0, 0, 0.3) 0px 1px 3px -1px;
}

    .fyp-icon-btn:hover,
    .fyp-info-btn:hover {
        background: var(--brand-main);
        color: var(--surface-main);
    }

    .fyp-icon-btn i,
    .fyp-info-btn i {
        font-size: 1.2rem;
    }

/* =========================
   FYP Circular Action Buttons
   ========================= */

.fyp-action-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all .18s ease;
    text-decoration: none;
    font-size: 15px;
    box-shadow: rgba(0, 0, 0, 0.16) 0px 3px 6px, rgba(0, 0, 0, 0.23) 0px 3px 6px;
}

/* EDIT (Sage Green) */
.fyp-action-edit {
    background: var(--brand-soft);
    color: var(--brand-main);
}

    .fyp-action-edit:hover {
        background: var(--brand-main);
        color: #fff;
        transform: translateY(-1px);
    }

/* DELETE (Muted red but soft) */
.fyp-action-delete {
    background: rgba(220, 53, 69, 0.12);
    color: #dc3545;
}

    .fyp-action-delete:hover {
        background: #dc3545;
        color: #fff;
        transform: translateY(-1px);
    }

/* Optional focus ring */
.fyp-action-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(111, 175, 138, 0.35);
}


/* Dropdown menu polish + make sure it sits above */
.fyp-info-dd {
    position: relative;
    z-index: 50;
}

.fyp-info-menu {
    border-radius: 1rem;
    border: 1px solid rgba(47,65,86,.12);
    box-shadow: 0 16px 40px rgba(0,0,0,.12);
    padding: 10px;
    z-index: 9999;
}

/* KPI stack (Tip then Rule) */
.fyp-kpi-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px;
}

.fyp-kpi {
    border-radius: 50px;
    padding: 5px 25px;
    background: var(--surface-main);
    box-shadow: rgba(0, 0, 0, 0.1) 0px 4px 6px -1px, rgba(0, 0, 0, 0.06) 0px 2px 4px -1px;
}

.fyp-kpi-label {
    font-size: .72rem;
    font-weight: 900;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: rgba(95,111,120,.95);
}

.fyp-kpi-value {
    font-weight: 500;
    color: var(--text-primary, #2E3A3F);
}

/* Remove dropdown caret icon */
.fyp-info-btn.dropdown-toggle::after {
    display: none !important;
}


/* =========================================
   UNIVERSAL MOBILE: turn rows into cards
   Works for any table with .fyp-dt
   Requires JS to add data-labels
   ========================================= */
@media (max-width: 900px) {

    /* ==========================================================
       FIX: Make the FIRST DataTables row (Length + Search) horizontal
       Works with Bootstrap + DataTables default DOM
       ========================================================== */

    /* This is the controls row in DataTables */
    .dataTables_wrapper > .row:first-of-type {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        gap: 10px !important;
        flex-wrap: nowrap !important;
        margin-bottom: 12px !important;
    }

        /* Override Bootstrap "col-sm-12" stacking */
        .dataTables_wrapper > .row:first-of-type > [class*="col-"] {
            flex: 1 1 0 !important;
            width: auto !important;
            max-width: none !important;
        }

    /* Give each control half width */
    .dataTables_wrapper .dataTables_length,
    .dataTables_wrapper .dataTables_filter {
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

        /* Hide label text but keep input/select visible */
        .dataTables_wrapper .dataTables_length label,
        .dataTables_wrapper .dataTables_filter label {
            font-size: 0 !important;
            margin: 0 !important;
            display: block !important;
            white-space: nowrap !important;
        }

        /* Make select + input fill their column */
        .dataTables_wrapper .dataTables_length select,
        .dataTables_wrapper .dataTables_filter input {
            width: 100% !important;
            height: 36px !important;
            font-size: 14px !important; /* bring text back */
            padding: 6px 10px !important;
            box-sizing: border-box !important;
        }

    /* Optional: align search box nicer */
    .dataTables_wrapper .dataTables_filter {
        text-align: left !important;
    }


    /* ===============================
       Card mode (your table -> cards)
       =============================== */

    table.dataTable.fyp-dt thead {
        display: none !important;
    }

    table.dataTable.fyp-dt,
    table.dataTable.fyp-dt tbody,
    table.dataTable.fyp-dt tr,
    table.dataTable.fyp-dt td {
        display: block !important;
        width: 100% !important;
    }

        table.dataTable.fyp-dt tbody tr {
            padding: 16px 16px 12px !important;
            margin: 12px 0 !important;
            border-radius: 18px !important;
            box-shadow: var(--dt-shadow) !important;
        }

        table.dataTable.fyp-dt tbody td {
            padding: 12px 6px !important;
        }

            table.dataTable.fyp-dt tbody td + td {
                border-top: 1px solid rgba(47,65,86,.08) !important;
            }

            table.dataTable.fyp-dt tbody td::before {
                content: attr(data-label);
                display: block;
                font-size: .72rem;
                font-weight: 900;
                letter-spacing: .08em;
                text-transform: uppercase;
                color: var(--dt-muted);
                margin-bottom: 6px;
            }

            table.dataTable.fyp-dt tbody td.dt-actions-cell::before {
                display: none !important;
            }

    .dataTables_wrapper .dataTables_info,
    .dataTables_wrapper .dataTables_paginate {
        float: none !important;
        text-align: center !important;
    }

    /* Split layout -> stacked */
    .fyp-split {
        grid-template-columns: 1fr;
    }

    .fyp-side-card .fyp-side-body {
        display: none;
    }
    .fyp-side {
        position: relative;
        z-index: 20;
    }

    .fyp-main {
        position: relative;
        z-index: 1;
    }
}


