/* ========================================
   SOCIALMOCK PRO V7.0 STYLES
   ======================================== */

:root {
    --bg-dark: #050505;
    --bg-panel: #0a0a0a;
    --panel-border: #1f1f1f;
    /* Default Accent Color - Updated dynamically via JS */
    --accent-color: #06b6d4;
    --text-main: #e5e7eb;
    --text-muted: #9ca3af;
    --input-bg: #171717;
    --input-border: #262626;
    --font-stack: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-stack);
}

body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    overflow: hidden;
}

/* --- LAYOUT --- */
.app-container {
    display: flex;
    height: 100vh;
}

.background-wrapper {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.mesh-gradient {
    position: absolute;
    inset: 0;
    background: radial-gradient(at 0% 0%, var(--accent-color), transparent 70%);
    opacity: 0.1;
    transition: background 0.3s;
}

/* --- CONTROLS SIDEBAR --- */
.controls-panel {
    width: 400px;
    background: var(--bg-panel);
    border-right: 1px solid var(--panel-border);
    display: flex;
    flex-direction: column;
    z-index: 10;
}

.panel-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--panel-border);
}

.modern-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 6px;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.8rem;
    transition: 0.2s;
}

.modern-back-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.panel-title-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 1rem;
}

.panel-title-row h2 {
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0;
}

.pro-badge {
    background: linear-gradient(135deg, var(--accent-color), #3b82f6);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 800;
    color: #000;
}

/* Hide Scrollbar */
.scrollable-content {
    flex: 1;
    overflow-y: auto;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.scrollable-content::-webkit-scrollbar {
    display: none;
}

.control-section {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    font-weight: 600;
}

/* Platform Grid */
.platform-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
}

.plat-btn {
    aspect-ratio: 1;
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    border-radius: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
}

.plat-btn:hover {
    border-color: var(--accent-color);
    color: #fff;
}

.plat-btn.active {
    background: var(--accent-color);
    border-color: var(--accent-color);
    color: #000;
    box-shadow: 0 0 15px var(--accent-color);
}

/* Inputs */
.modern-input,
.modern-textarea,
.modern-select {
    width: 100%;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    color: #fff;
    padding: 10px;
    border-radius: 8px;
    font-size: 0.9rem;
    outline: none;
    transition: 0.2s;
}

.modern-input:focus,
.modern-textarea:focus,
.modern-select:focus {
    border-color: var(--accent-color);
}

.input-group-row {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.file-upload-circle {
    position: relative;
    width: 56px;
    height: 56px;
    flex-shrink: 0;
}

.file-upload-circle img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--input-border);
}

.file-upload-circle .overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    cursor: pointer;
    transition: 0.2s;
}

.file-upload-circle:hover .overlay {
    opacity: 1;
}

.text-inputs-stack {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.badge-selector-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.color-picker-mini {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    overflow: hidden;
    border: 1px solid var(--input-border);
    cursor: pointer;
}

.color-picker-mini input {
    width: 150%;
    height: 150%;
    margin: -25%;
    cursor: pointer;
}

/* Media & Filters */
.media-upload-area {
    position: relative;
    margin-top: 0.5rem;
}

.media-dropzone {
    border: 2px dashed var(--input-border);
    border-radius: 8px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    cursor: pointer;
    transition: 0.2s;
    background: rgba(255, 255, 255, 0.02);
}

.media-dropzone:hover {
    border-color: var(--accent-color);
    color: var(--accent-color);
    background: rgba(255, 255, 255, 0.05);
}

.remove-media-btn {
    position: absolute;
    top: 5px;
    right: 5px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    cursor: pointer;
}

.filter-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.filter-pill {
    padding: 4px 10px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 20px;
    color: var(--text-muted);
    font-size: 0.75rem;
    cursor: pointer;
    transition: 0.2s;
}

.filter-pill.active {
    background: var(--accent-color);
    color: #000;
    border-color: var(--accent-color);
}

/* Metrics */
.text-btn-small {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 0.75rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 4px;
}

.text-btn-small:hover {
    text-decoration: underline;
}

.metrics-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin-bottom: 8px;
}

.metric-box {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 0 10px;
}

.metric-box i {
    color: var(--text-muted);
    font-size: 0.85rem;
    margin-right: 8px;
}

.metric-box input {
    background: none;
    border: none;
    padding: 8px 0;
    width: 100%;
    color: #fff;
    font-size: 0.9rem;
}

.time-input-row {
    display: flex;
    align-items: center;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 6px;
    padding: 0 10px;
}

.time-input-row input {
    background: none;
    border: none;
    padding: 8px 0;
    width: 100%;
    color: #fff;
    font-size: 0.9rem;
}

/* Settings Switches & Color Picker */
.setting-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #333;
    transition: .4s;
    border-radius: 24px;
}

.slider:before {
    position: absolute;
    content: "";
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    transition: .4s;
    border-radius: 50%;
}

input:checked+.slider {
    background-color: var(--accent-color);
}

input:checked+.slider:before {
    transform: translateX(20px);
}

.color-picker-wrapper {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--input-border);
    cursor: pointer;
}

.color-picker-input {
    width: 150%;
    height: 150%;
    margin: -25%;
    cursor: pointer;
}

/* --- PREVIEW AREA --- */
.preview-area {
    flex: 1;
    background: #000;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 40px;
    overflow-y: auto;
}

.preview-toolbar {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 50;
    display: flex;
    align-items: center;
    gap: 15px;
}

.zoom-label {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.download-btn-primary {
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: 0.2s;
}

.download-btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--accent-color);
    opacity: 0.9;
}

/* --- MOCKUP CARD --- */
.mockup-card {
    width: 500px;
    max-width: 100%;
    border-radius: 16px;
    padding: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
    margin: 20px;
}

/* Header */
.mockup-header {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    margin-bottom: 12px;
}

/* Avatar & Story Ring */
.avatar-container {
    position: relative;
    width: 48px;
    height: 48px;
}

.avatar-img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid transparent;
}

.story-ring {
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    z-index: -1;
    background: linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%);
}

.story-ring.hidden {
    display: none;
}

.user-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.name-row {
    display: flex;
    align-items: center;
    gap: 4px;
}

.display-name {
    font-weight: 700;
    font-size: 16px;
    line-height: 1.2;
}

.badge-icon {
    font-size: 14px;
}

.badge-icon.blue-badge {
    color: #1d9bf0;
}

.badge-icon.gold-badge {
    color: #eab308;
}

.badge-icon.gray-badge {
    color: #71767b;
}

/* Custom Color set via JS */
.handle {
    font-size: 15px;
}

.brand-logo {
    font-size: 1.5rem;
    margin-left: auto;
}

.post-text {
    font-size: 16px;
    line-height: 1.4;
    margin-bottom: 12px;
    white-space: pre-wrap;
}

/* Image Containers */
.std-image-container {
    position: relative;
    width: 100%;
    margin-top: 10px;
}

.post-image {
    width: 100%;
    border-radius: 12px;
    border: 1px solid rgba(0, 0, 0, 0.1);
    display: block;
}

/* LIVE OVERLAY */
.live-overlay {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 100;
    display: flex;
    gap: 8px;
    align-items: center;
}

.live-badge {
    background: #e91e63;
    color: white;
    font-weight: 700;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
}

.viewer-count {
    background: rgba(0, 0, 0, 0.6);
    color: white;
    font-size: 12px;
    padding: 2px 6px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Theme Modes */
.light-mode {
    background: #ffffff;
    color: #0f1419;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

.light-mode .handle,
.light-mode .timestamp,
.light-mode .label {
    color: #536471;
}

.light-mode .divider {
    background: #eff3f4;
}

.light-mode .post-image {
    border-color: #cfd9de;
}

.dark-mode {
    background: #000000;
    color: #e7e9ea;
    border: 1px solid #2f3336;
}

.dark-mode .handle,
.dark-mode .timestamp,
.dark-mode .label {
    color: #71767b;
}

.dark-mode .divider {
    background: #2f3336;
}

.dark-mode .post-image {
    border-color: #2f3336;
}

/* --- PLATFORMS --- */
/* Twitter */
.twitter-theme .brand-logo {
    display: block;
}

.twitter-footer {
    margin-top: 10px;
}

.twitter-footer .stats-row {
    display: flex;
    gap: 20px;
    font-size: 14px;
    padding-top: 12px;
}

.twitter-footer .divider {
    height: 1px;
    margin: 12px 0;
}

/* Instagram */
.instagram-theme .brand-logo {
    display: none;
}

.instagram-theme .mockup-header {
    align-items: center;
    margin-bottom: 10px;
}

.instagram-footer .ig-actions {
    display: flex;
    justify-content: space-between;
    font-size: 1.5rem;
    margin: 8px 0;
}

.instagram-footer .ig-left {
    display: flex;
    gap: 16px;
}

.instagram-footer .ig-likes {
    font-size: 14px;
    margin-bottom: 6px;
}

.instagram-footer .ig-caption-line {
    font-size: 14px;
    margin-bottom: 6px;
}

.instagram-footer .ig-comments-link {
    font-size: 14px;
    color: #8e8e8e;
    margin-bottom: 4px;
}

.instagram-footer .ig-time {
    font-size: 10px;
    color: #8e8e8e;
    text-transform: uppercase;
}

/* LinkedIn */
.linkedin-theme .brand-logo {
    display: none;
}

.linkedin-theme .handle {
    font-size: 12px;
    color: #666;
}

.linkedin-theme .avatar-img {
    border-radius: 4px;
}

.linkedin-footer .li-stats {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}

.linkedin-footer .li-divider {
    height: 1px;
    background: rgba(0, 0, 0, 0.1);
    margin-bottom: 4px;
}

.dark-mode .linkedin-footer .li-divider {
    background: rgba(255, 255, 255, 0.1);
}

.linkedin-footer .li-actions {
    display: flex;
    justify-content: space-around;
    padding: 10px 0 0;
}

.linkedin-footer .li-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    font-size: 12px;
    color: #666;
    font-weight: 600;
    gap: 4px;
    cursor: pointer;
}

.linkedin-footer .li-btn i {
    font-size: 1.2rem;
}

/* Facebook */
.facebook-theme .brand-logo {
    display: none;
}

.facebook-theme .handle {
    display: none;
}

.facebook-theme .fb-time {
    display: block;
    font-size: 13px;
    color: #65676b;
    margin-top: 2px;
}

.facebook-footer .fb-stats {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: #65676b;
    padding-bottom: 10px;
}

.facebook-footer .fb-actions {
    display: flex;
    justify-content: space-around;
    padding-top: 8px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

.fb-btn {
    display: flex;
    gap: 6px;
    align-items: center;
    font-weight: 600;
    font-size: 14px;
    color: inherit;
}

/* --- TIKTOK FIXES --- */
.tiktok-theme {
    width: 375px;
    height: 667px;
    padding: 0;
    border: none;
    background: #000;
    color: #fff;
    position: relative;
    font-family: 'Proxima Nova', sans-serif;
}

.tiktok-bg-layer {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.tiktok-bg-layer img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.tiktok-gradient-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 50%;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
}

.tiktok-theme .mockup-header,
.tiktok-theme .mockup-footer {
    display: none;
}

.tiktok-theme .mockup-body {
    position: absolute;
    bottom: 20px;
    left: 16px;
    right: 80px;
    z-index: 10;
    margin: 0;
}

.tiktok-theme .display-name {
    font-size: 18px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    display: block;
    margin-bottom: 5px;
}

.tiktok-theme .post-text {
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    margin-bottom: 8px;
}

/* TikTok Right Sidebar & Plus Icon Fix */
.tiktok-right-sidebar {
    position: absolute;
    right: 10px;
    bottom: 100px;
    z-index: 20;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
}

.avatar-stack {
    position: relative;
    margin-bottom: 15px;
}

.tt-avatar-img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #fff;
    box-sizing: border-box;
}

/* FIX: Correctly positioned plus icon */
.plus-icon {
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 22px;
    height: 22px;
    background: #fe2c55;
    border-radius: 50%;
    border: 2px solid #fff;
    color: #fff;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}

.tt-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    color: #fff;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}

.tt-action i {
    font-size: 32px;
}

.tt-action span {
    font-size: 12px;
    font-weight: 600;
}

/* TikTok Music Row (FIXED: Larger Icon, Static Text) */
.tiktok-music-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 10px;
    width: 100%;
    color: #fff;
}

.music-note-icon {
    font-size: 18px;
    flex-shrink: 0;
}

/* Larger */
.music-label-fixed {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.tt-disc-anim {
    width: 48px;
    height: 48px;
    background: #222;
    border-radius: 50%;
    border: 8px solid #111;
    animation: spin 4s linear infinite;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.disc-inner {
    width: 26px;
    height: 26px;
    background: #fff;
    border-radius: 50%;
    background-size: cover;
    background-position: center;
}

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

/* Helpers */
.hidden {
    display: none !important;
}

.watermark {
    position: absolute;
    bottom: 5px;
    right: 10px;
    font-size: 10px;
    opacity: 0.5;
    pointer-events: none;
}

/* Mobile */
.mobile-header {
    display: none;
    justify-content: space-between;
    padding: 1rem;
    background: rgba(15, 15, 15, 0.9);
    border-bottom: 1px solid var(--panel-border);
    align-items: center;
}

.brand {
    display: flex;
    gap: 10px;
    align-items: center;
    font-weight: 700;
    color: #fff;
}

.logo-box {
    width: 30px;
    height: 30px;
    background: var(--accent-color);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #000;
}

.back-btn {
    color: #fff;
    font-size: 1.2rem;
}

.mobile-action-bar {
    padding: 1rem;
    border-top: 1px solid var(--panel-border);
    background: var(--bg-panel);
}

.action-btn-main {
    width: 100%;
    background: var(--accent-color);
    color: #000;
    border: none;
    padding: 12px;
    border-radius: 8px;
    font-weight: 700;
}

@media (max-width: 900px) {
    .app-container {
        flex-direction: column;
        height: auto;
    }

    .controls-panel {
        width: 100%;
        height: auto;
        border-right: none;
    }

    .desktop-only {
        display: none;
    }

    .mobile-header {
        display: flex;
    }

    .preview-area {
        padding: 40px 20px;
        min-height: 60vh;
    }

    .mockup-card {
        width: 100%;
        margin: 0;
    }
}

@media (min-width: 901px) {
    .mobile-only {
        display: none;
    }
}
