/**
 * Crews CSS
 * Styling for the community/crews feature
 */

/* Utility classes */
.crew-tab-content.hidden {
    display: none !important;
}

/* Crews View Container */
#crews-view {
    padding: 20px;
    padding-bottom: 80px;
    background: #fff;
    min-height: 100%;
}

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

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

/* Action Buttons */
.crews-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
    padding: 0 4px;
}

/* Crews List */
.crews-list {
    display: grid;
    gap: 12px;
    padding: 0 4px;
    min-height: 60px;
}

.crews-list-empty {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
}

.crews-list-empty.hidden {
    display: none;
}

.crew-card {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.crew-card:hover {
    background: #f9f9f9;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #667eea;
}

.crew-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    gap: 12px;
    min-height: 24px;
}

.crew-card-header h3,
.crew-card-header .crew-card-name {
    margin: 0 !important;
    padding: 0 !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #333 !important;
    flex: 1;
    line-height: 1.3 !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    text-align: left;
}

.crew-card-name {
    color: #333 !important;
    display: block !important;
}

.crew-role-badge {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.crew-role-badge.owner {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
}

.crew-role-badge.admin {
    background: rgba(102, 126, 234, 0.3);
    color: #667eea;
}

.crew-role-badge.member {
    background: rgba(255, 255, 255, 0.1);
    color: #ccc;
}

.crew-card-description {
    font-size: 13px;
    color: #666;
    margin: 0 0 12px 0;
    line-height: 1.5;
}

.crew-card-meta {
    font-size: 12px;
    color: #777;
    display: flex;
    align-items: center;
    gap: 4px;
    margin: 0;
}

/* Crew Detail View */
.crew-detail {
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.crew-detail-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
}

.back-btn {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.2s ease;
}

.back-btn:hover {
    background: rgba(255, 255, 255, 0.15);
}

.crew-detail-title {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
}

.crew-detail-title h3 {
    margin: 0;
    font-size: 20px;
    color: #fff;
}

.btn-icon {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 20px;
    cursor: pointer;
    transition: background 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-icon:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Crew Tabs */
.crew-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    border-bottom: 2px solid rgba(255, 255, 255, 0.1);
}

.crew-tab {
    background: none;
    border: none;
    color: #999;
    padding: 12px 20px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -2px;
    transition: all 0.2s ease;
}

.crew-tab:hover {
    color: #ccc;
}

.crew-tab.active {
    color: #667eea;
    border-bottom-color: #667eea;
}

/* Crew Races Tab */
.crew-races-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.crew-races-empty .hint {
    font-size: 13px;
    margin-top: 8px;
    color: #666;
}

.crew-races-list {
    list-style: none;
    padding: 0;
    padding-bottom: 100px;
    margin: 0;
    display: grid;
    gap: 12px;
}

/* Crew race cards - match list view styling */
.crew-race-card {
    margin: 4px 0 !important;
}

.crew-race-card.my-race {
    border-left: 4px solid #667eea !important;
    background: rgba(102, 126, 234, 0.05) !important;
}

.crew-race-members {
    font-size: 12px;
    padding: 8px 0;
    border-top: 1px solid #e0e0e0;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.crew-race-members-btn {
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: opacity 0.2s;
}

.crew-race-members-btn:hover {
    opacity: 0.7;
}

.crew-race-members strong {
    color: #667eea;
    font-weight: 600;
}

.crew-race-breakdown {
    color: #777;
    font-size: 11px;
}

/* Teammates Modal */
.teammates-modal .modal-content {
    max-width: 400px;
}

.teammates-modal h2 {
    margin: 0 0 20px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.teammates-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.teammate-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
}

.teammate-name {
    font-weight: 500;
    color: #333;
}

.teammate-status {
    font-size: 11px;
    padding: 4px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.teammate-status.status-registered {
    background: rgba(76, 175, 80, 0.2);
    color: #4CAF50;
}

.teammate-status.status-planned {
    background: rgba(33, 150, 243, 0.2);
    color: #2196F3;
}

/* Crew Members Tab */
.crew-info {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 20px;
}

.crew-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.crew-info-item:last-child {
    margin-bottom: 0;
}

.crew-info-item .label {
    font-size: 13px;
    color: #999;
}

.invite-code-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

.invite-code-container code {
    background: rgba(0, 0, 0, 0.3);
    padding: 6px 12px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    color: #667eea;
    letter-spacing: 1px;
}

.btn-copy {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
    opacity: 0.7;
    transition: opacity 0.2s ease;
}

.btn-copy:hover {
    opacity: 1;
}

.crew-members-list {
    list-style: none;
    padding: 0;
    padding-bottom: 100px;
    margin: 0;
}

.crew-member-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 8px;
}

.crew-member-info {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
}

.crew-member-name {
    color: #333;
    font-size: 14px;
    font-weight: 500;
    flex: 1;
}

.crew-member-role {
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 10px;
    font-weight: 600;
    text-transform: uppercase;
}

.crew-member-role.owner {
    background: rgba(102, 126, 234, 0.3);
    color: #667eea;
}

.crew-member-role.admin {
    background: rgba(102, 126, 234, 0.2);
    color: #8b9ceb;
}

.crew-member-role.member {
    background: rgba(255, 255, 255, 0.1);
    color: #999;
}

/* Modals - Now using unified theme variables from components.css */
.modal-subtitle {
    color: var(--text-muted);
    font-size: 14px;
    margin-bottom: 24px;
}

/* Crew Options Modal */
.crew-options-content {
    max-width: 320px;
}

.crew-options-content h3 {
    margin: 0 0 16px 0;
    font-size: 18px;
    color: var(--text-primary);
}

.crew-options-list {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.crew-options-list li {
    margin-bottom: 8px;
}

.crew-option {
    width: 100%;
    padding: 12px;
    background: var(--hover-bg);
    border: 1px solid var(--border-medium);
    border-radius: 8px;
    color: var(--text-primary);
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
}

.crew-option:hover {
    background: var(--active-bg);
}

.crew-option.danger {
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.3);
}

.crew-option.danger:hover {
    background: rgba(239, 68, 68, 0.1);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

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

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

/* Crews-specific secondary button override */
#crews-view .btn-secondary,
.crews-empty .btn-secondary,
.crews-header .btn-secondary {
    background: rgba(102, 126, 234, 0.2) !important;
    color: var(--text-primary) !important;
    border: 1px solid rgba(102, 126, 234, 0.5) !important;
}

#crews-view .btn-secondary:hover,
.crews-empty .btn-secondary:hover,
.crews-header .btn-secondary:hover {
    background: rgba(102, 126, 234, 0.3) !important;
    border-color: rgba(102, 126, 234, 0.7) !important;
    transform: translateY(-1px);
}

/* Mobile Responsive */
@media (max-width: 768px) {
    #crews-view {
        padding: 16px;
    }
    
    .crews-header h2 {
        font-size: 20px;
    }
    
    .crews-empty-actions {
        flex-direction: column;
        width: 100%;
    }
    
    .crews-empty-actions button {
        width: 100%;
    }
    
    .crew-card {
        padding: 14px;
    }
    
    .crew-tabs {
        gap: 4px;
    }
    
    .crew-tab {
        padding: 10px 16px;
        font-size: 14px;
    }
}
