/* Profile Selector Overlay */
.profile-selector-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.profile-selector-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

/* Profile Selector Container */
.profile-selector {
    background: #1a1a1a;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    border: 1px solid #333;
    max-width: 90vw;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.4s ease-out;
}

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

/* Profile Selector Header */
.profile-selector-header {
    text-align: center;
    margin-bottom: 30px;
}

.profile-selector-title {
    color: #ffffff;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px 0;
    letter-spacing: -0.5px;
}

.profile-selector-subtitle {
    color: #888;
    font-size: 16px;
    margin: 0;
}

/* Profile Grid */
.profile-grid {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

/* Profile Card */
.profile-card {
    background: #2a2a2a;
    border-radius: 16px;
    padding: 0;
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    width: 300px;
    height: 400px;
}

.profile-card:hover {
    border-color: #4a9eff;
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(74, 158, 255, 0.2);
}

.profile-card.selected {
    border-color: #4a9eff;
    background: #2d3748;
    box-shadow: 0 0 20px rgba(74, 158, 255, 0.3);
}

/* Profile Image Container */
.profile-image-container {
    width: 100%;
    height: 100%;
    background: #404040;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.profile-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 16px;
}

.profile-image-placeholder {
    display: none;
}

/* Profile Name Overlay */
.profile-name-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.8));
    padding: 20px 15px 15px;
    border-radius: 0 0 12px 12px;
}

.profile-name {
    color: #ffffff;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
    text-align: center;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

/* Action Buttons */
.profile-selector-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.profile-action-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.profile-action-btn.primary {
    background: #4a9eff;
    color: white;
}

.profile-action-btn.primary:hover {
    background: #3a8eef;
    transform: translateY(-1px);
}

.profile-action-btn.primary:disabled {
    background: #333;
    color: #666;
    cursor: not-allowed;
    transform: none;
}

.profile-action-btn.secondary {
    background: transparent;
    color: #888;
    border: 1px solid #444;
}

.profile-action-btn.secondary:hover {
    background: #333;
    color: #fff;
    border-color: #555;
}

/* Loading State */
.profile-selector.loading {
    pointer-events: none;
}

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

.profile-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #333;
    border-top: 3px solid #4a9eff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.profile-loading-text {
    color: #888;
    font-size: 16px;
}

/* Error State */
.profile-error {
    text-align: center;
    padding: 40px 20px;
    color: #ff6b6b;
}

.profile-error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.profile-error-message {
    font-size: 16px;
    margin-bottom: 20px;
}

.profile-retry-btn {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

.profile-retry-btn:hover {
    background: #ff5252;
}

/* Create Profile Form */
.create-profile-form {
    max-width: 500px;
    margin: 0 auto;
    padding: 20px;
}

.form-header {
    text-align: center;
    margin-bottom: 30px;
}

.form-title {
    color: #ffffff;
    font-size: 24px;
    font-weight: 600;
    margin: 0 0 8px 0;
    letter-spacing: -0.3px;
}

.form-subtitle {
    color: #888;
    font-size: 14px;
    margin: 0;
}

.form-body {
    margin-bottom: 30px;
}

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

.form-label {
    display: block;
    color: #ffffff;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    letter-spacing: 0.2px;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: #2a2a2a;
    border: 2px solid #404040;
    border-radius: 8px;
    color: #ffffff;
    font-size: 16px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus {
    outline: none;
    border-color: #4a9eff;
    background: #333;
    box-shadow: 0 0 0 3px rgba(74, 158, 255, 0.1);
}

.form-input::placeholder {
    color: #666;
}

.form-hint {
    color: #666;
    font-size: 12px;
    margin-top: 6px;
    line-height: 1.4;
}

.form-actions {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 30px;
}

.form-actions .profile-action-btn {
    min-width: 120px;
}

/* Form Animation */
.create-profile-form {
    animation: formSlideIn 0.4s ease-out;
}

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

/* Responsive Design */
@media (max-width: 768px) {
    .profile-selector {
        padding: 20px;
        margin: 20px;
        border-radius: 16px;
    }
    
    .profile-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .profile-selector-title {
        font-size: 24px;
    }
    
    .profile-image-container {
        height: 160px;
    }
    
    .profile-selector-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .profile-action-btn {
        width: 100%;
        max-width: 200px;
    }
}

@media (max-width: 480px) {
    .profile-selector {
        padding: 15px;
        margin: 10px;
    }
    
    .profile-card {
        padding: 15px;
    }
    
    .profile-image-container {
        height: 140px;
    }
    
    .profile-stats {
        flex-direction: column;
        gap: 10px;
    }
}
