/* ============================================
   MYSPACE-STYLE PROFILE CUSTOMIZATION CSS
   ============================================
   Web 2.0 / MySpace-era styling for profiles.
   Captures that raw, customizable maximalism.
   ============================================ */

/* Import colors */
@import url('colours.css');

/* ============================================
   PROFILE LAYOUT - TWO COLUMN STRUCTURE
   ============================================ */

.myspace-profile {
    display: grid;
    grid-template-columns: 40% 60%;
    gap: 20px;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

@media (max-width: 900px) {
    .myspace-profile {
        grid-template-columns: 1fr;
    }
}

/* ============================================
   LEFT COLUMN - THE IDENTITY
   ============================================ */

.profile-identity {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Display Name - Big and Bold */
.profile-display-name {
    font-size: 1.8em;
    font-weight: bold;
    text-align: center;
    word-wrap: break-word;
    padding: 10px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

/* Profile Picture - Strictly 1:1, no circular crop */
.profile-picture-container {
    display: flex;
    justify-content: center;
    padding: 10px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

.profile-picture {
    width: 200px;
    height: 200px;
    object-fit: cover;
    /* NO border-radius - MySpace was square! */
    border: 3px solid var(--color-border-lighter);
}

.profile-picture-placeholder {
    width: 200px;
    height: 200px;
    background: var(--color-bg-button);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-subtle);
    font-size: 3em;
}

/* Headline/Status */
.profile-headline {
    text-align: center;
    font-style: italic;
    color: var(--color-text-muted);
    padding: 10px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

.profile-headline-status {
    font-size: 0.9em;
}

/* Contact Box - 2x2 Grid */
.profile-contact-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 5px;
    padding: 10px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

.profile-contact-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px;
    background: var(--color-bg-button);
    border: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
    text-decoration: none;
    font-size: 0.85em;
    transition: background 0.2s;
    cursor: pointer;
}

.profile-contact-btn:hover {
    background: var(--color-bg-button-hover);
}

.profile-contact-btn.danger:hover {
    background: var(--color-primary);
}

/* Info Box */
.profile-info-box {
    padding: 15px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

.profile-info-box h4 {
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--color-border-primary);
    color: var(--color-text-primary);
}

.profile-info-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px dotted var(--color-border-secondary);
}

.profile-info-item:last-child {
    border-bottom: none;
}

.profile-info-label {
    color: var(--color-text-subtle);
    font-weight: bold;
}

.profile-info-value {
    color: var(--color-text-primary);
}

/* Interests Section */
.profile-interests {
    padding: 15px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

.profile-interests h4 {
    margin: 0 0 10px 0;
    padding-bottom: 5px;
    border-bottom: 1px solid var(--color-border-primary);
    color: var(--color-text-primary);
}

.profile-interest-section {
    margin-bottom: 15px;
}

.profile-interest-section:last-child {
    margin-bottom: 0;
}

.profile-interest-label {
    font-weight: bold;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.profile-interest-content {
    color: var(--color-text-muted);
    font-size: 0.9em;
    line-height: 1.5;
}

/* ============================================
   RIGHT COLUMN - THE STAGE
   ============================================ */

.profile-stage {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

/* Network Banner */
.profile-network-banner {
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
    border: 2px solid var(--color-primary);
    text-align: center;
    font-size: 0.95em;
}

.profile-network-banner strong {
    color: var(--color-primary);
}

/* The Blurb / About Me - THE CUSTOMIZATION ZONE */
.profile-about-section {
    padding: 20px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
    /* Allow user CSS to override */
    position: relative;
}

.profile-about-section h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.profile-about-content {
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Who I'd Like To Meet */
.profile-meet-section {
    padding: 20px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

.profile-meet-section h3 {
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
}

/* ============================================
   TOP FRIENDS - THE SOCIAL CURRENCY
   ============================================ */

.profile-top-friends {
    padding: 20px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

.profile-top-friends-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
}

.profile-top-friends-header h3 {
    margin: 0;
    color: var(--color-primary);
}

.profile-friends-count {
    color: var(--color-text-muted);
    font-size: 0.9em;
}

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

.top-friends-grid.count-4 {
    grid-template-columns: repeat(2, 1fr);
}

.top-friends-grid.count-12 {
    grid-template-columns: repeat(4, 1fr);
}

.top-friends-grid.count-24 {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 600px) {
    .top-friends-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .top-friends-grid.count-24 {
        grid-template-columns: repeat(3, 1fr);
    }
}

.top-friend-cell {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-secondary);
    transition: background 0.2s;
}

.top-friend-cell:hover {
    background: var(--color-bg-hover);
}

.top-friend-cell.rank-1 {
    border: 2px solid var(--color-primary);
    background: var(--color-primary-transparent-10);
}

.top-friend-photo {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid var(--color-border-light);
    margin-bottom: 8px;
}

.top-friend-photo-placeholder {
    width: 60px;
    height: 60px;
    background: var(--color-bg-button);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-subtle);
    margin-bottom: 8px;
    font-size: 1.5em;
}

.top-friend-name {
    color: var(--color-primary);
    text-decoration: none;
    font-size: 0.85em;
    text-align: center;
    word-wrap: break-word;
}

.top-friend-name:hover {
    text-decoration: underline;
}

/* ============================================
   PROFILE MUSIC PLAYER
   ============================================ */

.profile-music-player {
    padding: 15px;
    background: linear-gradient(180deg, var(--color-bg-secondary) 0%, var(--color-bg-primary) 100%);
    border: 2px solid var(--color-border-primary);
}

.profile-music-player h4 {
    margin: 0 0 10px 0;
    color: var(--color-text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.profile-music-player h4::before {
    content: "🎵";
}

.profile-music-info {
    margin-bottom: 10px;
}

.profile-music-title {
    font-weight: bold;
    color: var(--color-text-primary);
}

.profile-music-artist {
    color: var(--color-text-muted);
    font-size: 0.9em;
}

.profile-audio-player {
    width: 100%;
    height: 40px;
}

/* Custom audio player styling */
.profile-audio-player::-webkit-media-controls-panel {
    background: var(--color-bg-hover);
}

/* ============================================
   PROFILE COMMENTS / THE WALL
   ============================================ */

.profile-wall {
    padding: 20px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

.profile-wall-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
}

.profile-wall-header h3 {
    margin: 0;
    color: var(--color-primary);
}

/* Comment Form */
.profile-wall-form {
    margin-bottom: 20px;
    padding: 15px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-secondary);
}

.profile-wall-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 10px;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
    resize: vertical;
    font-family: inherit;
    margin-bottom: 10px;
}

.profile-wall-form textarea:focus {
    outline: none;
    border-color: var(--color-primary);
}

.profile-wall-form button {
    padding: 8px 20px;
    background: var(--color-primary);
    border: none;
    color: var(--color-text-primary);
    cursor: pointer;
    font-weight: bold;
}

.profile-wall-form button:hover {
    background: var(--color-primary-dark);
}

/* Comments List */
.profile-wall-comments {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.profile-wall-comment {
    display: flex;
    gap: 15px;
    padding: 15px;
    background: var(--color-bg-secondary);
    border: 1px solid var(--color-border-secondary);
    border-left: 3px solid var(--color-border-light);
}

.profile-wall-comment-avatar {
    flex-shrink: 0;
}

.profile-wall-comment-avatar img {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 2px solid var(--color-border-light);
}

.profile-wall-comment-avatar-placeholder {
    width: 50px;
    height: 50px;
    background: var(--color-bg-button);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-subtle);
}

.profile-wall-comment-content {
    flex: 1;
    min-width: 0;
}

.profile-wall-comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.profile-wall-comment-author {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: bold;
}

.profile-wall-comment-author:hover {
    text-decoration: underline;
}

.profile-wall-comment-date {
    color: var(--color-text-subtle);
    font-size: 0.85em;
}

.profile-wall-comment-text {
    line-height: 1.5;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.profile-wall-comment-actions {
    margin-top: 10px;
}

.profile-wall-comment-delete {
    background: none;
    border: none;
    color: var(--color-text-subtle);
    font-size: 0.85em;
    cursor: pointer;
}

.profile-wall-comment-delete:hover {
    color: var(--color-primary);
}

/* ============================================
   LEGACY FUN ELEMENTS
   ============================================ */

/* Marquee styling */
marquee {
    padding: 5px 0;
}

/* Blink animation (modern browsers don't support <blink>) */
blink, .blink {
    animation: blink-animation 1s steps(5, start) infinite;
}

@keyframes blink-animation {
    to {
        visibility: hidden;
    }
}

/* Glitter text effect class */
.glitter-text {
    background: linear-gradient(
        90deg, 
        #ff0000, #ff7f00, #ffff00, #00ff00, #0000ff, #4b0082, #9400d3
    );
    background-size: 200% auto;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: glitter-shift 2s linear infinite;
}

@keyframes glitter-shift {
    to {
        background-position: 200% center;
    }
}

/* Sparkle cursor class */
.sparkle-cursor {
    cursor: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='32' height='32' viewBox='0 0 32 32'%3E%3Ctext y='24' font-size='24'%3E✨%3C/text%3E%3C/svg%3E"), auto;
}

/* ============================================
   PROFILE EDIT PAGE STYLES
   ============================================ */

.profile-edit-section {
    margin-bottom: 30px;
    padding: 20px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

.profile-edit-section h3 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.profile-edit-row {
    margin-bottom: 20px;
}

.profile-edit-row label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: var(--color-text-primary);
}

.profile-edit-row input[type="text"],
.profile-edit-row input[type="url"],
.profile-edit-row textarea,
.profile-edit-row select {
    width: 100%;
    padding: 10px;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
    font-family: inherit;
}

.profile-edit-row input:focus,
.profile-edit-row textarea:focus,
.profile-edit-row select:focus {
    outline: none;
    border-color: var(--color-primary);
}

.profile-edit-row textarea {
    min-height: 100px;
    resize: vertical;
}

.profile-edit-row textarea.code-input {
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    min-height: 200px;
}

.profile-edit-row small {
    display: block;
    margin-top: 5px;
    color: var(--color-text-subtle);
    font-size: 0.85em;
}

.profile-edit-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
}

.profile-edit-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
}

/* Color Picker Row */
.profile-color-picker-row {
    display: flex;
    align-items: center;
    gap: 15px;
}

.profile-color-picker-row input[type="color"] {
    width: 50px;
    height: 40px;
    padding: 0;
    border: 2px solid var(--color-border-light);
    cursor: pointer;
}

.profile-color-picker-row input[type="text"] {
    flex: 1;
    max-width: 120px;
}

/* Background Preview */
.background-preview {
    width: 100%;
    height: 100px;
    margin-top: 10px;
    border: 2px dashed var(--color-border-light);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-subtle);
    overflow: hidden;
}

/* ============================================
   TOP FRIENDS EDITOR
   ============================================ */

.top-friends-editor {
    padding: 20px;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
}

.top-friends-editor h3 {
    margin: 0 0 20px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--color-primary);
    color: var(--color-primary);
}

.top-friends-slots {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

@media (max-width: 600px) {
    .top-friends-slots {
        grid-template-columns: repeat(2, 1fr);
    }
}

.top-friend-slot {
    padding: 15px;
    background: var(--color-bg-secondary);
    border: 2px dashed var(--color-border-light);
    text-align: center;
    min-height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.top-friend-slot:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-hover);
}

.top-friend-slot.filled {
    border-style: solid;
}

.top-friend-slot.rank-1 {
    border-color: var(--color-primary);
    background: var(--color-primary-transparent-10);
}

.top-friend-slot .slot-number {
    position: absolute;
    top: 5px;
    left: 5px;
    width: 20px;
    height: 20px;
    background: var(--color-primary);
    color: var(--color-text-primary);
    border-radius: 50%;
    font-size: 0.75em;
    display: flex;
    align-items: center;
    justify-content: center;
}

.top-friend-slot .add-friend-icon {
    font-size: 2em;
    color: var(--color-text-subtle);
    margin-bottom: 5px;
}

.top-friend-slot .add-friend-text {
    font-size: 0.85em;
    color: var(--color-text-subtle);
}

.top-friend-slot .remove-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    width: 20px;
    height: 20px;
    background: var(--color-bg-error);
    color: var(--color-text-primary);
    border: none;
    cursor: pointer;
    font-size: 0.8em;
    opacity: 0;
    transition: opacity 0.2s;
}

.top-friend-slot:hover .remove-btn {
    opacity: 1;
}

/* Friends Picker Modal */
.friends-picker-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}

.friends-picker-overlay.active {
    display: flex;
}

.friends-picker-modal {
    width: 90%;
    max-width: 500px;
    max-height: 80vh;
    background: var(--color-bg-primary);
    border: 2px solid var(--color-border-primary);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.friends-picker-header {
    padding: 15px 20px;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border-primary);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.friends-picker-header h4 {
    margin: 0;
    color: var(--color-text-primary);
}

.friends-picker-close {
    background: none;
    border: none;
    color: var(--color-text-primary);
    font-size: 1.5em;
    cursor: pointer;
}

.friends-picker-search {
    padding: 15px 20px;
    border-bottom: 1px solid var(--color-border-secondary);
}

.friends-picker-search input {
    width: 100%;
    padding: 10px;
    background: var(--color-bg-input);
    border: 1px solid var(--color-border-light);
    color: var(--color-text-primary);
}

.friends-picker-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px;
}

.friends-picker-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.friends-picker-item:hover {
    background: var(--color-bg-hover);
}

.friends-picker-item img {
    width: 40px;
    height: 40px;
    object-fit: cover;
    border: 2px solid var(--color-border-light);
}

.friends-picker-item span {
    color: var(--color-text-primary);
}

/* ============================================
   CSS INJECTION PREVIEW
   ============================================ */

.css-preview-container {
    margin-top: 20px;
    border: 2px solid var(--color-border-light);
    overflow: hidden;
}

.css-preview-header {
    padding: 10px 15px;
    background: var(--color-bg-secondary);
    border-bottom: 1px solid var(--color-border-primary);
    font-size: 0.9em;
    color: var(--color-text-muted);
}

.css-preview-frame {
    width: 100%;
    height: 300px;
    background: var(--color-bg-body);
}

/* Warning for dangerous CSS */
.css-warning {
    padding: 10px 15px;
    background: var(--color-bg-error);
    border: 1px solid var(--color-primary);
    color: var(--color-text-primary);
    margin-bottom: 10px;
    font-size: 0.9em;
}

.css-warning strong {
    color: var(--color-primary);
}
