* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    color: #333;
}

/* Login Styles */
.login-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.login-form {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    width: 100%;
    max-width: 400px;
    animation: slideUp 0.5s ease;
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(30px); }
    to { opacity: 1; transform: translateY(0); }
}

.login-header {
    text-align: center;
    margin-bottom: 30px;
}

.login-header h1 {
    font-size: 28px;
    color: #2c3e50;
    margin-bottom: 10px;
}

.login-header p {
    color: #7f8c8d;
    font-size: 16px;
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-form .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.login-form .form-group input {
    width: 100%;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.login-form .form-group input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.login-btn {
    width: 100%;
    background: #3498db;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.login-btn:hover {
    background: #2980b9;
}

.login-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
}

.login-error {
    background: #fadbd8;
    color: #e74c3c;
    padding: 15px;
    border-radius: 10px;
    margin-top: 20px;
    text-align: center;
    font-weight: 600;
    border: 1px solid #f5b7b1;
}

/* Main App Styles */
.main-app {
    min-height: 100vh;
}

.container {
    max-width: 480px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    position: relative;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.header p {
    font-size: 16px;
    color: #7f8c8d;
}

/* Burger Menu */
.burger-menu {
    position: absolute;
    top: 0;
    right: 0;
    width: 30px;
    height: 30px;
    cursor: pointer;
    z-index: 1000;
}

.burger-menu span {
    display: block;
    width: 100%;
    height: 3px;
    background: #2c3e50;
    margin: 6px 0;
    transition: 0.3s;
    border-radius: 2px;
}

.burger-menu.active span:nth-child(1) {
    transform: rotate(-45deg) translate(-8px, 6px);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(45deg) translate(-8px, -6px);
}

/* Sidebar */
.sidebar {
    position: fixed;
    top: 0;
    right: -300px;
    width: 300px;
    height: 100vh;
    background: white;
    box-shadow: -2px 0 10px rgba(0,0,0,0.1);
    transition: right 0.3s ease;
    z-index: 999;
    padding: 60px 20px 20px;
}

.sidebar.active {
    right: 0;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 998;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

/* Search Bar */
.search-container {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input {
    width: 100%;
    padding: 15px;
    padding-right: 80px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: #f8f9fa;
}

.search-input:focus {
    outline: none;
    border-color: #3498db;
    background: white;
}

.search-btn {
    position: absolute;
    right: 40px;
    background: #3498db;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.search-btn:hover {
    background: #2980b9;
}

.clear-search-btn {
    position: absolute;
    right: 10px;
    background: #95a5a6;
    color: white;
    border: none;
    border-radius: 50%;
    width: 25px;
    height: 25px;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.clear-search-btn:hover {
    background: #7f8c8d;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    background: white;
    border-radius: 15px;
    padding: 5px;
    margin-bottom: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.nav-tab {
    flex: 1;
    padding: 15px;
    text-align: center;
    color: #7f8c8d;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
    font-size: 16px;
}

.nav-tab.active {
    background: #3498db;
    color: white;
    transform: scale(1.05);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Gate Control */
.gate-control {
    background: white;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.gate-buttons {
    display: grid;
    grid-template-columns: 1fr !important;
    gap: 20px;
    margin-bottom: 30px;
}

/* Force single column layout for all screen sizes */
@media (min-width: 0px) {
    .gate-buttons {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
}

.gate-btn {
    background: #27ae60;
    color: white;
    border: none;
    padding: 25px 20px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(39, 174, 96, 0.3);
    position: relative;
    overflow: hidden;
}

.gate-btn:first-child {
    background: #3498db; /* Blue for Upper Gate */
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.gate-btn:last-child {
    background: #e67e22; /* Orange for Lower Gate */
    box-shadow: 0 4px 15px rgba(230, 126, 34, 0.3);
}

.gate-btn:active {
    transform: scale(0.95);
    box-shadow: 0 2px 8px rgba(39, 174, 96, 0.4);
}

.gate-btn:first-child:active {
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.4);
}

.gate-btn:last-child:active {
    box-shadow: 0 2px 8px rgba(230, 126, 34, 0.4);
}

.gate-btn.triggered {
    background: #e67e22;
    animation: pulse 0.6s ease;
}

.gate-btn:first-child.triggered {
    background: #2980b9;
}

.gate-btn:last-child.triggered {
    background: #d35400;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.gate-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: left 0.5s;
}

.gate-btn:active::before {
    left: 100%;
}

/* User Management */
.user-management {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* Add User Section */
.add-user-section {
    margin-bottom: 30px;
}

.add-user-btn {
    width: 100%;
    background: #3498db;
    color: white;
    border: none;
    padding: 20px;
    border-radius: 15px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 4px 15px rgba(52, 152, 219, 0.3);
}

.add-user-btn:hover {
    background: #2980b9;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.4);
}

.add-user-btn:active {
    transform: translateY(0);
}

.add-user-btn span:first-child {
    font-size: 24px;
    font-weight: bold;
}

/* Add User Form */
.add-user-form {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #ecf0f1;
    animation: slideDown 0.3s ease;
}

/* Edit User Form */
.edit-user-form {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 30px;
    border: 1px solid #ecf0f1;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

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

.form-header h3 {
    color: #2c3e50;
    margin: 0;
}

.close-form-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #7f8c8d;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.close-form-btn:hover {
    background: #ecf0f1;
    color: #2c3e50;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 15px;
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

.form-group input:focus, .form-group select:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
}

.cancel-btn {
    flex: 1;
    background: #95a5a6;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.cancel-btn:hover {
    background: #7f8c8d;
}

.add-btn {
    flex: 2;
    background: #27ae60;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.add-btn:hover {
    background: #229954;
}

.add-btn:active {
    transform: scale(0.98);
}

.save-btn {
    flex: 2;
    background: #f39c12;
    color: white;
    border: none;
    padding: 15px;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.save-btn:hover {
    background: #e67e22;
}

.save-btn:active {
    transform: scale(0.98);
}

/* Users List Container */
.users-list-container {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 25px;
    border: 1px solid #ecf0f1;
}

.users-list-header {
    margin-bottom: 20px;
}

.users-list-header h3 {
    color: #2c3e50;
    font-size: 18px;
    margin: 0;
}

.users-list {
    max-height: 500px;
    overflow-y: auto;
}

.user-item {
    background: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.2s ease;
    border: 1px solid #ecf0f1;
}

.user-item:active {
    transform: scale(0.98);
}

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

.user-name {
    font-weight: 600;
    font-size: 16px;
    color: #2c3e50;
}

.user-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.user-status.active {
    background: #d5f4e6;
    color: #27ae60;
}

.user-status.inactive {
    background: #fadbd8;
    color: #e74c3c;
}

.user-details {
    font-size: 14px;
    color: #7f8c8d;
    line-height: 1.4;
}

.user-actions {
    display: flex;
    gap: 10px;
    margin-top: 15px;
}

.action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
}

.edit-btn {
    background: #f39c12;
    color: white;
}

.delete-btn {
    background: #e74c3c;
    color: white;
}

.action-btn:active {
    transform: scale(0.95);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .container {
        padding: 15px;
    }
    
    .login-form {
        padding: 30px 20px;
    }
    
    .gate-buttons {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .gate-btn {
        padding: 30px 20px;
        font-size: 20px;
    }
    
    .header h1 {
        font-size: 24px;
    }
    
    .sidebar {
        width: 280px;
        right: -280px;
    }
    
    .form-actions {
        flex-direction: column;
    }
}

/* Scrollbar styling */
.users-list::-webkit-scrollbar {
    width: 6px;
}

.users-list::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.users-list::-webkit-scrollbar-thumb {
    background: #bdc3c7;
    border-radius: 3px;
}

.users-list::-webkit-scrollbar-thumb:hover {
    background: #95a5a6;
}

/* Search results */
.search-results {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    max-height: 400px;
    overflow-y: auto;
}

.search-results-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #ecf0f1;
}

.search-results-header h3 {
    color: #2c3e50;
    margin: 0 0 5px 0;
    font-size: 18px;
}

.search-results-header p {
    color: #7f8c8d;
    margin: 0;
    font-size: 14px;
}

.search-results-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.search-results-list .user-item {
    margin-bottom: 0;
}

.no-results {
    text-align: center;
    color: #7f8c8d;
    padding: 40px 20px;
    font-style: italic;
}

.no-results h3 {
    color: #2c3e50;
    margin-bottom: 10px;
}

.no-results p {
    margin: 0;
    font-size: 14px;
} 

/* Edit User View */
.edit-user-view {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.edit-view-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.back-btn {
    background: #95a5a6;
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    margin-right: 20px;
}

.back-btn:hover {
    background: #7f8c8d;
}

.edit-view-header h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 24px;
}

.edit-user-form-full {
    max-width: 600px;
}

.form-section {
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #ecf0f1;
}

.form-section h3 {
    color: #2c3e50;
    margin: 0 0 20px 0;
    font-size: 18px;
    font-weight: 600;
}

.date-input-group {
    display: flex;
    gap: 10px;
    align-items: center;
}

.date-input-group input[type="date"] {
    flex: 1;
}

.clear-date-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 12px 15px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    white-space: nowrap;
}

.clear-date-btn:hover {
    background: #c0392b;
}

/* Responsive adjustments for edit view */
@media (max-width: 480px) {
    .edit-user-view {
        padding: 20px;
    }
    
    .edit-view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .back-btn {
        margin-right: 0;
        margin-bottom: 10px;
    }
    
    .date-input-group {
        flex-direction: column;
        align-items: stretch;
    }
    
    .clear-date-btn {
        width: 100%;
    }
} 

/* Create User View */
.create-user-view {
    background: white;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
}

.create-view-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #ecf0f1;
}

.create-view-header h2 {
    color: #2c3e50;
    margin: 0;
    font-size: 24px;
}

.create-user-form-full {
    max-width: 600px;
}

/* Multi-Select Dropdown */
.multi-select-container {
    position: relative;
}

.multi-select-dropdown {
    border: 2px solid #ecf0f1;
    border-radius: 10px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.multi-select-dropdown.active {
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.multi-select-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    font-size: 16px;
    color: #2c3e50;
}

.selected-text {
    color: #7f8c8d;
}

.dropdown-arrow {
    font-size: 12px;
    transition: transform 0.3s ease;
}

.multi-select-dropdown.active .dropdown-arrow {
    transform: rotate(180deg);
}

.multi-select-options {
    display: none;
    max-height: 200px;
    overflow-y: auto;
    border-top: 1px solid #ecf0f1;
    background: white;
}

.multi-select-dropdown.active .multi-select-options {
    display: block;
}

.multi-select-option {
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    gap: 10px;
}

.multi-select-option:hover {
    background: #f8f9fa;
}

.multi-select-option.selected {
    background: #e3f2fd;
    color: #1976d2;
}

.multi-select-option input[type="checkbox"] {
    margin: 0;
    width: 16px;
    height: 16px;
}

.selected-groups {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.selected-group-tag {
    background: #3498db;
    color: white;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.remove-group-btn {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.remove-group-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Responsive adjustments for create view */
@media (max-width: 480px) {
    .create-user-view {
        padding: 20px;
    }
    
    .create-view-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .multi-select-options {
        max-height: 150px;
    }
} 