/* styles.css */
:root {
    --primary-blue: #3b82f6;
    --primary-purple: #8b5cf6;
    --accent-color: #6366f1;
    --gradient-primary: linear-gradient(135deg, var(--primary-blue), var(--primary-purple));
    --sidebar-width: 300px;
    --sidebar-collapsed: 70px;
    --header-height: 60px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --border-radius: 10px;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.15);
}

/* Theme Variables */
:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f8fafc;
    --bg-tertiary: #f1f5f9;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --border-color: #e2e8f0;
}

[data-theme="dark"] {
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;
    --border-color: #334155;
    --shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.4);
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-primary: #0f172a;
        --bg-secondary: #1e293b;
        --bg-tertiary: #334155;
        --text-primary: #f8fafc;
        --text-secondary: #cbd5e1;
        --text-muted: #94a3b8;
        --border-color: #334155;
        --shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
        --shadow-hover: 0 10px 25px rgba(0, 0, 0, 0.4);
    }
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
    transition: var(--transition);
    
}

.app-container {
    display: flex;
    height: 100vh;
    position: relative;
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-secondary);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    z-index: 100;
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sidebar.collapsed {
    width: var(--sidebar-collapsed);
}

.sidebar.collapsed .logo-text,
.sidebar.collapsed .search-input,
.sidebar.collapsed .project-name,
.sidebar.collapsed .project-meta {
    display: none;
}

.sidebar.collapsed .logo {
    justify-content: center;
}

.sidebar.collapsed .logo-icon {
    margin-right: 0;
}

.sidebar.collapsed .project-item {
    padding: 0.75rem;
    justify-content: center;
}

.sidebar.collapsed .project-info {
    display: none;
}

.sidebar.collapsed .theme-btn span {
    display: none;
}

.sidebar.collapsed .theme-toggle {
    justify-content: center;
}

.sidebar-header {
    padding: 1.5rem;
    background: var(--bg-tertiary);
    position: relative;
    overflow: hidden;
}

.header-content {
    position: relative;
    z-index: 2;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.logo-icon {
    width: 42px;
    height: 42px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.logo-icon img {
    width: 100%;
    height: 100%;
    border-radius: 20%;
    object-fit: cover;
}

.logo-text h1 {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.logo-text p {
    font-size: 0.875rem;
    color: var(--text-muted);
}

.theme-toggle {
    display: flex;
    gap: 0.5rem;
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 0.5rem;
}

.theme-btn {
    flex: 1;
    padding: 0.5rem;
    border: none;
    border-radius: 6px;
    background: transparent;
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
}

.theme-btn:hover {
    background: var(--bg-tertiary);
}

.theme-btn.active {
    background: var(--bg-tertiary);
    color: var(--accent-color);
    font-weight: 600;
}

.search-section {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.search-wrapper {
    position: relative;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 3rem;
    border: none;
    border-radius: var(--border-radius);
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 0.95rem;
    outline: none;
    transition: var(--transition);
    box-shadow: var(--shadow);
}

.search-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.search-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.projects-container {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
}

.projects-container::-webkit-scrollbar {
    width: 6px;
}

.projects-container::-webkit-scrollbar-track {
    background: transparent;
}

.projects-container::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.project-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    margin-bottom: 0.5rem;
    background: var(--bg-primary);
    box-shadow: var(--shadow);
}

.project-item:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-hover);
    border-color: var(--primary-blue);
    background: var(--bg-primary);
}

.project-item.active {
    background: var(--gradient-primary);
    color: white;
    transform: none;
}

.project-item.active .project-icon {
    background: rgba(255,255,255,0.2);
    color: white;
}

.project-item.active .project-meta {
    color: rgba(255,255,255,0.8);
}

.project-item.active .media-badge {
    background: rgba(255,255,255,0.2);
    color: white;
}

.project-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: var(--bg-tertiary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-blue);
    font-size: 0.875rem;
    flex-shrink: 0;
}

.project-info {
    flex: 1;
    min-width: 0;
}

.project-name {
    font-weight: 600;
    font-size: 0.95rem;
    line-height: 1.3;
    margin-bottom: 0.25rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.project-meta {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.media-badge {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
    padding: 0.125rem 0.375rem;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    transition: var(--transition);
    position: relative;
}

.content-area {
    flex: 1;
    position: relative;
    background: var(--bg-primary);
    display: flex;
    flex-direction: column;
}

.welcome-screen {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    text-align: center;
    padding: 2rem;
    background: var(--bg-primary);
    color: var(--text-primary);
}

.welcome-icon {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--gradient-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    margin-bottom: 2rem;
    color: white;
    box-shadow: var(--shadow-hover);
    animation: float 3s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-10px); }
}

.welcome-title {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 1rem;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.welcome-subtitle {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 500px;
    line-height: 1.5;
}

.project-frame {
    width: 100%;
    height: 100%;
    border: none;
    background: white;
    display: none;
    flex: 1;
}

.loading-screen {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--bg-primary);
    display: none;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 1rem;
    z-index: 10;
}

.loading-screen.show {
    display: flex;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 0.95rem;
}

/* Floating Controls */
.floating-controls {
    position: fixed;
    bottom: 1.5rem;
    right: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    z-index: 200;
    transition: var(--transition);
}

.floating-controls.hidden {
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
}

.floating-btn {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    box-shadow: var(--shadow-hover);
    transition: var(--transition);
}

.floating-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 15px 35px rgba(59, 130, 246, 0.3);
}

/* Full CSS class to prevent user text selection and highlight on interaction */
.user-select-none {
  user-select: none;
  -webkit-user-select: none;   /* Safari */
  -moz-user-select: none;      /* Firefox */
  -ms-user-select: none;       /* IE10+ */
  
  -webkit-tap-highlight-color: transparent; /* Remove blue highlight on mobile */
  outline: none;               /* Remove focus outline */
}

/* Mobile Styles */
@media (max-width: 992px) {
    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        height: 100%;
        z-index: 300;
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        width: 100%;
        margin-left: 0;
    }

    .floating-controls {
        bottom: 1rem;
        right: 1rem;
    }

    .floating-btn {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
}

/* Mobile Overlay */
.mobile-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 250;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
    backdrop-filter: blur(3px);
}

.mobile-overlay.show {
    opacity: 1;
    visibility: visible;
}

/* Toast */
.toast {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    background: var(--gradient-primary);
    color: white;
    padding: 0.875rem 1.25rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-hover);
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transform: translateX(400px);
    opacity: 0;
    transition: var(--transition);
    z-index: 1000;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
    opacity: 1;
}

.toast-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
}

/* Status Bar */
.status-bar {
    height: 50px;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.875rem;
    color: var(--text-secondary);
    transition: var(--transition);
    z-index: 5;
}

.current-project {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.project-url {
    font-family: 'SF Mono', 'Monaco', 'Cascadia Code', monospace;
    color: var(--primary-blue);
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.status-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.status-btn {
    background: var(--bg-primary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.status-btn:hover {
    color: var(--primary-blue);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

.no-results {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--text-muted);
}

.no-results-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.no-results-text {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.no-results-subtext {
    font-size: 0.875rem;
    opacity: 0.8;
}

/* Collapse Button */
.collapse-btn {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.2rem;
    z-index: 5;
}

.collapse-btn:hover {
    color: var(--primary-blue);
}

/* Frame Controls */
.frame-controls {
    position: absolute;
    top: 1rem;
    right: 1rem;
    display: flex;
    gap: 0.5rem;
    z-index: 5;
}

.frame-btn {
    background: var(--bg-primary);
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: var(--transition);
    font-size: 0.9rem;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow);
}

.frame-btn:hover {
    color: var(--primary-blue);
    background: var(--bg-tertiary);
    transform: translateY(-2px);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .status-bar {
        padding: 0 1rem;
    }

    #status-resizer {
  height: 5px;
  background: #333;
  cursor: row-resize;
  user-select: none;
}
    
    .project-url {
        max-width: 200px;
    }
    
    .welcome-title {
        font-size: 1.75rem;
    }
    
    .welcome-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .status-bar {
        flex-direction: column;
        height: auto;
        padding: 0.75rem;
        gap: 0.5rem;
    }
    #status-resizer {
  height: 5px;
  background: #333;
  cursor: row-resize;
  user-select: none;
}
    
    .current-project {
        width: 100%;
        justify-content: center;
    }
    
    .status-actions {
        width: 100%;
        justify-content: center;
    }
    
    .project-url {
        max-width: 100%;
        text-align: center;
    }
    
    .welcome-title {
        font-size: 1.5rem;
    }
}
