/* ==========================================================================
   Etch.AI Global Stylesheet
   Shared styles for all pages in the application
   ========================================================================== */

/* ==========================================================================
   CSS Custom Properties (Design Tokens)
   ========================================================================== */
:root {
    /* Backgrounds */
    --bg-primary: #0a0a0f;
    --bg-secondary: #12121a;
    --bg-card: #1a1a25;
    --bg-card-hover: #222230;
    --border-color: #2a2a3a;

    /* Text */
    --text-primary: #ffffff;
    --text-secondary: #8888a0;
    --text-muted: #5a5a70;

    /* Accents */
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-tertiary: #06b6d4;
    --accent-success: #10b981;
    --accent-warning: #f59e0b;
    --accent-danger: #ef4444;

    /* Gradients */
    --gradient-primary: linear-gradient(135deg, #6366f1, #8b5cf6);
    --gradient-secondary: linear-gradient(135deg, #06b6d4, #10b981);
    --gradient-danger: linear-gradient(135deg, #f59e0b, #ef4444);
    --gradient-pink: linear-gradient(135deg, #ec4899, #8b5cf6);
    --gradient-card: linear-gradient(145deg, #1a1a25, #12121a);

    /* Sidebar */
    --sidebar-bg: rgba(18, 18, 26, 0.8);

    /* Shadows */
    --shadow-glow: 0 0 40px rgba(99, 102, 241, 0.15);
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Light Mode Overrides */
:root[data-theme="light"] {
    /* Backgrounds */
    --bg-primary: #f8f9fa;
    --bg-secondary: #f0f1f5;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f5f7;
    --border-color: #e0e0e6;

    /* Text */
    --text-primary: #1a1a1a;
    --text-secondary: #6b6b80;
    --text-muted: #8a8a9e;

    /* Gradients */
    --gradient-card: linear-gradient(145deg, #ffffff, #f9f9fb);

    /* Sidebar */
    --sidebar-bg: rgba(255, 255, 255, 0.85);

    /* Shadows */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.08);
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    font-size: 14px;
    line-height: 1.5;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ==========================================================================
   Animated Background
   ========================================================================== */
.bg-animation,
.bg-orbs {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.bg-orb-1 {
    width: 600px;
    height: 600px;
    background: var(--accent-primary);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.bg-orb-2 {
    width: 400px;
    height: 400px;
    background: var(--accent-tertiary);
    bottom: -100px;
    left: -100px;
    animation-delay: -7s;
}

.bg-orb-3 {
    width: 300px;
    height: 300px;
    background: var(--accent-secondary);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

/* ==========================================================================
   Layout
   ========================================================================== */
.app-container {
    display: flex;
    min-height: 100vh;
    position: relative;
    z-index: 1;
}

/* ==========================================================================
   Sidebar
   ========================================================================== */
.sidebar {
    width: 280px;
    background: var(--sidebar-bg);
    backdrop-filter: blur(20px);
    border-right: 1px solid var(--border-color);
    padding: 24px 16px;
    display: flex;
    flex-direction: column;
    position: fixed;
    height: 100vh;
    z-index: 100;
    overflow: hidden;
}

.sidebar-nav-scroll {
    flex: 1;
    overflow-y: auto;
    min-height: 0;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    margin-bottom: 32px;
    text-decoration: none;
}

.logo-icon {
    width: 40px;
    height: 40px;
    background: var(--gradient-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-glow);
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-muted);
    padding: 8px 12px;
    margin-bottom: 4px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    position: relative;
    overflow: hidden;
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
}

.nav-item::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.nav-item:hover {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--bg-card);
    color: var(--text-primary);
}

.nav-item.active::before {
    opacity: 1;
}

.nav-item i {
    width: 20px;
    height: 20px;
}

.nav-item-badge {
    margin-left: auto;
    background: var(--gradient-primary);
    color: white;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
}

.sidebar-footer {
    flex-shrink: 0;
    padding: 16px 0 0 0;
    border-top: 1px solid var(--border-color);
}

.sidebar-footer-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.footer-action-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.footer-action-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.user-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    background: var(--bg-card);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.user-card:hover {
    background: var(--bg-card-hover);
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--gradient-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: white;
}

.user-info {
    flex: 1;
}

.user-name {
    font-weight: 500;
    font-size: 14px;
}

.user-role {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   Main Content
   ========================================================================== */
.main-content {
    flex: 1;
    margin-left: 280px;
    padding: 24px 32px;
}

/* Content Area - wrapper for pages with top-nav + main-content */
.content-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 280px;
    min-height: 100vh;
}

.content-area .main-content {
    margin-left: 0;  /* Remove margin when inside content-area */
}

/* Top Navigation Bar */
.top-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 32px;
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
}

.top-nav .logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.top-nav .nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
}

.top-nav .nav-link {
    padding: 8px 16px;
    border-radius: 8px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.top-nav .nav-link:hover {
    color: var(--text-primary);
    background: var(--bg-card);
}

.top-nav .nav-link.active {
    color: var(--text-primary);
    background: var(--bg-card);
}

/* Breadcrumb Navigation */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-muted);
    padding: 12px 32px;
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
}

.breadcrumb a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color 0.2s ease;
}

.breadcrumb a:hover {
    color: var(--accent-primary);
}

.breadcrumb .separator {
    color: var(--text-muted);
}

.breadcrumb .current {
    color: var(--text-primary);
    font-weight: 500;
}

/* ==========================================================================
   Header
   ========================================================================== */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.header-title h1 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 4px;
}

.header-title p {
    color: var(--text-secondary);
    font-size: 14px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ==========================================================================
   Search Bar
   ========================================================================== */
.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 10px 16px;
    width: 280px;
    transition: all 0.2s ease;
}

.search-bar:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-bar input {
    background: none;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-size: 14px;
    width: 100%;
}

.search-bar input::placeholder {
    color: var(--text-muted);
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn-primary {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--gradient-primary);
    border: none;
    border-radius: 12px;
    padding: 12px 20px;
    color: white;
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    text-decoration: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 12px 20px;
    color: var(--text-primary);
    font-weight: 500;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--bg-card-hover);
    border-color: var(--accent-primary);
}

.btn-ghost {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 8px 12px;
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-ghost:hover {
    background: var(--bg-card);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--text-secondary);
    position: relative;
}

.icon-btn:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
    border-color: var(--accent-primary);
}

.icon-btn .notification-dot {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 8px;
    height: 8px;
    background: var(--accent-danger);
    border-radius: 50%;
    animation: pulse 2s infinite;
}

/* ==========================================================================
   Cards
   ========================================================================== */
.card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* ==========================================================================
   Stat Cards
   ========================================================================== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 24px;
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-card);
    border-color: rgba(99, 102, 241, 0.3);
}

.stat-card:hover::before {
    opacity: 1;
}

.stat-card:nth-child(2)::before { background: var(--gradient-secondary); }
.stat-card:nth-child(3)::before { background: var(--gradient-danger); }
.stat-card:nth-child(4)::before { background: var(--gradient-pink); }

.stat-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 16px;
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.stat-card:nth-child(2) .stat-icon {
    background: rgba(6, 182, 212, 0.1);
    color: var(--accent-tertiary);
}

.stat-card:nth-child(3) .stat-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

.stat-card:nth-child(4) .stat-icon {
    background: rgba(236, 72, 153, 0.1);
    color: #ec4899;
}

.stat-trend {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 500;
    padding: 4px 8px;
    border-radius: 6px;
}

.stat-trend.up {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.stat-trend.down {
    background: rgba(239, 68, 68, 0.1);
    color: var(--accent-danger);
}

.stat-value {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 4px;
}

.stat-label {
    color: var(--text-secondary);
    font-size: 14px;
}

/* ==========================================================================
   Section Styles
   ========================================================================== */
.section {
    margin-bottom: 32px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
}

.section-actions {
    display: flex;
    gap: 8px;
}

/* ==========================================================================
   Landscape Cards
   ========================================================================== */
.landscapes-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.landscape-card {
    background: var(--gradient-card);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    color: inherit;
}

.landscape-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.landscape-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-glow);
    border-color: var(--accent-primary);
}

.landscape-card:hover::after {
    opacity: 0.05;
}

.landscape-card > * {
    position: relative;
    z-index: 1;
}

.landscape-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 12px;
}

.landscape-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 8px;
    border-radius: 6px;
    background: rgba(99, 102, 241, 0.1);
    color: var(--accent-primary);
}

.landscape-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: var(--accent-success);
}

.landscape-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: var(--accent-warning);
}

.landscape-menu {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    transition: all 0.2s ease;
}

.landscape-menu:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.landscape-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 8px;
}

.landscape-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 16px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.landscape-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px solid var(--border-color);
}

.landscape-meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   Content Grid
   ========================================================================== */
.content-grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 24px;
}

/* ==========================================================================
   Activity List
   ========================================================================== */
.activity-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.activity-item {
    display: flex;
    gap: 12px;
}

.activity-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    margin-top: 6px;
    flex-shrink: 0;
}

.activity-dot.blue { background: var(--accent-primary); }
.activity-dot.green { background: var(--accent-success); }
.activity-dot.orange { background: var(--accent-warning); }
.activity-dot.red { background: var(--accent-danger); }

.activity-content {
    flex: 1;
}

.activity-text {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 4px;
}

.activity-text strong {
    color: var(--text-primary);
}

.activity-time {
    font-size: 12px;
    color: var(--text-muted);
}

/* ==========================================================================
   Animations
   ========================================================================== */
@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(30px, -30px) scale(1.05); }
    66% { transform: translate(-20px, 20px) scale(0.95); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.2); opacity: 0.7; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes modalSlideIn {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

.animate-in {
    animation: fadeInUp 0.5s ease forwards;
}

.delay-1 { animation-delay: 0.1s; opacity: 0; }
.delay-2 { animation-delay: 0.2s; opacity: 0; }
.delay-3 { animation-delay: 0.3s; opacity: 0; }
.delay-4 { animation-delay: 0.4s; opacity: 0; }
.delay-5 { animation-delay: 0.5s; opacity: 0; }

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */
@media (max-width: 1400px) {
    .stats-grid,
    .landscapes-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1200px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .sidebar {
        display: none;
    }
    .main-content {
        margin-left: 0;
    }
    .content-area {
        margin-left: 0;
    }
}

@media (max-width: 768px) {
    .main-content {
        padding: 16px;
    }
    .stats-grid,
    .landscapes-grid {
        grid-template-columns: 1fr;
    }
    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .header-actions {
        width: 100%;
        flex-wrap: wrap;
    }
    .search-bar {
        width: 100%;
    }
}
