/* MySpace Profile Editor Styles */

.myspace-editor-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 10000;
    overflow-y: auto;
}

.myspace-editor-content {
    background: linear-gradient(to bottom, #003399, #0066CC);
    border: 3px solid #FF6600;
    max-width: 1000px;
    margin: 30px auto;
    box-shadow: 0 0 30px rgba(255, 102, 0, 0.5);
}

.myspace-editor-header {
    background: #FF6600;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 3px solid #000;
}

.myspace-editor-header h1 {
    font-family: 'Verdana', sans-serif;
    color: white;
    text-shadow: 2px 2px 4px #000;
    margin: 0;
    font-size: 24px;
}

.close-btn {
    background: red;
    color: white;
    border: 2px solid #000;
    padding: 5px 15px;
    cursor: pointer;
    font-weight: bold;
}

/* Tabs */
.myspace-tabs {
    background: #0066CC;
    padding: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
    border-bottom: 3px solid #000;
}

.myspace-tab {
    background: white;
    color: #0066CC;
    border: 2px solid #000;
    padding: 8px 15px;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.2s;
}

.myspace-tab:hover {
    background: #FFFF00;
    transform: scale(1.05);
}

.myspace-tab.active {
    background: #FF6600;
    color: white;
}

/* Editor Body */
.myspace-editor-body {
    background: white;
    padding: 20px;
    min-height: 500px;
}

.myspace-tab-content {
    display: none;
}

.myspace-tab-content.active {
    display: block;
}

.myspace-tab-content h2 {
    color: #0066CC;
    border-bottom: 3px solid #FF6600;
    padding-bottom: 10px;
    margin-bottom: 20px;
    font-family: 'Georgia', serif;
}

/* Form Styles */
.myspace-form-group {
    margin-bottom: 20px;
}

.myspace-form-group label {
    display: block;
    font-weight: bold;
    color: #003399;
    margin-bottom: 5px;
}

.myspace-form-group input[type="text"],
.myspace-form-group input[type="color"],
.myspace-form-group select,
.myspace-form-group textarea {
    width: 100%;
    padding: 8px;
    border: 2px solid #0066CC;
    font-family: 'Verdana', sans-serif;
}

.myspace-form-group textarea {
    resize: vertical;
    font-family: 'Courier New', monospace;
}

.myspace-form-group small {
    color: #666;
    font-style: italic;
}

.myspace-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.myspace-checkbox-group {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.myspace-checkbox-group label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: normal;
}

/* Theme Grid */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-top: 10px;
}

.theme-card {
    border: 3px solid #000;
    cursor: pointer;
    transition: all 0.2s;
}

.theme-card:hover {
    transform: scale(1.05);
    box-shadow: 5px 5px 0 #FF6600;
}

.theme-card.selected {
    border-color: #FF6600;
    box-shadow: 0 0 10px #FF6600;
}

.theme-preview {
    padding: 20px;
    text-align: center;
    color: white;
    font-weight: bold;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Color Options */
.color-options {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
}

.color-options input[type="color"] {
    width: 100%;
    height: 40px;
    cursor: pointer;
}

/* Custom CSS Section */
#customCSSSection textarea {
    font-family: 'Courier New', monospace;
    background: #000;
    color: #0F0;
    padding: 10px;
}

/* Top Friends Grid */
.top-friends-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.friend-slot {
    aspect-ratio: 1;
    border: 2px dashed #0066CC;
    display: flex;
    align-items: center;
    justify-content: center;
}

.friend-placeholder {
    font-size: 24px;
    font-weight: bold;
    color: #CCC;
}

/* Upload Button */
.upload-btn {
    background: linear-gradient(to bottom, #FF69B4, #FF1493);
    color: white;
    border: 2px solid #FF1493;
    padding: 8px 16px;
    border-radius: 20px;
    cursor: pointer;
    font-family: 'Comic Neue', cursive;
    font-weight: bold;
    transition: all 0.3s ease;
    box-shadow: 2px 2px 0 rgba(0,0,0,0.2);
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 4px 4px 0 rgba(0,0,0,0.3);
}

.upload-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Preview Frame */
.profile-preview-frame {
    width: 100%;
    height: 600px;
    border: 3px solid #000;
    background: white;
}

/* Footer */
.myspace-editor-footer {
    background: #FF6600;
    padding: 15px;
    display: flex;
    justify-content: center;
    gap: 20px;
    border-top: 3px solid #000;
}

.myspace-save-btn,
.myspace-view-btn {
    background: white;
    color: #003399;
    border: 3px solid #000;
    padding: 10px 30px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s;
}

.myspace-save-btn:hover,
.myspace-view-btn:hover {
    background: #FFFF00;
    transform: scale(1.05);
}

/* Animations */
@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

@keyframes sparkle {
    0% { transform: scale(1) rotate(0deg); }
    50% { transform: scale(1.2) rotate(180deg); }
    100% { transform: scale(1) rotate(360deg); }
}

/* Mobile Responsive */
@media (max-width: 768px) {
    /* Editor modal mobile */
    .myspace-editor-modal {
        padding: 0;
    }
    
    .myspace-editor-content {
        margin: 0;
        max-width: 100%;
        width: 100%;
        border: none;
        border-radius: 0;
    }
    
    .myspace-editor-header {
        padding: 1rem;
        flex-direction: column;
        gap: 1rem;
    }
    
    .myspace-editor-header h1 {
        font-size: 1.5rem;
    }
    
    .myspace-tabs {
        flex-direction: row;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }
    
    .myspace-tab {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
        white-space: nowrap;
    }
    
    .myspace-editor-body {
        padding: 1rem;
        min-height: auto;
    }
    
    .myspace-tab-content h2 {
        font-size: 1.25rem;
        margin-bottom: 1rem;
    }
    
    /* Form elements mobile */
    .myspace-form-group {
        margin-bottom: 1rem;
    }
    
    .myspace-form-group label {
        font-size: 0.9rem;
        margin-bottom: 0.5rem;
    }
    
    .myspace-form-group input,
    .myspace-form-group textarea,
    .myspace-form-group select {
        width: 100%;
        padding: 0.5rem;
        font-size: 0.9rem;
        box-sizing: border-box;
    }
    
    .myspace-form-group textarea {
        min-height: 80px;
    }
    
    /* Theme and friends grids mobile */
    .theme-grid,
    .top-friends-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
    }
    
    .theme-preview {
        padding: 0.5rem;
        font-size: 0.8rem;
    }
    
    .friend-slot {
        padding: 0.5rem;
    }
    
    .friend-slot img {
        width: 40px;
        height: 40px;
    }
    
    /* Form rows and color options mobile */
    .myspace-form-row,
    .color-options {
        grid-template-columns: 1fr;
        gap: 0.5rem;
    }
    
    /* Profile preview mobile */
    .preview-section {
        padding: 1rem;
        font-size: 0.9rem;
    }
    
    .preview-header {
        padding: 0.75rem;
    }
    
    .preview-bio {
        padding: 0.75rem;
        font-size: 0.85rem;
    }
    
    /* Song section mobile */
    .song-section {
        padding: 0.75rem;
    }
    
    .song-title,
    .song-artist {
        font-size: 0.9rem;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Buttons mobile */
    .save-profile-btn,
    .cancel-btn {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* Prevent text overflow */
    * {
        word-wrap: break-word;
        overflow-wrap: break-word;
    }
    
    /* Hide horizontal overflow */
    body,
    html {
        overflow-x: hidden;
    }
    
    /* Very small screens */
    @media (max-width: 400px) {
        .myspace-tabs {
            flex-direction: column;
        }
        
        .myspace-tab {
            width: 100%;
            text-align: center;
        }
        
        .theme-grid,
        .top-friends-grid {
            grid-template-columns: 1fr;
        }
        
        .myspace-editor-header h1 {
            font-size: 1.25rem;
        }
    }
}