/**
 * CODDB User Features CSS
 * Username customization and effects
 */

/* Base username styling */
.coddb-username {
    transition: all 0.3s ease;
    position: relative;
    display: inline-block;
}

/* Username Color Effects */
.coddb-username-colored {
    /* Color is applied via inline style */
}

/* Username Glow Effects */
.coddb-username-glow-soft {
    text-shadow: 0 0 10px var(--glow-color, #FFD700);
}

.coddb-username-glow-neon {
    text-shadow: 
        0 0 5px var(--glow-color, #FFD700),
        0 0 10px var(--glow-color, #FFD700),
        0 0 15px var(--glow-color, #FFD700),
        0 0 20px var(--glow-color, #FFD700);
}

.coddb-username-glow-pulse {
    animation: username-glow-pulse 2s ease-in-out infinite alternate;
}

@keyframes username-glow-pulse {
    from {
        text-shadow: 0 0 10px var(--glow-color, #FFD700);
    }
    to {
        text-shadow: 
            0 0 5px var(--glow-color, #FFD700),
            0 0 15px var(--glow-color, #FFD700),
            0 0 25px var(--glow-color, #FFD700);
    }
}

.coddb-username-glow-shimmer {
    background: linear-gradient(45deg, 
        transparent 30%, 
        var(--glow-color, #FFD700) 50%, 
        transparent 70%);
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: username-shimmer 3s ease-in-out infinite;
}

@keyframes username-shimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* Username Animation Effects */
.coddb-username-animation-fade {
    animation: username-fade 3s ease-in-out infinite;
}

@keyframes username-fade {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.coddb-username-animation-bounce {
    animation: username-bounce 2s ease-in-out infinite;
}

@keyframes username-bounce {
    0%, 20%, 50%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-3px); }
    60% { transform: translateY(-2px); }
}

.coddb-username-animation-color-shift {
    animation: username-color-shift 4s ease-in-out infinite;
}

@keyframes username-color-shift {
    0% { filter: hue-rotate(0deg); }
    25% { filter: hue-rotate(90deg); }
    50% { filter: hue-rotate(180deg); }
    75% { filter: hue-rotate(270deg); }
    100% { filter: hue-rotate(360deg); }
}

.coddb-username-animation-typewriter {
    overflow: hidden;
    white-space: nowrap;
    animation: username-typewriter 2s steps(20) infinite;
}

@keyframes username-typewriter {
    0% { width: 0; }
    50% { width: 100%; }
    100% { width: 100%; }
}

.coddb-username-animation-wave {
    animation: username-wave 2s ease-in-out infinite;
}

@keyframes username-wave {
    0%, 100% { transform: rotate(0deg); }
    25% { transform: rotate(1deg); }
    75% { transform: rotate(-1deg); }
}

.coddb-username-animation-gradient-shift {
    background: linear-gradient(45deg, 
        var(--glow-color, #FFD700), 
        #ff6600, 
        var(--glow-color, #FFD700));
    background-size: 200% 200%;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: username-gradient-shift 3s ease infinite;
}

@keyframes username-gradient-shift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

/* Animation Speed Modifiers */
.coddb-username-speed-slow {
    animation-duration: 6s !important;
}

.coddb-username-speed-normal {
    animation-duration: 3s !important;
}

.coddb-username-speed-fast {
    animation-duration: 1.5s !important;
}

/* Username Border Effects */
.coddb-username-border-elegant {
    padding: 2px 6px;
    border: 1px solid var(--border-color, #FFD700);
    border-radius: 4px;
    background: rgba(255, 215, 0, 0.1);
}

.coddb-username-border-geometric {
    padding: 2px 6px;
    border: 2px solid var(--border-color, #FFD700);
    border-radius: 0;
    position: relative;
}

.coddb-username-border-geometric::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border: 1px solid var(--border-color, #FFD700);
    opacity: 0.5;
}

.coddb-username-border-gaming {
    padding: 2px 6px;
    border: 2px solid var(--border-color, #FFD700);
    border-radius: 0;
    background: linear-gradient(45deg, transparent, rgba(255, 215, 0, 0.1), transparent);
    position: relative;
    overflow: hidden;
}

.coddb-username-border-gaming::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 215, 0, 0.3), transparent);
    animation: gaming-border-scan 2s linear infinite;
}

@keyframes gaming-border-scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.coddb-username-border-artistic {
    padding: 2px 6px;
    border: 2px solid transparent;
    border-radius: 8px;
    background: linear-gradient(45deg, var(--border-color, #FFD700), #ff6600) border-box;
    background-clip: padding-box, border-box;
}

.coddb-username-border-minimalist {
    padding: 1px 4px;
    border-bottom: 2px solid var(--border-color, #FFD700);
}

.coddb-username-border-bold {
    padding: 3px 8px;
    border: 3px solid var(--border-color, #FFD700);
    border-radius: 6px;
    font-weight: bold;
    background: rgba(255, 215, 0, 0.05);
}

/* Username Background Effects */
.coddb-username-bg-solid {
    padding: 2px 6px;
    background-color: var(--bg-color, #1a1a1a);
    border-radius: 3px;
}

.coddb-username-bg-gradient {
    padding: 2px 6px;
    background: linear-gradient(45deg, var(--bg-color, #1a1a1a), var(--bg-color-secondary, #2a2a2a));
    border-radius: 3px;
}

.coddb-username-bg-glass {
    padding: 2px 6px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
}

/* Message Card Styles */
.coddb-message-card {
    transition: all 0.3s ease;
    position: relative;
}

/* Message Card Themes */
.coddb-message-theme-default {
    /* Default theme - no additional styling */
}

.coddb-message-theme-elegant {
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.02));
}

.coddb-message-theme-gaming {
    border-radius: 0;
    background: linear-gradient(45deg, rgba(255, 102, 0, 0.1), transparent);
    border-left: 3px solid #ff6600;
}

.coddb-message-theme-minimal {
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.02);
}

/* Message Card Backgrounds */
.coddb-message-bg-solid {
    background-color: var(--message-bg-color, #1a1a1a) !important;
}

.coddb-message-bg-gradient {
    background: linear-gradient(135deg, 
        var(--message-bg-color, #1a1a1a), 
        var(--message-bg-color-secondary, #2a2a2a)) !important;
}

.coddb-message-bg-glass {
    background: rgba(255, 255, 255, 0.05) !important;
    backdrop-filter: blur(10px);
}

/* Message Card Borders */
.coddb-message-border-solid {
    border: var(--message-border-width, 1px) solid var(--message-border-color, #333);
}

.coddb-message-border-dashed {
    border: var(--message-border-width, 1px) dashed var(--message-border-color, #333);
}

.coddb-message-border-dotted {
    border: var(--message-border-width, 1px) dotted var(--message-border-color, #333);
}

.coddb-message-border-glow {
    border: var(--message-border-width, 1px) solid var(--message-border-color, #333);
    box-shadow: 0 0 10px var(--message-border-color, #333);
}

/* Message Card Shadows */
.coddb-message-shadow-subtle {
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.coddb-message-shadow-pronounced {
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.coddb-message-shadow-neon {
    box-shadow: 0 0 10px var(--message-shadow-color, #000);
}

.coddb-message-shadow-colored {
    box-shadow: 0 4px 8px var(--message-shadow-color, #000);
}

.coddb-message-shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

/* Message Card Corners */
.coddb-message-corners-rounded {
    border-radius: 8px;
}

.coddb-message-corners-sharp {
    border-radius: 0;
}

.coddb-message-corners-pill {
    border-radius: 20px;
}

/* Message Card Animations */
.coddb-message-animation-fade {
    animation: message-fade-in 0.5s ease-out;
}

@keyframes message-fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.coddb-message-animation-slide {
    animation: message-slide-in 0.5s ease-out;
}

@keyframes message-slide-in {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.coddb-message-animation-bounce {
    animation: message-bounce-in 0.6s ease-out;
}

@keyframes message-bounce-in {
    0% { opacity: 0; transform: scale(0.3); }
    50% { opacity: 1; transform: scale(1.05); }
    70% { transform: scale(0.9); }
    100% { opacity: 1; transform: scale(1); }
}

.coddb-message-animation-glow {
    animation: message-glow-pulse 2s ease-in-out infinite;
}

@keyframes message-glow-pulse {
    0%, 100% { box-shadow: 0 0 5px rgba(255, 102, 0, 0.3); }
    50% { box-shadow: 0 0 20px rgba(255, 102, 0, 0.6); }
}

/* =========================
   CUSTOMIZATION PANEL STYLING
   ========================= */

/* Customization Content Container */
.coddb-customization-content {
    padding: 20px;
    background: var(--bg-secondary, #1a1a1a);
    border-radius: 8px;
    color: var(--text-primary, #e0e0e0);
}

/* Feature Sections */
.coddb-customization-section {
    margin-bottom: 25px;
    padding: 20px;
    background: var(--bg-tertiary, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.coddb-customization-section:hover {
    border-color: var(--accent-color, #ff6600);
    box-shadow: 0 2px 10px rgba(255, 102, 0, 0.2);
}

/* Section Headers */
.coddb-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-color, #333);
}

.coddb-section-header h4 {
    margin: 0;
    color: var(--accent-color, #ff6600);
    font-size: 1.2em;
    font-weight: 600;
    font-family: 'Orbitron', sans-serif;
}

/* Toggle Switches */
.coddb-toggle {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.coddb-toggle input[type="checkbox"] {
    display: none;
}

.coddb-toggle-text {
    margin-left: 10px;
    color: var(--text-secondary, #ccc);
    font-size: 0.9em;
    position: relative;
}

.coddb-toggle-text::before {
    content: '';
    position: absolute;
    left: -40px;
    top: 50%;
    transform: translateY(-50%);
    width: 35px;
    height: 18px;
    background: var(--bg-primary, #0a0a0a);
    border: 1px solid var(--border-color, #333);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.coddb-toggle-text::after {
    content: '';
    position: absolute;
    left: -37px;
    top: 50%;
    transform: translateY(-50%);
    width: 14px;
    height: 14px;
    background: var(--text-secondary, #ccc);
    border-radius: 50%;
    transition: all 0.3s ease;
}

.coddb-toggle input[type="checkbox"]:checked + .coddb-toggle-text::before {
    background: var(--accent-color, #ff6600);
    border-color: var(--accent-color, #ff6600);
}

.coddb-toggle input[type="checkbox"]:checked + .coddb-toggle-text::after {
    transform: translateY(-50%) translateX(17px);
    background: white;
}

/* Color Pickers */
.coddb-color-picker {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.coddb-color-picker input[type="color"] {
    width: 60px;
    height: 40px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    background: none;
    padding: 0;
}

.coddb-color-picker input[type="color"]::-webkit-color-swatch-wrapper {
    padding: 0;
    border-radius: 6px;
    border: 2px solid var(--border-color, #333);
}

.coddb-color-picker input[type="color"]::-webkit-color-swatch {
    border: none;
    border-radius: 4px;
}

/* Color Presets */
.coddb-color-presets {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.coddb-color-option,
.coddb-glow-color-option {
    width: 30px;
    height: 30px;
    border: 2px solid var(--border-color, #333);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.coddb-color-option:hover,
.coddb-glow-color-option:hover {
    transform: scale(1.1);
    border-color: var(--accent-color, #ff6600);
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.3);
}

.coddb-color-option.selected,
.coddb-glow-color-option.selected {
    border-color: var(--accent-color, #ff6600);
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.5);
}

/* Form Controls */
.coddb-form-control {
    width: 100%;
    padding: 10px 12px;
    background: var(--bg-primary, #0a0a0a);
    border: 1px solid var(--border-color, #333);
    border-radius: 6px;
    color: var(--text-primary, #e0e0e0);
    font-size: 14px;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
}

.coddb-form-control:focus {
    outline: none;
    border-color: var(--accent-color, #ff6600);
    box-shadow: 0 0 0 2px rgba(255, 102, 0, 0.2);
}

/* Select Dropdown Styling */
select.coddb-form-control {
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff6600' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6,9 12,15 18,9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

select.coddb-form-control:hover {
    border-color: var(--accent-color, #ff6600);
    background-color: var(--bg-secondary, #1a1a1a);
}

select.coddb-form-control option {
    background: var(--bg-secondary, #1a1a1a);
    color: var(--text-primary, #e0e0e0);
    padding: 8px 12px;
}

select.coddb-form-control option:hover,
select.coddb-form-control option:selected {
    background: var(--accent-color, #ff6600);
    color: white;
}

/* Form Groups */
.coddb-form-group {
    margin-bottom: 15px;
}

.coddb-form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-secondary, #ccc);
    font-size: 0.9em;
    font-weight: 500;
}

.coddb-form-row {
    display: flex;
    gap: 15px;
    align-items: end;
}

.coddb-form-row .coddb-form-group {
    flex: 1;
    margin-bottom: 0;
}

/* Message Card Section */
.coddb-message-card-section {
    background: var(--bg-primary, #0a0a0a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    padding: 20px;
    margin-top: 15px;
}

.coddb-message-card-section h5 {
    margin: 0 0 15px 0;
    color: var(--accent-color, #ff6600);
    font-size: 1.1em;
    font-family: 'Orbitron', sans-serif;
}

/* Action Buttons */
.coddb-customization-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color, #333);
}

.coddb-btn-primary,
.coddb-btn-secondary {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: 'Rajdhani', sans-serif;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.coddb-btn-primary {
    background: var(--accent-color, #ff6600);
    color: white;
}

.coddb-btn-primary:hover {
    background: var(--accent-hover, #cc5500);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.4);
}

.coddb-btn-secondary {
    background: transparent;
    color: var(--text-secondary, #ccc);
    border: 1px solid var(--border-color, #333);
}

.coddb-btn-secondary:hover {
    background: var(--bg-tertiary, #2a2a2a);
    border-color: var(--accent-color, #ff6600);
    color: var(--accent-color, #ff6600);
}

/* No Features States */
.coddb-no-features,
.coddb-no-customization {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary, #ccc);
}

.coddb-no-features p,
.coddb-no-customization p {
    margin-bottom: 20px;
    font-size: 1.1em;
}

.coddb-shop-link {
    display: inline-block;
    padding: 10px 20px;
    background: var(--accent-color, #ff6600);
    color: white;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.coddb-shop-link:hover {
    background: var(--accent-hover, #cc5500);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(255, 102, 0, 0.4);
}

/* Unlocked Features List */
.coddb-features-header h4 {
    margin: 0 0 15px 0;
    color: var(--accent-color, #ff6600);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.2em;
}

.coddb-unlocked-feature {
    display: flex;
    align-items: center;
    padding: 15px;
    background: var(--bg-tertiary, #2a2a2a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.coddb-unlocked-feature:hover {
    border-color: var(--accent-color, #ff6600);
    box-shadow: 0 2px 8px rgba(255, 102, 0, 0.2);
}

.coddb-feature-icon {
    font-size: 1.5em;
    margin-right: 15px;
    width: 40px;
    text-align: center;
}

.coddb-feature-info {
    flex: 1;
}

.coddb-feature-name {
    font-weight: 600;
    color: var(--text-primary, #e0e0e0);
    margin-bottom: 5px;
}

.coddb-feature-description {
    font-size: 0.9em;
    color: var(--text-secondary, #ccc);
    line-height: 1.4;
}

.coddb-feature-status {
    padding: 5px 12px;
    background: var(--success-color, #28a745);
    color: white;
    border-radius: 15px;
    font-size: 0.8em;
    font-weight: 600;
}

/* Loading States */
.coddb-customization-loading {
    text-align: center;
    padding: 30px;
    color: var(--text-secondary, #ccc);
}

.coddb-loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid var(--border-color, #333);
    border-top: 3px solid var(--accent-color, #ff6600);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Preview Container */
.coddb-username-preview-container,
.coddb-message-card-preview-container {
    background: var(--bg-primary, #0a0a0a);
    border: 1px solid var(--border-color, #333);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.coddb-username-preview-container h5,
.coddb-message-card-preview-container h5 {
    margin: 0 0 15px 0;
    color: var(--accent-color, #ff6600);
    font-family: 'Orbitron', sans-serif;
    font-size: 1.1em;
}

.coddb-username-preview-box {
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 6px;
    padding: 15px;
    text-align: center;
    min-height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.coddb-message-card-preview-box {
    background: var(--bg-secondary, #1a1a1a);
    border: 1px solid var(--border-color, #333);
    border-radius: 6px;
    padding: 15px;
    min-height: 100px;
}

#coddb-username-preview {
    font-size: 1.3em;
    font-weight: 600;
    display: inline-block;
}

#coddb-message-card-preview {
    width: 100%;
    max-width: none;
    margin: 0;
}

/* Chat message styling for preview */
#coddb-message-card-preview .coddb-chat-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--accent-color, #ff6600);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-right: 15px;
    flex-shrink: 0;
}

#coddb-message-card-preview .coddb-chat-message-content {
    flex: 1;
    min-width: 0;
}

#coddb-message-card-preview .coddb-chat-message-header {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    gap: 10px;
}

#coddb-message-card-preview .coddb-chat-message-author {
    font-weight: 600;
    color: var(--accent-color, #ff6600);
}

#coddb-message-card-preview .coddb-chat-message-time {
    font-size: 0.8em;
    color: var(--text-secondary, #ccc);
}

#coddb-message-card-preview .coddb-chat-message-text {
    color: var(--text-primary, #e0e0e0);
    line-height: 1.4;
    word-break: break-word;
}

#coddb-message-card-preview.coddb-chat-message {
    display: flex;
    align-items: flex-start;
    padding: 15px;
    margin: 0;
    background: var(--bg-tertiary, #2a2a2a);
    border-radius: 8px;
    transition: all 0.3s ease;
}

/* Animation speed classes for message cards */
.coddb-message-speed-slow {
    animation-duration: 1.5s !important;
}

.coddb-message-speed-normal {
    animation-duration: 0.8s !important;
}

.coddb-message-speed-fast {
    animation-duration: 0.4s !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .coddb-customization-content {
        padding: 15px;
    }
    
    .coddb-customization-section {
        padding: 15px;
    }
    
    .coddb-section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .coddb-form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .coddb-customization-actions {
        flex-direction: column;
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    .coddb-username,
    .coddb-message-card {
        animation: none !important;
        transition: none !important;
    }
    
    .coddb-username-glow-pulse,
    .coddb-username-animation-fade,
    .coddb-username-animation-bounce,
    .coddb-username-animation-color-shift,
    .coddb-username-animation-wave,
    .coddb-username-animation-gradient-shift,
    .coddb-message-animation-fade,
    .coddb-message-animation-slide,
    .coddb-message-animation-bounce,
    .coddb-message-animation-glow {
        animation: none !important;
    }
}
