﻿/* ============================================================
   GLOBAL SETTINGS
   ============================================================ */
:root {
    --sidebar-width: 280px;
    --primary-blue: #0d6efd;
    --primary-light: #56c3f7;
    --primary-dark: #36b2f0;
    --hover-bg: #eef9ff;
}

/* Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 14px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

body {
    margin: 0;
    padding-bottom: 0.5in;
    overflow-x: hidden;
}

main {
    position: relative;
    z-index: 1;
}

/* Cursor defaults */
html, body, main {
    cursor: default;
}

    body.waiting {
        cursor: wait;
    }

/* ============================================================
   FORM HEADER
   ============================================================ */
.form-container h3 {
    text-align: center;
    background-color: deepskyblue;
    color: #2c3e50;
    margin: 10px 0;
    padding: 6px 0;
    font-size: 14px;
    border-radius: 4px;
}

/* ============================================================
   FORM GROUPS
   ============================================================ */
.form-group {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

    .form-group label {
        width: 175px;
        font-size: 14px;
        padding: 2px 6px;
        color: #333;
    }

    .form-group input[type="text"],
    .form-group input[type="password"],
    .form-group input[type="email"],
    .form-group input[type="date"],
    .form-group select {
        width: 300px;
        height: 28px;
        padding: 4px 6px;
        font-size: 13px;
        border: 1px solid #bbb;
        border-radius: 4px;
    }

/* Remove number input arrows */
.no-spinner::-webkit-inner-spin-button,
.no-spinner::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.no-spinner {
    -moz-appearance: textfield;
}

/* Responsive form layout */
@media(max-width: 768px) {
    .form-group {
        flex-direction: column;
        align-items: flex-start;
    }

        .form-group label,
        .form-group input,
        .form-group select {
            width: 100% !important;
        }
}

/* ============================================================
   BUTTONS
   ============================================================ */
button,
.create-link,
.float-btn,
.floating-create-btn {
    cursor: pointer;
}

button {
    padding: 6px 12px;
    background-color: #3498db;
    color: #fff;
    border: none;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
}

    button:hover:not(.float-btn) {
        background-color: #2980b9;
        transform: scale(1.1);
    }

.btn-extra-sm {
    padding: 2px 6px;
    font-size: 10px;
}

.create-link {
    padding: 7px 14px;
    background: dodgerblue;
    color: #fff;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
}

    .create-link:hover {
        background-color: #17a2b8;
    }

/* ============================================================
   DETAIL ROW VIEW
   ============================================================ */
.row {
    display: flex;
    flex-wrap: wrap;
}

    .row dt.col-sm-3 {
        width: 175px;
        font-size: 14px;
        padding: 2px 6px;
        margin-left: 20px;
        height: 25px;
    }

    .row dd.col-sm-6 {
        width: 60%;
        background: #f3f3f3;
        border: 1px solid #ccc;
        padding: 6px 10px;
        height: 25px;
        border-radius: 4px;
    }

/* ============================================================
   FLOATING BUTTONS
   ============================================================ */
.floating-create-btn {
    position: fixed;
    top: 120px;
    left: 20px;
    width: 60px;
    height: 60px;
    font-size: 24px;
    color: white;
    background-color: var(--primary-blue);
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: 0.2s ease;
    z-index: 999;
}

    .floating-create-btn:hover {
        transform: scale(1.12);
        background-color: #0a58ca;
    }

#floatingButtons {
    position: fixed;
    bottom: 30px;
    right: 0;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 15px;
    z-index: 1050;
}

.float-btn {
    width: 60px;
    height: 60px;
    font-size: 1.5rem;
    color: white;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    text-decoration: none;
    box-shadow: 0 4px 6px rgba(0,0,0,0.3);
    opacity: 0;
    transition: 0.3s;
}

/* ============================================================
   TABLE (TEMPLATE BOX)
   ============================================================ */
.template-table-box {
    max-height: calc(100vh - 120px);
    overflow: auto;
    border: 1px solid #bbb;
    border-radius: 6px;
    background: #fff;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

    .template-table-box table {
        width: 100%;
        border-collapse: collapse;
        table-layout: auto;
        background: #fff;
    }

    .template-table-box thead th {
        position: sticky;
        top: 0;
        z-index: 100;
        background: var(--primary-light);
        color: white;
        font-weight: 600;
        text-align: center;
        padding: 6px;
    }

    /* First column sticky */
    .template-table-box th:first-child,
    .template-table-box td:first-child {
        position: sticky;
        left: 0;
        z-index: 90;
        background: #fff;
    }

    /* Header first column stronger */
    .template-table-box thead th:first-child {
        background: var(--primary-dark);
        z-index: 120;
    }

    .template-table-box th,
    .template-table-box td {
        white-space: nowrap;
        padding: 6px 8px;
        font-size: 13px;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* Hover */
    .template-table-box table.table-hover tbody tr:hover td {
        background-color: var(--hover-bg);
    }

        .template-table-box table.table-hover tbody tr:hover td:first-child {
            background-color: var(--hover-bg);
        }

/* ============================================================
   SPL-TEXTBOX (CUSTOM FIELD DESIGN)
   ============================================================ */
.spl-textbox {
    height: 30px;
    border: 2px solid black;
    border-radius: 10px;
    display: flex;
    overflow: hidden;
    background-color: white;
}

.spl-label {
    width: 140px;
    background-color: #00AEEF;
    color: white;
    font-weight: bold;
    font-size: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.spl-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 12px;
    padding-left: 15px;
    min-width: 0;
}

    .spl-input[type="date"] {
        appearance: none;
        height: 100%;
        line-height: normal;
        padding-right: 10px;
    }

        /* Calendar icon */
        .spl-input[type="date"]::-webkit-calendar-picker-indicator {
            opacity: 1;
            cursor: pointer;
        }

/* ============================================================
   TOOLTIP
   ============================================================ */
.spl-textbox-wrapper {
    position: relative;
}

.spl-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.9);
    color: white;
    padding: 6px 12px;
    font-size: 12px;
    border-radius: 6px;
    white-space: nowrap;
    z-index: 1000;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease;
}

    .spl-tooltip::before {
        content: "";
        position: absolute;
        top: -6px;
        left: 50%;
        border: 6px solid transparent;
        border-bottom-color: rgba(0,0,0,0.9);
        transform: translateX(-50%);
    }

.spl-textbox-wrapper:hover .spl-tooltip {
    opacity: 1;
    visibility: visible;
}

/* ============================================================
   SIDEBAR + PAGE CONTENT
   ============================================================ */
.sidebar-fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    z-index: 1030;
}

.page-content,
.main-content-with-left-sidebar {
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    padding: 20px;
    background: #f8f9fa;
}

@media (max-width: 992px) {
    .page-content,
    .main-content-with-left-sidebar {
        margin-left: 0 !important;
    }
}
