/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

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

/* Header styles */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

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

.header h1 i {
    margin-right: 15px;
    color: #ffd700;
}

.header p {
    font-size: 1.2rem;
    opacity: 0.9;
    font-weight: 300;
}

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

.search-container {
    position: relative;
    margin-bottom: 20px;
}

.search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #666;
    font-size: 1.1rem;
}

#searchInput {
    width: 100%;
    padding: 15px 20px 15px 55px;
    border: 2px solid #e1e5e9;
    border-radius: 50px;
    font-size: 1.1rem;
    transition: all 0.3s ease;
    background: #f8f9fa;
}

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

.clear-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 5px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.clear-btn:hover {
    background: #f0f0f0;
    color: #666;
}

.filter-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
}

.filter-select {
    padding: 12px 20px;
    border: 2px solid #e1e5e9;
    border-radius: 25px;
    font-size: 1rem;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

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

.view-toggle {
    display: flex;
    background: #f8f9fa;
    border-radius: 25px;
    padding: 4px;
}

.view-btn {
    background: none;
    border: none;
    padding: 10px 15px;
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #666;
}

.view-btn.active {
    background: #667eea;
    color: white;
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.3);
}

.view-btn:hover:not(.active) {
    background: #e9ecef;
    color: #333;
}

/* Stats bar */
.stats-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255,255,255,0.1);
    backdrop-filter: blur(10px);
    border-radius: 15px;
    padding: 15px 25px;
    margin-bottom: 30px;
    color: white;
    font-weight: 500;
}

/* Agents container */
.agents-container {
    display: grid;
    gap: 25px;
    margin-bottom: 40px;
}

.grid-view {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}

.list-view {
    grid-template-columns: 1fr;
}

/* Agent card */
.agent-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    border: 2px solid transparent;
    position: relative;
    overflow: hidden;
}

.agent-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea, #764ba2);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.agent-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.15);
    border-color: #667eea;
}

.agent-card:hover::before {
    transform: scaleX(1);
}

.agent-card.list-view {
    display: flex;
    align-items: center;
    gap: 20px;
}

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

.agent-title {
    font-size: 1.3rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
    line-height: 1.3;
}

.agent-department {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    padding: 5px 12px;
    border-radius: 15px;
    font-size: 0.85rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.agent-description {
    color: #666;
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 20px;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

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

.agent-link {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 500;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.agent-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    text-decoration: none;
    color: white;
}

.agent-link i {
    font-size: 0.9rem;
}

.agent-id {
    color: #999;
    font-size: 0.85rem;
    font-weight: 500;
}

/* List view specific styles */
.list-view .agent-card {
    padding: 20px 25px;
}

.list-view .agent-header {
    margin-bottom: 10px;
}

.list-view .agent-description {
    margin-bottom: 15px;
    -webkit-line-clamp: 2;
}

/* No results */
.no-results {
    text-align: center;
    padding: 60px 20px;
    color: white;
}

.no-results i {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.no-results h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

.no-results p {
    font-size: 1.1rem;
    opacity: 0.8;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    margin-top: 40px;
    padding: 20px;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2.2rem;
    }
    
    .search-section {
        padding: 20px;
    }
    
    .filter-section {
        flex-direction: column;
        align-items: stretch;
    }
    
    .filter-select {
        min-width: auto;
    }
    
    .grid-view {
        grid-template-columns: 1fr;
    }
    
    .agent-card.list-view {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }
    
    .stats-bar {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.8rem;
    }
    
    .header p {
        font-size: 1rem;
    }
    
    .agent-card {
        padding: 20px;
    }
    
    .agent-title {
        font-size: 1.1rem;
    }
}

/* Loading animation */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px;
    color: white;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid rgba(255,255,255,0.3);
    border-top: 4px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 15px;
}

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

/* Department color coding */
.department-marketing { border-left: 4px solid #e74c3c; }
.department-sales { border-left: 4px solid #f39c12; }
.department-customer-support { border-left: 4px solid #27ae60; }
.department-operations { border-left: 4px solid #3498db; }
.department-human-resources { border-left: 4px solid #9b59b6; }
.department-finance { border-left: 4px solid #1abc9c; }
.department-administration { border-left: 4px solid #34495e; }
