:root {
    --primary-bg: #1a1a2e;
    --secondary-bg: #16213e;
    --accent-light: #67ccff;
    --accent: #00aaff;
    --accent-hover: #007bff;
    --danger: #dc3545;
    --danger-hover: #c82333;
    --success: #28a745;
    --success-hover: #218838;
    --white: #ffffff;
    --border-radius: 10px;
    --font-main: Arial, sans-serif;
    --shadow: 0 0 20px rgba(0, 123, 255, 0.3);
}

/* --- RESET --- */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

*::placeholder {
    color: var(--white) !important;
}

body,
html {
    font-family: var(--font-main);
    background: var(--primary-bg);
    color: var(--white);
    min-height: 100vh;
    text-align: center;
    overflow-x: hidden;
    width: 100%;
    height: 100%;
}

/* --- CONTAINER --- */
.container {
    max-width: 90%;
    max-height: 85%;
    margin: 90px auto 30px auto;
    padding: 30px;
    background: var(--secondary-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    transition: transform 0.3s;
}

@keyframes blinking-border {
    0% {
        border: 20px solid transparent;
    }

    50% {
        border: 20px solid white;
    }

    100% {
        border: 20px solid transparent;
    }
}

.login-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--secondary-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 32px 28px;
    min-width: 280px;
    max-width: 350px;
    width: 90vw;
    text-align: center;
    z-index: 1002;

    animation: blinking-border 600ms infinite;
}

/* --- POSITIONS --- */
.top-right {
    position: absolute;
    top: 20px;
    right: 100px;
    z-index: 1001;
    display: flex;
    flex-direction: row-reverse;
    align-items: center;
    gap: 10px;
}

.top-left {
    position: absolute;
    top: 20px;
    left: 20px;
    z-index: 1001;
}

.bottom-right {
    position: absolute;
    bottom: 20px;
    right: 20px;
    z-index: 1001;
}

.bottom-left {
    position: absolute;
    bottom: 20px;
    left: 20px;
    z-index: 1001;
}

.center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1001;
}

/* --- HEADERS --- */
h1,
h2,
h3 {
    color: var(--white);
    text-align: center;
    margin: 25px auto 25px auto;
    text-shadow: 0 0 10px rgba(0, 123, 255, 0.5);
}

h1 {
    font-size: 2.5em;
}

h2 {
    font-size: 2em;
}

h3 {
    font-size: 1.5em;
}

/* --- FORM --- */
form {
    display: flex;
    flex-direction: column;
    gap: 25px;
    align-items: center;
    width: 100%;
}

.form-group {
    width: 100%;
    max-width: 500px;
    text-align: left;
}

.form-label {
    color: var(--white);
    height: 3rem;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.form-control {
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
    word-break: normal;
    inline-size: 100%;
    margin-top: 5px;
    margin-bottom: 5px;
    color: var(--white);
}

.form-control.d-inline-block:not([name="department_name"]),
.form-control:not(#departmentFilter):not([name="act_activity_text"]):not([name="department_name"]):not(.mb-2),
.form-control.mb-2#userFilter,
.form-control.mb-2#projectFilter,
.form-control.d-inline-block.mb-2:not(#departmentFilter):not([name="department_name"]),
.form-control:not(.d-inline-block):not(.mb-2):not(#departmentFilter)[name="department_name"] {
    height: 7rem;
}

.form-group.small {
    max-width: 250px;
}

.form-row {
    display: flex;
    flex-direction: row;
    gap: 20px;
    align-items: center;
    justify-content: flex-start;
    width: 100%;
    max-height: 20%;
}

.form-row>* {
    flex: 1 1 0;
    min-width: 0;
}

label {
    font-size: 1em;
    color: var(--white);
    font-weight: bold;
    display: block;
}

/* --- LISTS --- */
.user-list,
.project-list {
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #ddd;
    padding: 10px;
    margin-bottom: 10px;
    display: none;
}

.user-list.active,
.project-list.active {
    display: block;
}

/* --- INPUTS --- */
input[type="text"],
input[type="text"]:focus,
textarea[type="text"],
textarea[type="text"]:focus,
input[type="email"],
input[type="email"]:focus,
input[type="password"],
input[type="password"]:focus,
select,
select:focus {
    width: 100%;
    padding: 12px 16px;
    background: #2a2a3e;
    border: 2px solid var(--accent);
    border-radius: 8px;
    color: var(--white);
    font-size: 0.9em;
    outline: none;
    transition: border-color 0.3s, box-shadow 0.3s;
    margin-bottom: 5px;
}


input[type="text"]::placeholder,
textarea::placeholder,
input[type="email"]::placeholder,
input[type="password"]::placeholder,
select::placeholder {
    color: var(--white);
}

input:focus,
select:focus {
    border-color: var(--accent-hover);
    box-shadow: 0 0 10px rgba(0, 123, 255, 0.7);
}

input[name^="rfid_card"] {
    padding: 8px 12px;
    font-size: 0.9em;
    font-family: monospace;
    letter-spacing: 1px;
}

/* --- BUTTONS --- */
button,
.btn,
.modal-button {
    padding: 7px 10px;
    font-size: 1em;
    background: var(--accent);
    color: var(--white);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
    border: 2px solid var(--accent);
    margin-top: 2px;
    display: block;
}

button:hover,
.btn:hover,
.modal-button:hover {
    background: var(--accent-hover);
    box-shadow: 0 0 15px rgba(0, 123, 255, 0.5);
    transform: scale(1.0);
}

button[name="delete_user"],
.btn-danger,
.delete {
    background: var(--danger);
    border-color: var(--danger);
}

button[name="delete_user"]:hover,
.btn-danger:hover,
.delete {
    background: var(--danger-hover);
    border-color: var(--danger-hover);
    box-shadow: 0 0 15px rgba(220, 53, 69, 0.5);
}

.btn-success {
    background: var(--success);
    border: 2px solid var(--success);
}

.btn-success:hover {
    background: var(--success-hover);
}

.btn-primary {
    background: var(--accent-hover);
}

.btn-primary:hover {
    background: #0056b3;
}

.logout-button {
    background: var(--danger);
    border-color: var(--danger);
    padding: 10px 15px;
}

.login-link {
    position: absolute;
    top: 90px;
    right: 30px;
    z-index: 1001;
    background: var(--accent);
    color: var(--primary-bg);
    border-radius: 8px;
    padding: 10px 22px;
    font-size: 1.1em;
    border: 2px solid var(--accent);
    box-shadow: var(--shadow);
    transition: all 0.3s;
}

.login-link:hover {
    background: var(--accent-hover);
    color: var(--white);
    transform: scale(1.0);
}

.back,
.back-btn,
.top-left a {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #f8f9fa;
    color: var(--accent-hover);
    border: 1px solid var(--accent);
    border-radius: 6.5px;
    font-size: 17.3px;
    transform: scale(1.0);
    display: inline-block;
    transition: all 0.3s;
    padding: 6.5px 13px;
}

.back:hover,
.back-btn:hover,
.top-left a:hover {
    background: #e2e6ea;
    color: var(--accent-hover);
}

/* --- SPECIAL --- */
.hidden-input {
    opacity: 0;
    position: absolute;
    left: -9999px;
    pointer-events: none;
}

.logo {
    height: 8vh;
    max-height: 12vh;
    margin-left: auto;
    margin-right: auto;
    display: block;
    text-align: center;
    margin-bottom: 30px;
}

.logo img {
    height: 100%;
    max-height: 100%;
    display: block;
    margin: 0 auto;
}

.material-icons{
    font-size: 4rem;
}

/* --- LINKS --- */
a,
.nav a {
    text-decoration: none;
    padding: 8px 16px;
    background: var(--accent);
    color: var(--primary-bg);
    border-radius: 5px;
    font-size: 1.1em;
    border: 1px solid var(--accent);
    display: inline-block;
    margin-bottom: 10px;
    transition: all 0.3s;
}

a:hover,
.nav a:hover {
    background: var(--accent-hover);
    color: var(--white);
    transform: scale(1.0);
}

/* --- GRID & TILES --- */
.grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    width: 85vw;
    max-width: 95vw;
    margin-top: 15px;
}

.row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    width: 100%;
}

.tile {
    background: linear-gradient(145deg, var(--accent-hover), #0056b3);
    color: var(--white);
    border: none;
    padding: 20px 30px;
    font-size: 1em;
    font-weight: bold;
    border-radius: 15px;
    cursor: pointer;
    transition: all 0.3s;
    box-shadow: 0 2px 4px rgba(0, 150, 255, 0.2);
    flex: 1 1 48%;
    min-width: 15%;
    min-height: 10%;
    text-align: center;
    margin: 7px;
    height: 15vh;
    display: grid;
    align-items: center;
    justify-content: center;
}

.tile:hover {
    background: #0056b3;
    transform: scale(1.0);
}

/* --- HEADER BAR --- */
.header-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(26, 26, 46, 0.8);
    backdrop-filter: blur(5px);
    box-shadow: var(--shadow);
    width: 100%;
    position: fixed;
    top: 0;
    left: 0;
    z-index: 1000;
    transition: all 0.3s;
}

.header-bar img {
    height: 50px;
    transition: transform 0.3s;
}

.header-bar img:hover {
    transform: scale(1.0);
}

.date-time {
    font-size: 30px;
    color: var(--white);
    padding-right: 30px;
}

/* --- TABLES --- */
.table-container {
    width: 90%;
    max-width: 95%;
    margin: 10px auto;
    overflow-x: auto;
    background: var(--secondary-bg);
    border-radius: 10px;
    padding: 10px;
    box-shadow: var(--shadow);
    margin-top: 50px;
}

table {
    width: 100%;
    border-collapse: collapse !important;
    background: var(--primary-bg) !important;
    color: var(--white) !important;
    border: 2px solid var(--white) !important;
    --bs-table-color: var(--white) !important;
    --bs-table-bg: var(--primary-bg) !important;
}

th,
td {
    border: 2px solid var(--white);
    padding: 8px;
    text-align: left;
    vertical-align: top;
    word-wrap: break-word;
}

th {
    background: var(--primary-bg);
    background: #00aaff;
}

td {
    background: var(--primary-bg);
    
}

/* --- MODAL --- */
.modal,
.modal-container {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
}

.modal-content,
.project-modal-content,
.activity-modal-content,
.time-modal-content {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--secondary-bg);
    padding: 20px;
    border: 2px solid var(--white);
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow);
    min-width: 60vw;
    max-width: 90vw;
    min-height: 15vh;
    max-height: 90vh;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.time-options {
    display: grid !important;
    grid-template-columns: repeat(6, 1fr);
    gap: 1rem;
}

.activity-options,
.project-options {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.project-modal,
.activity-modal,
.time-modal {
    display: none;
}

.close {
    cursor: pointer;
    font-size: 30px;
    position: absolute;
    right: 20px;
    top: 10px;
    color: var(--white);
}

/* --- ERROR & SUCCESS MESSAGES --- */
.error-message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 20px;
    color: var(--danger);
    background: #ffe6e6;
    border: 2px solid var(--danger);
    border-radius: 6px;
    z-index: 1001;
    text-align: center;
    font-size: 1.2em;
    max-width: 600px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.error-message::before {
    content: "⚠";
    font-size: 20px;
    margin-right: 10px;
    vertical-align: middle;
}

.message {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--success);
    color: var(--white);
    padding: 20px;
    font-size: 1.2em;
    font-weight: bold;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    z-index: 1001;
    max-width: 90vw;
}

.error {
    color: var(--danger);
}

/* --- TEXT STYLES --- */

.text-info {
    color: var(--accent-light);
}

.datetime {
    font-size: 25px;
    margin-bottom: 10px;
}

/* --- NOTIFICATIONS --- */
.notifications {
    margin-top: 20px;
}

.notification {
    padding: 10px;
    margin-bottom: 10px;
    border-radius: 5px;
}

.manager {
    background: #ffeb3b;
    color: black;
}

.approved {
    background: var(--success);
    color: var(--white);
}

.rejected {
    background: var(--danger);
    color: var(--white);
}

.project-option.selected {
    background: #025a86; /* Tmavšia modrá pre vybraný projekt */
    color:black;
}
.department-option.selected {
    background: #025a86; /* Tmavšia modrá pre vybrané oddelenie */
    color: black;
}
.department-option.primary.selected {
    background: #276b2a; /* Tmavšia zelená pre vybrané primárne oddelenie */
    color:black;
}

/* --- RESPONSIVE --- */
@media (max-width: 768px) {
    .container {
        margin: 30px auto;
        padding: 15px;
        width: 90%;
    }

    h1 {
        font-size: 2em;
    }

    h2 {
        font-size: 1.5em;
    }

    .table-container {
        width: 95%;
    }

    th,
    td {
        padding: 8px;
        font-size: 14px;
    }

    .back,
    .back-btn,
    .top-left a {
        padding: 5px 10px;
        font-size: 16px;
    }

    .tile {
        width: 40vw;
        min-height: 100px;
        font-size: 1em;
    }

    .modal-content {
        padding: 10px;
    }

    .error-message,
    .message {
        font-size: 1em;
        padding: 10px;
    }
}

@media (max-width: 480px) {
    .container {
        margin: 20px auto;
        padding: 10px;
        width: 95%;
    }

    h1 {
        font-size: 1.5em;
        margin-top: 50px;
    }

    h2 {
        font-size: 1.2em;
    }

    .table-container {
        width: 100%;
    }

    th,
    td {
        padding: 6px;
        font-size: 12px;
    }

    .back,
    .back-btn,
    .top-left a {
        padding: 5px 10px;
        font-size: 15px;
        max-width: 216px;
    }

    .tile {
        width: 100%;
        min-height: 80px;
        font-size: 0.9em;
    }

    .modal-content {
        padding: 8px;
    }

    .error-message,
    .message {
        font-size: 0.9em;
        padding: 8px;
    }
}

/* --- CUSTOM SCROLLBAR --- */
::-webkit-scrollbar {
    width: 40px;
}

::-webkit-scrollbar-track {
    background: var(--secondary-bg);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb {
    background: var(--accent);
    border-radius: 5px;
}

/* --- date-from --- */
        .date-form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 20px 0;
}

.date-form label {
    font-weight: bold;
    margin-right: 8px;
}

.date-form input[type="date"],.date-filter-table input[type="date"] {
    padding: 6px 10px;
    border: 1px solid white;
    border-radius: 4px;
    font-size: 1rem;
    background: transparent;
    color: white;
}

.date-form button {
    padding: 6px 16px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 20px;
}
/* Pre Chrome, Edge, Opera */
.date-form input[type="date"]::-webkit-calendar-picker-indicator {
    filter: invert(1);
}


/* Štýly pre loading animáciu */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ========================================
   NOTIFIKAČNÝ BADGE
   ======================================== */
.notification-badge {
    position: relative;
    background: #ff9800;
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.4);
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
    border: 1px solid #ff9800;
    margin-right: 10px;
    margin-bottom: 10px;
}

.notification-badge:hover {
    background: #f57c00;
    border-color: #f57c00;
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(255, 152, 0, 0.6);
}

.notification-badge .material-icons {
    font-size: 28px;
    color: white;
}

.badge-count {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    height: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
    border: 2px solid #1a1a2e;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.4);
}
