/**
 * Team Management Styles
 * Created: 2025-10-06
 */

/* Teams View Header */
.teams-view-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 0;
    margin-bottom: 20px;
}

.teams-view-controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

/* Three-Panel Layout: Teams List | Team Detail | Available Resources */
.teams-view-layout {
    display: grid;
    grid-template-columns: 280px 1fr 320px;
    gap: 20px;
    height: calc(100vh - 280px);
    min-height: 600px;
}

/* Left Panel: Teams List */
.teams-list-panel {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.teams-list-panel h4 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
    font-weight: 600;
}

/* Center Panel: Team Detail */
.team-detail-panel {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-y: auto;
}

/* Right Panel: Available Resources (Sidebar) */
.team-resources-panel {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.team-resources-panel h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

/* Available Resources Sections */
.available-section {
    margin-bottom: 25px;
}

.available-section h5 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.available-users,
.available-vehicles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* DEPRECATED - keeping for backwards compatibility */
.teams-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    margin-bottom: 20px;
}

.teams-header-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.teams-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.teams-layout {
    display: grid;
    grid-template-columns: 300px 1fr 300px;
    gap: 20px;
    padding: 20px;
    height: calc(100vh - 200px);
}

/* Teams List */
.teams-list {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.teams-list h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.team-card {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.team-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    transform: translateY(-2px);
}

.team-card.active {
    box-shadow: 0 4px 12px rgba(0,102,204,0.3);
    border-color: #0066cc;
}

.team-card-header {
    padding: 6px 10px;
    border-bottom: 1px solid #f1f1f1;
}

.team-card-title {
    margin: 0;
    font-size: 13px;
    font-weight: 600;
    color: #333;
}

.team-card-body {
    padding: 6px 10px;
    font-size: 12px;
}

/* Compact member display in team cards */
.team-member-compact {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 0;
    color: #333;
}

.team-member-compact.assistant {
    color: #666;
}

.team-member-compact .material-icons {
    font-size: 14px;
}

.team-member-compact span {
    font-size: 11px;
    line-height: 1.2;
}

/* DEPRECATED - keeping for backwards compatibility */
.team-primary-tech {
    color: #333;
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-assistants {
    color: #666;
    display: flex;
    align-items: center;
    gap: 5px;
}

.no-teams {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

/* Team Detail */
.team-detail {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.no-team-selected {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #999;
    font-size: 18px;
}

.team-detail-header {
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 6px;
    margin-bottom: 20px;
}

.team-detail-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.team-detail-title h3 {
    margin: 0;
    font-size: 22px;
    color: #333;
}

.team-actions {
    display: flex;
    gap: 10px;
}

.team-actions button {
    display: flex;
    align-items: center;
    gap: 5px;
}

.team-actions .material-icons {
    font-size: 18px;
}

.team-notes {
    margin-top: 10px;
    padding: 10px;
    background-color: #fff;
    border-radius: 4px;
    font-size: 14px;
    color: #666;
}

/* Team Sections */
.team-sections {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.team-section {
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    background-color: #fafafa;
}

.team-section h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
}

/* Drop Zones */
.drop-zone {
    min-height: 80px;
    padding: 10px;
    border: 2px dashed #dee2e6;
    border-radius: 6px;
    background-color: #fff;
    transition: all 0.2s ease;
}

.drop-zone.drag-over {
    border-color: #0066cc;
    background-color: #e8f4f8;
}

.empty-zone {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 60px;
    color: #999;
    font-size: 13px;
    text-align: center;
}

/* Team Members and Vehicles */
.team-member,
.team-vehicle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    margin-bottom: 8px;
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.team-member:hover,
.team-vehicle:hover {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.member-info,
.vehicle-info {
    flex: 1;
}

.member-info strong,
.vehicle-info strong {
    font-size: 14px;
    color: #333;
}

.member-info small,
.vehicle-info small {
    font-size: 12px;
    color: #666;
}

.btn-remove {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    transition: background-color 0.2s ease;
}

.btn-remove:hover {
    background-color: #ffe5e5;
}

.btn-remove .material-icons {
    font-size: 18px;
}

/* Available Resources */
.team-resources {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    overflow-y: auto;
}

.team-resources h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.available-section {
    margin-bottom: 25px;
}

.available-section h4 {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.available-users,
.available-vehicles {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Draggable Items */
.draggable-user,
.draggable-vehicle {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background-color: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: move;
    transition: all 0.2s ease;
}

.draggable-user:hover,
.draggable-vehicle:hover {
    background-color: #e9ecef;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.draggable-user:active,
.draggable-vehicle:active {
    opacity: 0.5;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-weight: bold;
    font-size: 14px;
}

.user-info,
.vehicle-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.user-info strong,
.vehicle-info strong {
    font-size: 14px;
    color: #333;
}

.user-info small,
.vehicle-info small {
    font-size: 12px;
    color: #666;
}

.draggable-vehicle .material-icons {
    font-size: 24px;
    color: #ff9800;
}

/* Responsive Design */
@media (max-width: 1400px) {
    .teams-view-layout {
        grid-template-columns: 260px 1fr 300px;
    }
}

@media (max-width: 1200px) {
    .teams-view-layout {
        grid-template-columns: 240px 1fr 280px;
    }

    .teams-layout {
        grid-template-columns: 250px 1fr 250px;
    }
}

@media (max-width: 992px) {
    /* Stack panels vertically on tablets */
    .teams-view-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
    }

    .teams-list-panel,
    .team-detail-panel,
    .team-resources-panel {
        max-height: 500px;
    }

    .teams-layout {
        grid-template-columns: 1fr;
        grid-template-rows: auto auto auto;
        height: auto;
    }

    .teams-list,
    .team-detail,
    .team-resources {
        max-height: 400px;
    }
}

@media (max-width: 768px) {
    .teams-header {
        flex-direction: column;
        gap: 15px;
    }

    .teams-header-left {
        flex-direction: column;
        width: 100%;
    }

    .teams-header-right {
        width: 100%;
    }

    #create-team-btn {
        width: 100%;
    }

    .team-actions {
        flex-direction: column;
    }

    .team-actions button {
        width: 100%;
        justify-content: center;
    }
}

/* Loading and Error States */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.error-message {
    padding: 20px;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    color: #721c24;
    text-align: center;
}

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

.team-card,
.team-member,
.team-vehicle {
    animation: fadeIn 0.3s ease;
}
