/* ============================================================
   FriendSpace - Default MySpace-style Theme
   ============================================================ */

:root {
    --bg-color: #e5e5e5;
    --accent-color: #3366cc;
    --text-color: #222;
    --link-color: #003399;
    --card-bg: #ffffff;
    --card-bg2: #ffffff;
    --border-color: #6699cc;
    --font-family: Verdana, Arial, Helvetica, sans-serif;
    --glow: none;
    --header-h: 74px;
    --player-h: 52px;
    --header-blue-dark: #003399;
    --header-blue-mid: #3366cc;
    --header-orange: #ffcc99;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    overflow-y: scroll;
}

body {
    background: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 11px;
    line-height: 1.35;
    min-height: 100vh;
}

body.has-music-player {
    padding-bottom: var(--player-h);
}

a {
    color: var(--link-color);
    text-decoration: underline;
}

a:hover {
    color: #cc0000;
}

img {
    display: block;
    max-width: 100%;
}

.container {
    width: 100%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0 10px;
}

main.container {
    background: #fff;
    border-left: 1px solid #b7b7b7;
    border-right: 1px solid #b7b7b7;
    padding-top: 12px;
    padding-bottom: 20px;
}

.main-header {
    position: sticky;
    top: 0;
    z-index: 500;
}

.header-top {
    background: linear-gradient(to bottom, var(--header-blue-mid), var(--header-blue-dark));
    border-bottom: 1px solid #1d4499;
}

.header-top-inner {
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.logo a {
    color: #fff;
    text-decoration: none;
    font-size: 30px;
    font-weight: bold;
    line-height: 1;
    letter-spacing: -2px;
    text-transform: lowercase;
}

.logo a span {
    color: #ffcc66;
}

.header-utility-links {
    color: #fff;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    font-size: 11px;
}

.header-utility-links a {
    color: #fff;
    text-decoration: none;
    font-weight: bold;
}

.header-utility-links a:hover {
    color: #fff;
    text-decoration: underline;
}

.header-nav {
    background: linear-gradient(to bottom, #85a7e2, #5d82d1);
    border-bottom: 1px solid #446dc2;
}

.header-nav .container {
    min-height: 28px;
    display: flex;
    align-items: center;
}

.nav-links {
    list-style: none;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0;
}

.nav-links li {
    position: relative;
}

.nav-links li + li::before {
    content: "|";
    color: #fff;
    position: absolute;
    left: -2px;
    top: 5px;
}

.nav-links a {
    display: block;
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: bold;
    padding: 5px 10px;
}

.nav-links a:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
}

.main-footer {
    background: #d8d8d8;
    border-top: 1px solid #b7b7b7;
    color: #666;
    text-align: center;
    padding: 10px 0 18px;
    font-size: 10px;
}

.btn-primary,
.btn-secondary,
.btn-danger {
    display: inline-block;
    padding: 3px 8px;
    border: 1px solid #999;
    color: #000;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 11px;
    font-weight: bold;
    line-height: 1.2;
    text-align: center;
    text-decoration: none;
    background: linear-gradient(to bottom, #fefefe, #dcdcdc);
}

.btn-primary {
    background: linear-gradient(to bottom, #fff4cf, #ffcc66);
    border-color: #d8a23f;
}

.btn-danger {
    background: linear-gradient(to bottom, #ffd1cc, #ff8f80);
    border-color: #d76b60;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-danger:hover {
    color: #000;
    filter: brightness(0.98);
}

.btn-sm {
    padding: 2px 7px;
}

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

.form-group label {
    display: block;
    margin-bottom: 3px;
    color: #444;
    font-weight: bold;
}

.form-group input[type=text],
.form-group input[type=email],
.form-group input[type=password],
.form-group input[type=color],
.form-group input[type=url],
.form-group select,
.form-group textarea,
.comment-form textarea {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid #999;
    background: #fff;
    color: #000;
    font-family: var(--font-family);
    font-size: 11px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus,
.comment-form textarea:focus {
    outline: 1px solid #6d8fd6;
    border-color: #6d8fd6;
}

.error-message,
.success-message {
    margin-bottom: 10px;
    padding: 6px 8px;
    border: 1px solid;
    font-size: 11px;
}

.error-message {
    background: #fff0ee;
    border-color: #dd8a80;
    color: #9b1c0f;
}

.success-message {
    background: #eef9e8;
    border-color: #85bb72;
    color: #295b17;
}

.auth-page {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    padding: 42px 12px;
    background: #e5e5e5;
}

.auth-container {
    width: 100%;
    max-width: 380px;
    background: #fff;
    border: 1px solid #6699cc;
    padding: 16px;
}

.auth-container h1 {
    color: #003399;
    font-size: 34px;
    letter-spacing: -2px;
    text-transform: lowercase;
    text-align: left;
    margin-bottom: 6px;
}

.auth-container h2 {
    background: linear-gradient(to bottom, #ffdfb5, #ffcc99);
    border: 1px solid #ffb95e;
    color: #cc6600;
    font-size: 12px;
    margin-bottom: 14px;
    padding: 5px 8px;
    text-align: left;
}

.auth-container .btn-primary {
    width: 100%;
    margin-top: 4px;
}

.auth-footer {
    margin-top: 12px;
    color: #666;
    font-size: 11px;
}

.ms-box {
    background: var(--card-bg2);
    border: 1px solid var(--border-color);
    margin-bottom: 10px;
    overflow: hidden;
}

.ms-box-header {
    background: linear-gradient(to bottom, #ffdfb5, var(--header-orange));
    border-bottom: 1px solid #ffb14f;
    color: #cc6600;
    padding: 4px 8px;
    font-size: 11px;
    font-weight: bold;
}

.ms-box-header a {
    color: #003399;
    float: right;
    font-size: 11px;
    font-weight: normal;
}

.ms-box-body {
    padding: 8px;
}

.landing-hero {
    text-align: center;
    padding: 28px 18px 22px;
    border: 1px solid #6699cc;
    background: linear-gradient(to bottom, #f7fbff, #e9f1ff);
    margin-bottom: 14px;
}

.landing-hero h1 {
    color: #003399;
    font-size: 48px;
    letter-spacing: -3px;
    text-transform: lowercase;
    margin-bottom: 8px;
}

.landing-hero h1 span {
    color: #ff9900;
}

.landing-hero p {
    font-size: 13px;
    margin-bottom: 14px;
}

.landing-cta {
    display: flex;
    justify-content: center;
    gap: 8px;
    flex-wrap: wrap;
}

.landing-features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 10px;
}

.feature-card {
    background: #fff;
    border: 1px solid #6699cc;
    padding: 10px;
    text-align: center;
}

.feature-card .icon {
    font-size: 22px;
    margin-bottom: 6px;
}

.feature-card h3 {
    color: #003399;
    font-size: 12px;
    margin-bottom: 4px;
}

.feature-card p {
    color: #444;
    font-size: 11px;
}

.profile-header-bar {
    border: 1px solid #6699cc;
    background: linear-gradient(to bottom, #f8fbff, #eaf1fd);
    margin-bottom: 10px;
    padding: 12px 0;
}

.profile-header-inner {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.profile-avatar-wrap img {
    width: 110px;
    height: 110px;
    object-fit: cover;
    border: 1px solid #999;
    background: #fff;
    padding: 2px;
}

.profile-header-info {
    flex: 1;
}

.profile-header-info h1 {
    color: #003399;
    font-size: 24px;
    line-height: 1.1;
    margin-bottom: 2px;
}

.profile-header-info .tagline {
    color: #555;
    font-style: italic;
    margin-bottom: 4px;
}

.profile-online-badge {
    display: inline-block;
    background: #edf8e7;
    border: 1px solid #95c67c;
    color: #2f6d1e;
    font-size: 10px;
    font-weight: bold;
    padding: 1px 6px;
}

.profile-header-actions {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-end;
}

.profile-header-actions .btn-primary,
.profile-header-actions .btn-secondary,
.profile-header-actions .btn-danger {
    min-width: 116px;
}

.profile-columns {
    display: grid;
    grid-template-columns: 235px 1fr;
    gap: 10px;
    align-items: start;
}

.contact-links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
}

.contact-links a,
.contact-links button,
.contact-links form button {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 28px;
    padding: 5px 6px;
    border: 1px solid #6699cc;
    background: linear-gradient(to bottom, #f4f8ff, #dde8fb);
    color: #003399;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 11px;
    font-weight: bold;
    line-height: 1.1;
    text-align: left;
    text-decoration: none;
}

.contact-links a:hover,
.contact-links button:hover,
.contact-links form button:hover {
    background: linear-gradient(to bottom, #fff9ef, #ffe3bb);
    color: #cc6600;
}

.contact-links .icon {
    font-size: 12px;
}

.profile-stats {
    font-size: 11px;
}

.profile-stats span {
    display: block;
    padding: 3px 0;
    border-bottom: 1px solid #d7e6f7;
}

.profile-stats span:last-child {
    border-bottom: 0;
}

.top8-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px 6px;
}

.top8-friend {
    text-align: center;
}

.top8-friend a {
    text-decoration: none;
}

.top8-friend img {
    width: 90px;
    height: 90px;
    object-fit: cover;
    margin: 0 auto 4px;
    border: 1px solid #999;
    padding: 2px;
    background: #fff;
}

.top8-friend span {
    display: block;
    color: #003399;
    font-size: 10px;
    line-height: 1.2;
}

.bio-content,
.blog-post-body,
.bulletin-body,
.comment-body {
    font-size: 11px;
    line-height: 1.45;
}

.bio-content p {
    margin-bottom: 8px;
}

.profile-blog-list {
    list-style: none;
}

.profile-blog-list li {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    border-bottom: 1px dotted #c4d7ef;
    padding: 4px 0;
    font-size: 11px;
}

.profile-blog-list li:last-child {
    border-bottom: 0;
}

.profile-blog-list .post-title {
    color: #003399;
}

.profile-blog-list .post-date {
    color: #666;
    white-space: nowrap;
}

.comment-item {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 8px;
    padding: 8px 0;
    border-bottom: 1px dotted #c4d7ef;
}

.comment-item:last-child {
    border-bottom: 0;
}

.comment-avatar {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border: 1px solid #999;
    padding: 2px;
    background: #fff;
}

.comment-author a {
    color: #003399;
    font-weight: bold;
}

.comment-date,
.blog-post-card .meta,
.bulletin-meta,
.feed-time,
.friend-card .handle {
    color: #777;
    font-size: 10px;
}

.feed-item {
    display: flex;
    gap: 10px;
    background: #fff;
    border: 1px solid #6699cc;
    padding: 10px;
    margin-bottom: 10px;
}

.feed-item img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 1px solid #999;
    padding: 2px;
    background: #fff;
    flex-shrink: 0;
}

.feed-user strong,
.feed-user strong a {
    color: #003399;
}

.feed-user .handle {
    color: #666;
    margin-left: 4px;
}

.feed-summary {
    margin-top: 4px;
    font-size: 11px;
}

.feed-link {
    display: inline-block;
    margin-top: 4px;
    font-weight: bold;
}

.feed-empty,
.blog-post-card,
.blog-write-area,
.bulletin-card,
.friend-card,
.ep-tab-panel {
    background: #fff;
    border: 1px solid #6699cc;
}

.feed-empty {
    padding: 20px;
    text-align: center;
}

.blog-post-card,
.blog-write-area {
    padding: 12px;
    margin-bottom: 12px;
}

.blog-post-card h2 {
    font-size: 16px;
    margin-bottom: 4px;
}

.blog-post-card h2 a {
    color: #003399;
}

.bulletin-card {
    border-left: 5px solid #ff9900;
    padding: 10px;
    margin-bottom: 10px;
}

.bulletin-subject {
    color: #cc6600;
    font-weight: bold;
    margin-bottom: 4px;
}

.friends-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
    margin-top: 10px;
}

.friend-card {
    padding: 10px;
    text-align: center;
}

.friend-card img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    margin: 0 auto 6px;
    border: 1px solid #999;
    padding: 2px;
    background: #fff;
}

.friend-card .fname {
    color: #003399;
    font-weight: bold;
}

.friend-request-list,
.search-results-list,
.profile-blog-list {
    list-style: none;
}

.friend-request-list li,
.search-results-list li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px dotted #c4d7ef;
    font-size: 11px;
}

.ep-tabs {
    margin-top: 12px;
}

.ep-tab-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.ep-tab-btn {
    background: linear-gradient(to bottom, #fefefe, #dcdcdc);
    border: 1px solid #999;
    color: #333;
    padding: 5px 10px;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 11px;
    font-weight: bold;
}

.ep-tab-btn.active {
    background: linear-gradient(to bottom, #fff4cf, #ffcc66);
    border-color: #d8a23f;
}

.ep-tab-panel {
    display: none;
    margin-top: 6px;
    padding: 12px;
}

.ep-tab-panel.active {
    display: block;
}

.ep-section-title {
    border-top: 1px solid #d7e6f7;
    color: #003399;
    font-size: 11px;
    font-weight: bold;
    margin: 14px 0 8px;
    padding-top: 8px;
}

.ep-section-title:first-child {
    border-top: 0;
    margin-top: 0;
    padding-top: 0;
}

.ai-preview-box {
    display: none;
    border: 1px solid #6699cc;
    margin-top: 12px;
}

.ai-preview-box.visible {
    display: block;
}

.ai-preview-box iframe {
    width: 100%;
    height: 380px;
    border: 0;
}

.ai-preview-actions {
    display: flex;
    gap: 8px;
    padding: 8px;
    border-top: 1px solid #6699cc;
    background: #f5f8ff;
}

.avatar-preview-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.avatar-preview-wrap img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border: 1px solid #999;
    padding: 2px;
    background: #fff;
}

.color-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.color-grid .form-group input[type=color] {
    height: 36px;
    padding: 2px;
}

#music-player-bar {
    position: fixed;
    left: 0;
    bottom: 0;
    z-index: 1000;
    width: 100%;
    height: var(--player-h);
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 12px;
    background: linear-gradient(to bottom, #5d82d1, #3366cc);
    border-top: 2px solid #1d4499;
    color: #fff;
}

.player-icon {
    font-size: 16px;
}

.player-track {
    flex: 1;
    min-width: 0;
}

.player-track-label {
    font-size: 10px;
}

.player-track-name {
    font-size: 11px;
    font-weight: bold;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#player-toggle {
    background: linear-gradient(to bottom, #fff4cf, #ffcc66);
    border: 1px solid #d8a23f;
    color: #000;
    cursor: pointer;
    font-family: var(--font-family);
    font-size: 11px;
    font-weight: bold;
    padding: 4px 10px;
}

#music-player-bar audio {
    display: none;
}

.yt-player-wrap {
    display: none;
    position: fixed;
    right: 0;
    bottom: var(--player-h);
    z-index: 999;
    width: 320px;
    height: 180px;
    border: 2px solid #3366cc;
    background: #fff;
}

.yt-player-wrap.visible {
    display: block;
}

.yt-player-wrap iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.yt-close {
    position: absolute;
    top: 2px;
    right: 4px;
    z-index: 1;
    border: 1px solid #999;
    background: #fff;
    cursor: pointer;
    padding: 0 4px;
    font-size: 11px;
}

.mt1 {
    margin-top: 0.5rem;
}

.mt2 {
    margin-top: 1rem;
}

.mt3 {
    margin-top: 1.5rem;
}

.text-muted {
    color: #666;
}

.text-accent {
    color: #003399;
}

.page-title {
    color: #003399;
    font-size: 20px;
    line-height: 1.2;
    margin: 10px 0;
    padding-bottom: 4px;
    border-bottom: 2px solid #6699cc;
}

@media (max-width: 720px) {
    .header-top-inner {
        flex-direction: column;
        align-items: flex-start;
        padding-top: 8px;
        padding-bottom: 8px;
    }

    .nav-links li + li::before {
        display: none;
    }

    .nav-links a {
        padding: 4px 8px 4px 0;
    }

    .profile-columns {
        grid-template-columns: 1fr;
    }

    .profile-header-inner {
        flex-wrap: wrap;
    }

    .profile-header-actions {
        width: 100%;
        flex-direction: row;
        flex-wrap: wrap;
        align-items: flex-start;
    }

    .contact-links {
        grid-template-columns: 1fr;
    }

    .top8-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .top8-friend img {
        width: 100%;
        height: auto;
        aspect-ratio: 1;
    }

    .landing-hero h1 {
        font-size: 38px;
    }
}
