:root {
    --primary: #2c3e50;
    --secondary: #34495e;
    --accent: #3498db;
    --success: #27ae60;
    --danger: #e74c3c;
    --light: #f4f7f6;
    --white: #ffffff;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--light);
    margin: 0;
    color: var(--primary);
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:visited {
    color: var(--accent);
}

a:hover {
    color: var(--secondary);
    text-decoration: none;
}

a.disabled, .tile.disabled {
    opacity: 0.5;
    pointer-events: none;
    cursor: not-allowed;
    filter: grayscale(1);
}

.container {
    max-width: 90%;
    margin: 0 auto;
    padding: 0 20px;
}

.table-responsive {
    overflow: auto;
    width: 100%;
    margin-bottom: 15px;
    max-height: calc(100vh - 250px);
    border: 1px solid #ddd;
    border-radius: 4px;
}

.navbar {
    background-color: var(--primary);
    color: var(--white);
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.navbar .brand {
    font-size: 24px;
    font-weight: bold;
    color: var(--white);
    text-decoration: none;
}

.nav-links {
    list-style: none;
    display: flex;
    gap: 20px;
    margin: 0;
}

.nav-links a {
    color: var(--white);
    text-decoration: none;
}

/* Dropdown Menu Styles */
.dropdown {
    position: relative;
    display: inline-block;
}

.dropdown-content {
    display: none;
    position: absolute;
    background-color: var(--secondary);
    min-width: 200px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    z-index: 1100;
    border-radius: 8px;
    margin-top: 0;
    padding: 8px 0;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 1px solid rgba(255,255,255,0.1);
}

.dropdown-content a {
    color: var(--white);
    padding: 12px 20px;
    text-decoration: none;
    display: block;
    font-size: 14px;
    transition: all 0.2s ease;
}

.dropdown-content a:hover {
    background-color: var(--accent);
    padding-left: 25px;
}

.dropdown:hover .dropdown-content {
    display: block;
    animation: fadeInDown 0.3s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translate(-50%, -10px);
    }
    to {
        opacity: 1;
        transform: translate(-50%, 0);
    }
}

.nav-links li {
    display: flex;
    align-items: center;
    position: relative;
}

.nav-links > li > a {
    padding: 8px 12px;
    border-radius: 6px;
    transition: background 0.2s;
}

.nav-links > li > a:hover {
    background: rgba(255,255,255,0.1);
}

/* Dashboard Tiles */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.tile {
    background: var(--white);
    padding: 50px 30px;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    text-align: center;
    transition: all 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    text-decoration: none;
    border: 1px solid #f0f0f0;
}

.tile:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    border-color: var(--accent);
}

.tile i {
    font-size: 70px;
    color: var(--accent);
    margin-bottom: 25px;
}

.tile h3 {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
}

.tile p {
    color: #64748b;
    font-size: 15px;
    margin-top: 15px;
    line-height: 1.5;
}

/* Knowledge Map Styles */
.knowledge-search {
    margin-bottom: 30px;
}

.knowledge-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.knowledge-card {
    background: var(--white);
    padding: 20px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid #eee;
    transition: transform 0.2s;
}

.knowledge-card:hover {
    transform: translateY(-3px);
}

.knowledge-card h3 {
    margin-top: 0;
    color: var(--primary);
}

.knowledge-card .category {
    display: inline-block;
    background: #e2e8f0;
    color: #475569;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    margin-bottom: 10px;
    font-weight: bold;
    text-transform: uppercase;
}

.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}

.tag {
    background: #eff6ff;
    color: var(--accent);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 12px;
    border: 1px solid #dbeafe;
}

.knowledge-details {
    max-width: 900px;
    margin: 0 auto;
}

.similar-items {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 2px solid #eee;
}

.main-content {
    padding-top: 20px;
    min-height: 80vh;
}

.card {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

h1, h2 {
    margin-top: 0;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
}

input[type="text"], input[type="password"], textarea, select {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-sizing: border-box;
}

button, .btn {
    background-color: var(--accent);
    color: white !important;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
}

.btn-secondary {
    background-color: var(--secondary);
}

.alert {
    background-color: #d1ecf1;
    color: #0c5460;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    min-width: 800px;
}

th, td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

/* Sticky last column (Actions) */
#tests-table th:last-child,
#tests-table td:last-child {
    position: sticky;
    right: 0;
    z-index: 5;
    box-shadow: -2px 0 5px -2px rgba(0,0,0,0.1);
}

#tests-table th:last-child {
    z-index: 15;
    background-color: #f4f7f6; /* Matching var(--light) */
}

#tests-table tr:nth-child(even) td:last-child {
    background-color: #f9f9f9;
}

#tests-table tr:nth-child(odd) td:last-child {
    background-color: #ffffff;
}

#tests-table tr:hover td:last-child {
    background-color: #f0f0f0;
}

th {
    background-color: var(--light);
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 2px -1px rgba(0,0,0,0.1);
}

.header-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.param-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
}

.btn-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    color: white !important;
    text-decoration: none;
    border: none;
    cursor: pointer;
    margin-right: 2px;
}

.btn-edit { background-color: var(--accent); }
.btn-duplicate { background-color: var(--success); }
.btn-delete { background-color: var(--danger); }
.btn-run { background-color: #f39c12; }
.btn-remove { background-color: var(--danger); color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; }

.status-Pass { color: var(--success); font-weight: bold; }
.status-Fail { color: var(--danger); font-weight: bold; }
.status-Blocked { color: #f39c12; font-weight: bold; }
/* Dropdown Checkbox List */
.dropdown-check-list {
    display: inline-block;
    position: relative;
    width: 100%;
}
.dropdown-check-list .anchor {
    position: relative;
    cursor: pointer;
    display: block;
    padding: 8px 30px 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 13px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.dropdown-check-list .anchor:after {
    position: absolute;
    content: "";
    border-left: 2px solid black;
    border-top: 2px solid black;
    padding: 3px;
    right: 12px;
    top: 35%;
    transform: rotate(-135deg);
}
.dropdown-check-list .items {
    padding: 8px;
    display: none;
    position: absolute;
    z-index: 1000;
    background: #fff;
    border: 1px solid #ddd;
    border-top: none;
    width: 100%;
    box-sizing: border-box;
    max-height: 200px;
    overflow-y: auto;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}
.dropdown-check-list.visible .items {
    display: block;
}
.dropdown-check-list .items label {
    display: block;
    padding: 4px 0;
    font-weight: normal;
    font-size: 13px;
    cursor: pointer;
}
.dropdown-check-list .items input {
    width: auto;
    margin-right: 8px;
}

/* Draggable Column List (Horizontal) */
.sortable-container {
    overflow-x: auto;
    width: 100%;
    background: #fcfcfc;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #eee;
}
#sortable-cols {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
}
#sortable-cols li {
    background: #f9f9f9;
    border: 1px solid #ddd;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: move;
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
    flex-shrink: 0;
}
#sortable-cols li:hover {
    background: #eee;
}
#sortable-cols li .handle {
    color: #ccc;
    cursor: move;
}
.btn-icon:hover {
    opacity: 0.8;
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.login-container {
    width: 100%;
    max-width: 400px;
    background: white;
    padding: 40px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.settings-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 40px;
    margin-top: 30px;
    align-items: start;
}

.settings-sidebar {
    position: sticky;
    top: 100px;
}

.settings-sidebar ul {
    list-style: none;
    padding: 10px;
    margin: 0;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
}

.settings-sidebar li {
    margin-bottom: 5px;
}

.settings-sidebar li:last-child {
    margin-bottom: 0;
}

.settings-sidebar a {
    display: flex;
    align-items: center;
    padding: 12px 18px;
    text-decoration: none;
    color: #64748b;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.settings-sidebar a:hover {
    background: #f1f5f9;
    color: var(--primary);
    transform: translateX(5px);
}

.settings-sidebar a.active {
    background: #eff6ff;
    color: var(--accent);
    box-shadow: inset 4px 0 0 var(--accent);
}

.settings-content {
    min-width: 0; /* Prevents flex/grid blowouts */
}

.card {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border: 1px solid rgba(0,0,0,0.03);
    margin-bottom: 30px;
}

.card h2 {
    font-size: 1.25rem;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f1f5f9;
    color: var(--primary);
}

.badge {
    background: #f1f5f9;
    color: #475569;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-type {
    background: #dcfce7;
    color: #166534;
}

/* Modern Inputs */
input[type="text"], input[type="password"], textarea, select {
    border: 1.5px solid #e2e8f0;
    padding: 12px 15px;
    border-radius: 8px;
    transition: border-color 0.2s;
}

input:focus, select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

footer {
    text-align: center;
    padding: 20px 0;
    color: #777;
}

/* Sorting Links Styling */
th a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 5px;
}

th a:hover {
    color: var(--accent);
}

.sort-icon {
    font-size: 10px;
    opacity: 0.6;
    display: inline-flex;
    flex-direction: column;
    line-height: 1;
}

.sort-icon.active {
    opacity: 1;
    color: var(--accent);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.5);
}

.modal-content {
    background-color: var(--white);
    margin: 10% auto;
    padding: 30px;
    border-radius: 12px;
    width: 400px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}

.modal-header {
    margin-bottom: 20px;
}

.modal-header h2 {
    margin: 0;
}

.modal-footer {
    margin-top: 20px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}
