/* Common utility classes */
.flex {
    display: flex;
}

.flex-center {
    display: flex;
    align-items: center;
}

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

.flex-column {
    display: flex;
    flex-direction: column;
}

.gap-10 {
    gap: 10px;
}

.gap-20 {
    gap: 20px;
}

/* Header */
.header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: -20px -20px 20px -20px;
    padding: 10px 20px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.header h1,
.page-title {
    margin: 0;
    font-size: 1.5rem;
}

/* Header Layout with Logo */
.header-layout {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.logo-container {
    width: 150px;
    flex: 0 0 auto;
    margin-right: 20px;
}

.header-logo {
    height: 40px;
    width: auto;
    transition: transform 0.2s ease;
}

.header-logo:hover {
    transform: scale(1.05);
}

.page-title {
    flex: 1;
    text-align: center;
}

/* User info icon and dropdown */
.user-info-container {
    width: 50px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.user-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-color);
    color: white;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

/* Common dropdown styles */
.dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 12px 15px;
    z-index: 100;
}

.dropdown::before,
.dropdown::after {
    content: '';
    position: absolute;
}

.dropdown::before {
    top: -6px;
    right: 15px;
    width: 12px;
    height: 12px;
    background: var(--bg-secondary);
    transform: rotate(45deg);
    border-left: 1px solid var(--border-color);
    border-top: 1px solid var(--border-color);
}

.dropdown::after {
    top: -15px;
    left: 0;
    width: 100%;
    height: 15px;
}

/* User info specific styles */
.user-info.dropdown {
    min-width: 220px;
    flex-direction: column;
    align-items: flex-start;
    gap: 5px;
    font-size: 0.9rem;
}

.user-info-container:hover .user-info {
    display: flex;
}

.user-info div {
    font-size: 0.9rem;
    white-space: nowrap;
    padding: 3px 0;
}

.user-info div + div {
    border-top: 1px solid var(--border-color-light);
}

/* Common control styles */
.control-group {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border-color);
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* User controls extend control-group */
.user-controls.control-group {
    /* Any additional user-controls specific styles can go here */
}

/* Button styles */
.button-primary {
    background-color: var(--accent-color);
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s;
    margin-left: 8px;
    transition: .2s;
    white-space: nowrap;
}

.button-primary:hover {
    background-color: var(--accent-color);
    filter: brightness(1.2);
}

.danger-button {
    background-color: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
}

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

.logout-form {
    margin: 0;
}

.logout-btn {
    background-color: transparent;
    color: var(--danger-color);
    border: 1px solid var(--danger-color);
    padding: 6px 12px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
    width: 100%;
}

.logout-btn:hover {
    background-color: var(--danger-color);
    color: white;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Filters */
.filters {
    display: flex;
    align-items: center;
    flex: 1;
    gap: 10px;
}

.filters form {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.filters input[type="text"] {
    width: 200px;
}

/* Login page */
body.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.login-page .theme-toggle-container {
    margin-top: 25px;
    justify-content: center;
}

.login-container {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 400px;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.login-form .form-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.login-form .remember-me {
    display: flex;
    align-items: center;
    margin: 15px 0;
}

/* Dashboard Layout */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

/* Responsive styles */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    .header {
        margin: -10px -10px 10px -10px;
        padding: 10px;
        flex-direction: column;
        gap: 10px;
    }
    .header-layout {
        flex-direction: column;
        gap: 10px;
    }
    .page-title {
        order: -1;
    }
    .user-info-container {
        align-self: center;
    }
    .user-info {
        right: -100px;
        text-align: left;
    }
    .filters {
        width: 100%;
    }
    .filters form {
        flex-wrap: wrap;
    }
    .filters input[type="text"] {
        width: 100%;
        flex: 1 1 100%;
    }
    .filters select {
        flex: 1 1 calc(50% - 5px);
    }
    .header-controls {
        width: 100%;
        justify-content: space-between;
    }
    .table-container {
        margin: 0 -10px;
        border-radius: 0;
    }
    table th:nth-child(5), 
    table td:nth-child(5), 
    table th:nth-child(6), 
    table td:nth-child(6), 
    table th:nth-child(7), 
    table td:nth-child(7) {
        display: none;
    }
    .pagination-buttons {
        gap: 6px;
    }
    .pagination-buttons .btn {
        min-width: 36px;
    }
    .pagination-buttons .btn:not(.active):not(:first-child):not(:last-child):not(.active + .btn):not(.btn + .active) {
        display: none;
    }
    .login-container {
        margin: 20px;
        padding: 20px;
    }
}

@media (min-width: 769px) and (max-width: 1024px) {
    .header {
        flex-wrap: wrap;
    }
    .filters {
        order: 2;
        width: 100%;
    }
    .header-controls {
        order: 1;
        width: auto;
    }
    .pagination-buttons {
        gap: 6px;
    }
}

@media screen and (max-width: 480px) {
    .pagination-buttons {
        gap: 4px;
    }
    .pagination-buttons .btn {
        min-width: 32px;
        height: 32px;
        padding: 0 6px;
        font-size: 12px;
    }
    .pagination-buttons .btn:not(.active):not(:first-child):not(:last-child) {
        display: none;
    }
    .pagination-buttons .btn.active {
        display: flex;
    }
}

.user-info form {
    margin-left: 10px;
    display: inline-flex;
}

/* Simple GMT Clock Styles */
.gmt-clock-simple {
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: var(--text-primary, #333);
    font-weight: normal;
    white-space: nowrap;
}
