/* Modern CSS for Find Nearest EM to Event */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

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

header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

header h1 {
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
}

main {
    display: grid;
    gap: 30px;
}

section {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

h2 {
    color: #4a5568;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

h3 {
    color: #2d3748;
    margin-bottom: 15px;
    font-size: 1.2rem;
}


/* Form Styles */
.form-container {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.address-section, .datetime-section {
    background: #ffffff;
    padding: 20px;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    margin-bottom: 20px;
}

.address-section h4, .datetime-section h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.1rem;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #4a5568;
}

.required {
    color: #f56565;
}

input, textarea, select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    background: white;
}

input:focus, textarea:focus, select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

select {
    cursor: pointer;
}

textarea {
    resize: vertical;
    min-height: 100px;
}

/* Button Styles */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
    transform: translateY(-1px);
}

/* Events List */
.events-list {
    margin-top: 20px;
}

.events-categories {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 25px;
    margin-bottom: 20px;
}

.event-category {
    background: #ffffff;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    overflow: hidden;
}

.event-category h3 {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin: 0;
    padding: 15px 20px;
    font-size: 1.1rem;
}

.events-container {
    padding: 15px;
    min-height: 200px;
}

.event-card {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 12px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.event-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.event-card:last-child {
    margin-bottom: 0;
}

.event-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2d3748;
    margin-bottom: 8px;
}

.event-university {
    font-size: 0.9rem;
    color: #667eea;
    margin-bottom: 8px;
    font-weight: 500;
}

.event-address {
    color: #4a5568;
    margin-bottom: 10px;
    font-size: 0.9rem;
}

.event-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 0.85rem;
    color: #718096;
}

.event-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Loading and Error States */
.loading {
    text-align: center;
    padding: 40px;
    color: #718096;
}

.error {
    text-align: center;
    padding: 40px;
    color: #f56565;
    background: #fed7d7;
    border-radius: 8px;
}
/* Footer */
footer {
    text-align: center;
    margin-top: 40px;
    color: white;
    opacity: 0.8;
}

/* Manager Assignment Styles */
.manager-section {
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #e2e8f0;
}

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

.manager-header h4 {
    margin: 0;
    color: #4a5568;
    font-size: 1rem;
}

.manager-status {
    font-size: 0.85rem;
    padding: 4px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.manager-status.has-managers {
    background-color: #c6f6d5;
    color: #22543d;
}

.manager-status.no-managers {
    background-color: #fed7d7;
    color: #742a2a;
}

.no-managers-warning {
    border-left: 4px solid #f56565 !important;
    background-color: #fef5e7 !important;
}

.managers-list {
    margin-bottom: 15px;
}

.manager-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    background-color: #f7fafc;
    border-radius: 6px;
    margin-bottom: 8px;
}

.manager-info strong {
    color: #2d3748;
    display: block;
    margin-bottom: 4px;
}

.manager-title {
    font-size: 0.9rem;
    color: #4a5568;
    font-weight: 500;
    margin: 2px 0 4px 0;
}

.manager-details {
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.4;
}

.no-managers {
    color: #718096;
    font-style: italic;
    text-align: center;
    padding: 15px;
}

.manager-assignment {
    background-color: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
    margin-top: 10px;
}

.suggestions-container h5 {
    margin: 0 0 15px 0;
    color: #4a5568;
    font-size: 1rem;
}

.suggestions-stats {
    background-color: #e2e8f0;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    color: #4a5568;
    margin-bottom: 15px;
}

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

.suggestion-group h6 {
    margin: 0 0 10px 0;
    color: #2d3748;
    font-size: 0.9rem;
    font-weight: 600;
    padding-bottom: 5px;
    border-bottom: 1px solid #e2e8f0;
}

.suggestion-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background-color: white;
    border-radius: 6px;
    margin-bottom: 8px;
    border: 1px solid #e2e8f0;
}

.suggestion-item.assigned {
    background-color: #f0fff4;
    border-color: #9ae6b4;
}

.suggestion-item.conflicted {
    background-color: #fffaf0;
    border-color: #fbb6ce;
}

.suggestion-info strong {
    color: #2d3748;
    display: block;
    margin-bottom: 4px;
}

.suggestion-details {
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.4;
    margin-top: 4px;
}

.btn-small {
    padding: 6px 12px;
    font-size: 0.85rem;
    border-radius: 4px;
}

.btn-danger {
    background-color: #f56565;
    color: white;
    border: none;
}

.btn-danger:hover {
    background-color: #e53e3e;
}

.loading-small {
    color: #718096;
    font-style: italic;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
}

.error-small {
    color: #e53e3e;
    text-align: center;
    padding: 10px;
    font-size: 0.9rem;
}

.no-suggestions {
    color: #718096;
    font-style: italic;
    text-align: center;
    padding: 15px;
}

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

.event-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2d3748;
    flex: 1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2rem;
    }
    
    section {
        padding: 20px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .events-categories {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .event-meta {
        flex-direction: column;
        gap: 8px;
    }
    
    .address-section, .datetime-section {
        padding: 15px;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.5s ease-out;
}

/* Authentication Styles */
.auth-section {
    margin: 20px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.login-container {
    max-width: 400px;
    margin: 0 auto;
    text-align: center;
}

.login-container h3 {
    color: #2d3748;
    margin-bottom: 20px;
}


.error-message {
    background: #fed7d7;
    color: #c53030;
    padding: 10px;
    border-radius: 6px;
    margin-top: 10px;
    font-size: 0.9rem;
}

/* Tab Navigation */
.tab-navigation {
    display: flex;
    gap: 10px;
    margin-bottom: 30px;
    border-bottom: 2px solid #e2e8f0;
    padding-bottom: 10px;
}

.tab-button {
    background: #f8f9fa;
    border: 1px solid #e2e8f0;
    padding: 12px 20px;
    border-radius: 8px 8px 0 0;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    color: #4a5568;
    transition: all 0.2s ease;
}

.tab-button:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.tab-button.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* Users Section */
.users-section {
    margin-bottom: 30px;
}

.users-display {
    margin-top: 30px;
}

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

.section-header h3 {
    margin: 0;
    color: #2d3748;
}

.users-container {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 200px;
}

.user-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
}

.user-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.user-card:last-child {
    margin-bottom: 0;
}

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

.user-name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #2d3748;
    margin: 0;
}

.user-email {
    font-size: 0.9rem;
    color: #667eea;
    margin: 5px 0;
    font-weight: 500;
}

.user-details {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin-top: 15px;
}

.user-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: #4a5568;
}

.user-detail strong {
    color: #2d3748;
}

.delete-user-btn {
    background: #f56565;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
}

.delete-user-btn:hover {
    background: #e53e3e;
}

.btn.btn-secondary {
    background: #718096;
    color: white;
}

.btn.btn-secondary:hover {
    background: #4a5568;
}

/* Manager Modal Styles */
.manager-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    animation: fadeIn 0.2s ease-out;
}

.manager-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

.manager-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 25px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8f9fa;
}

.manager-modal-header h3 {
    margin: 0;
    color: #2d3748;
    font-size: 1.25rem;
}

.modal-close-btn {
    background: none;
    border: none;
    font-size: 24px;
    color: #718096;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: all 0.2s;
}

.modal-close-btn:hover {
    background: #e2e8f0;
    color: #2d3748;
}

.manager-modal-body {
    padding: 25px;
    max-height: calc(90vh - 80px);
    overflow-y: auto;
}

.current-managers-section,
.suggestions-section {
    margin-bottom: 30px;
}

.current-managers-section h4,
.suggestions-section h4 {
    margin: 0 0 15px 0;
    color: #2d3748;
    font-size: 1.1rem;
    padding-bottom: 8px;
    border-bottom: 2px solid #e2e8f0;
}

.show-more-btn {
    margin-top: 10px;
    width: 100%;
    text-align: center;
}

.more-info {
    color: #718096;
    font-style: italic;
    text-align: center;
    padding: 8px;
    font-size: 0.9rem;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

/* User Label Styles */
.user-label {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    color: white;
    margin-right: 8px;
}

.user-label.customer-support { background-color: #38a169; }
.user-label.design { background-color: #d53f8c; }
.user-label.engineering { background-color: #3182ce; }
.user-label.finance { background-color: #d69e2e; }
.user-label.hr { background-color: #805ad5; }
.user-label.legal { background-color: #2d3748; }
.user-label.marketing { background-color: #e53e3e; }
.user-label.product { background-color: #38b2ac; }
.user-label.sales { background-color: #dd6b20; }
.user-label.security { background-color: #e53e3e; }

.edit-label-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 2px 4px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.edit-label-btn:hover {
    background-color: #e2e8f0;
}

/* Label Selection Modal */
.label-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 8px;
    margin-bottom: 15px;
}

.label-option-btn {
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    text-align: center;
}

.label-option-btn:hover {
    border-color: #4299e1;
    background-color: #ebf8ff;
}

.label-option-btn.selected {
    border-color: #4299e1;
    background-color: #4299e1;
    color: white;
}

/* Responsive modal */
@media (max-width: 768px) {
    .manager-modal-content {
        width: 95%;
        margin: 10px;
    }
    
    .manager-modal-header {
        padding: 15px 20px;
    }
    
    .manager-modal-body {
        padding: 20px;
    }
    
    .label-options {
        grid-template-columns: 1fr;
    }
}

/* Event Labels Section */
.labels-section {
    margin-top: 20px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.labels-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.label-checkbox {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    background: white;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.label-checkbox:hover {
    border-color: #4299e1;
    background-color: #ebf8ff;
}

.label-checkbox.selected {
    border-color: #4299e1;
    background-color: #4299e1;
    color: white;
}

.label-checkbox input[type="checkbox"] {
    margin-right: 8px;
    transform: scale(1.1);
}

.label-checkbox.selected input[type="checkbox"] {
    accent-color: white;
}

/* Event Labels Display */
.event-labels {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 8px;
}

.event-label-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-weight: 600;
    color: white;
}

@media (max-width: 768px) {
    .labels-container {
        grid-template-columns: 1fr;
    }
}

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-content {
    text-align: center;
    padding: 20px;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4299e1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Event Labels Section */
.event-labels-section {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 10px 0;
    padding: 8px;
    background-color: #f8f9fa;
    border-radius: 6px;
}

.event-labels {
    flex: 1;
    margin-right: 10px;
}

.no-labels {
    color: #6b7280;
    font-style: italic;
    font-size: 0.9rem;
}

.edit-labels-btn {
    font-size: 0.8rem !important;
    padding: 4px 8px !important;
    white-space: nowrap;
}

/* Label Selection Modal */
.labels-grid {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    padding: 15px;
}

.label-checkbox-item {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: white;
}

.label-checkbox-item:hover {
    background-color: #f3f4f6;
    border-color: #d1d5db;
}

.label-checkbox-item.selected {
    background-color: #dbeafe;
    border-color: #3b82f6;
}

.label-checkbox-item input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.label-text {
    font-size: 0.9rem;
    font-weight: 500;
}

/* Past Event Restrictions */
.past-event-notice {
    font-size: 0.8rem;
    color: #6b7280;
    font-style: italic;
    padding: 4px 8px;
}

