﻿/* ============================================
   TEAM MANAGEMENT - BASE STYLES
   Toyota Professional Insurance Interface
   ============================================ */

/* Container & Layout */
.team-container {
    padding: 2rem;
    max-width: 100%;
    min-height: 100vh;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

/* Team Header */
.team-header {
    border-radius: 1rem;
    padding: 3rem 2.5rem;
    margin-bottom: 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

    .team-header::before {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        width: 200px;
        height: 200px;
        background: rgba(255, 255, 255, 0.1);
        border-radius: 50%;
        transform: translate(50px, -50px);
    }

.header-content {
    position: relative;
    z-index: 1;
}

    .header-content h2 {
        color: white;
        font-size: 2.5rem;
        font-weight: 700;
        margin-bottom: 0.5rem;
        display: flex;
        align-items: center;
        gap: 1rem;
    }

        .header-content h2 i {
            font-size: 2.2rem;
        }

    .header-content p {
        color: rgba(255, 255, 255, 0.9);
        font-size: 1.2rem;
        font-weight: 400;
        margin: 0;
    }

.header-actions {
    position: relative;
    z-index: 1;
}

/* Dropdown Container */
.dropdown-container {
    position: relative;
}

.dropdown-item {
    padding: 0.875rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

    .dropdown-item i {
        font-size: 1.1rem;
    }

/* Filters Section */
.filters-section {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2rem;
    margin-bottom: 2rem;
    align-items: start;
}

.search-box {
    position: relative;
    display: flex;
    align-items: center;
    border-radius: 0.75rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

    .search-box i {
        position: absolute;
        left: 2rem;
        font-size: 1.1rem;
    }

    .search-box input {
        width: 100%;
        padding: 0.75rem 1rem 0.75rem 3rem;
        border: none;
        border-radius: 0.5rem;
        font-size: 0.9rem;
        transition: all 0.3s ease;
        background: transparent;
    }

        .search-box input:focus {
            outline: none;
        }

.filter-group {
    display: flex;
    gap: 1rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s ease;
    cursor: pointer;
    min-width: 200px;
}

    .filter-select:focus {
        outline: none;
    }

/* Loading State */
.loading-spinner {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 400px;
    border-radius: 0.75rem;
    text-align: center;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.loading-spinner p {
    font-size: 1.1rem;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    border-radius: 0.75rem;
}

    .empty-state i {
        margin-bottom: 1.5rem;
        opacity: 0.5;
    }

    .empty-state h3 {
        font-size: 1.25rem;
        margin-bottom: 0.5rem;
    }

    .empty-state p {
        font-size: 1rem;
    }

/* Companies Container */
.companies-container {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Company Section */
.company-section {
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

.company-header {
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .company-header h3 {
        font-size: 1.25rem;
        font-weight: 600;
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin: 0;
    }

        .company-header h3 i {
            font-size: 1.1rem;
        }

.user-count {
    padding: 0.25rem 0.75rem;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 600;
}

/* Table Styles */
.desktop-view {
    display: block;
}

.users-table {
    width: 100%;
    border-collapse: collapse;
}

    .users-table thead tr {
        border-bottom: 2px solid;
    }

    .users-table th {
        padding: 1rem 1.5rem;
        text-align: left;
        font-weight: 600;
        font-size: 0.875rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }

    .users-table tbody tr {
        transition: all 0.2s ease;
    }

    .users-table td {
        padding: 1.25rem 1.5rem;
        vertical-align: middle;
    }

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    min-width: 200px;
}

.user-avatar {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #eb0a1e, #c20818);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.user-details {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.user-name {
    font-weight: 600;
    font-size: 1rem;
}

.user-email {
    font-size: 0.875rem;
}

.user-email-col {
    font-size: 0.9rem;
}

/* Status Badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
    padding: 0.375rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Action Buttons */
.actions {
    width: 120px;
}

.actions-container {
    display: flex;
    gap: 0.75rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.875rem;
}

    .btn-icon:hover {
        transform: translateY(-1px);
    }

/* Mobile Card View */
.mobile-view {
    display: none;
    padding: 1rem;
    gap: 1rem;
    flex-direction: column;
}

.user-card {
    border-radius: 0.75rem;
    overflow: hidden;
    transition: all 0.3s ease;
}

    .user-card:hover {
        transform: translateY(-2px);
    }

.user-card-header {
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.user-card-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-card-actions {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
}

.btn-card {
    flex: 1;
    padding: 0.875rem 1rem;
    border: none;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s ease;
}

/* Dialog Styles */
.dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

.dialog-content {
    border-radius: 0.75rem;
    width: 100%;
    max-width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease-out;
}

.dialog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem;
}

    .dialog-header h3 {
        display: flex;
        align-items: center;
        gap: 0.75rem;
        margin: 0;
        font-size: 1.25rem;
        font-weight: 700;
    }

        .dialog-header h3 i {
            font-size: 1.125rem;
        }

.dialog-body {
    padding: 1.5rem;
    overflow-y: auto;
    flex: 1;
}

.dialog-footer {
    padding: 1.5rem;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.25rem;
}

    .form-group label {
        display: block;
        margin-bottom: 0.5rem;
        font-size: 0.9375rem;
        font-weight: 600;
    }

.form-control {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.9375rem;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
}

    .form-control:focus {
        outline: none;
    }

.form-row {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    font-size: 0.9375rem;
    font-weight: 600;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
}

    .btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Design */
@media (max-width: 1200px) {
    .filters-section {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .team-container {
        padding: 1rem;
    }

    .team-header {
        flex-direction: column;
        padding: 2rem 1.5rem;
        align-items: flex-start;
    }

        .team-header h2 {
            font-size: 2rem;
        }

    .filters-section {
        gap: 1rem;
    }

    .search-box {
        padding: 1rem;
    }

    .filter-group {
        flex-direction: column;
    }

    .filter-select {
        width: 100%;
        min-width: auto;
    }

    .desktop-view {
        display: none;
    }

    .mobile-view {
        display: flex;
    }

    .dialog-content {
        margin: 0.5rem;
        max-width: none;
    }

    .dialog-header,
    .dialog-body {
        padding: 1.5rem;
    }

    .dialog-footer {
        flex-direction: column;
    }

    .btn {
        justify-content: center;
        width: 100%;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .mobile-hidden {
        display: none;
    }
}

@media (max-width: 480px) {
    .team-header h2 {
        font-size: 1.75rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .company-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}
