/* Feature Tracking Website - Main Stylesheet */
/* Following design_guide.txt specifications */

/* CSS Variables (Design Tokens) */
:root {
    /* Colors */
    --brand-red: #E44834;
    --text-primary: #242424;
    --text-secondary: #666666;
    --canvas-bg: #FFFFFF;
    --panel-bg: #FAFAFA;
    --border-color: #E6E6E6;
    --focus-ring: #2684FF;
    --hover-bg: #F3F4F5;
    
    /* Typography */
    --font-stack: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --font-size-base: 14px;
    --line-height-base: 24px;
    --font-size-heading: 14px;
    --line-height-heading: 20px;
    
    /* Spacing */
    --grid-gutter: 24px;
    --card-padding: 16px;
    --sidebar-width: 240px;
    --top-nav-height: 64px;
    --button-height: 40px;
    
    /* Border Radius */
    --card-radius: 8px;
    --button-radius: 20px;
    --badge-radius: 10px;
    
    /* Shadows */
    --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    --card-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.12);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.2s ease;
}

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

body {
    font-family: var(--font-stack);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--text-primary);
    background-color: var(--canvas-bg);
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
    line-height: var(--line-height-heading);
    margin-bottom: 16px;
}

h1 {
    font-size: 24px;
    margin-bottom: 8px;
}

h2 {
    font-size: 20px;
}

h3 {
    font-size: 16px;
}

p {
    margin-bottom: 16px;
    color: var(--text-secondary);
}

/* Layout */
.container {
    max-width: 1024px;
    margin: 0 auto;
    padding: 0 32px;
}

.main-layout {
    display: flex;
    min-height: 100vh;
}

/* Top Navigation */
.top-nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--top-nav-height);
    background: var(--canvas-bg);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    z-index: 1000;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-red);
    text-decoration: none;
}

.logo-image {
    height: 28px;
    width: auto;
    max-width: 150px;
    vertical-align: middle;
    margin-right: 8px;
}

.logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-red);
    vertical-align: middle;
}

.primary-links {
    display: flex;
    gap: 24px;
    list-style: none;
}

.primary-links a {
    color: var(--text-primary);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-fast);
}

.primary-links a:hover {
    color: var(--brand-red);
}

.auth-links {
    display: flex;
    align-items: center;
    gap: 16px;
}

.auth-links .link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
}

/* Sidebar */
.sidebar {
    position: fixed;
    left: 0;
    top: var(--top-nav-height);
    width: var(--sidebar-width);
    height: calc(100vh - var(--top-nav-height));
    background: var(--panel-bg);
    border-right: 1px solid var(--border-color);
    overflow-y: auto;
    z-index: 900;
}

.side-nav {
    list-style: none;
    padding: 16px 0;
}

.side-nav .section {
    padding: 8px 16px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 16px;
}

.side-nav .item {
    padding: 8px 16px;
    border-left: 3px solid transparent;
    transition: all var(--transition-fast);
    cursor: pointer;
}

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

.side-nav .item.active {
    border-left-color: var(--brand-red);
    font-weight: 600;
    background: var(--hover-bg);
}

.side-nav .item a {
    color: inherit;
    text-decoration: none;
    display: block;
}

/* Main Content */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    margin-top: var(--top-nav-height);
    padding: 32px;
    background: var(--canvas-bg);
}

/* Cards */
.card {
    background: var(--canvas-bg);
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    padding: var(--card-padding);
    transition: transform var(--transition-fast), box-shadow var(--transition-fast);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow);
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--grid-gutter);
    margin-bottom: 32px;
}

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

.card-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-body {
    color: var(--text-secondary);
    margin-bottom: 16px;
}

.card-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 12px;
    color: var(--text-secondary);
}

.card-meta .meta-item {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* Post Cards */
.post-card {
    margin-bottom: 16px;
}

.post-card .card-header {
    margin-bottom: 8px;
}

.post-type {
    padding: 4px 8px;
    border-radius: var(--badge-radius);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
}

.post-type.feature {
    background: #E3F2FD;
    color: #1976D2;
}

.post-type.bug {
    background: #FFEBEE;
    color: #D32F2F;
}

.post-status {
    padding: 4px 8px;
    border-radius: var(--badge-radius);
    font-size: 11px;
    font-weight: 600;
}

.post-status.in_review {
    background: #FFF3E0;
    color: #F57C00;
}

.post-status.in_progress {
    background: #E8F5E8;
    color: #388E3C;
}

.post-status.completed {
    background: #E8F5E8;
    color: #388E3C;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: var(--button-height);
    padding: 0 24px;
    border: none;
    border-radius: var(--button-radius);
    font-family: var(--font-stack);
    font-size: var(--font-size-base);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-fast);
    min-width: 44px;
    min-height: 44px;
}

.btn:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

.btn-primary {
    background: var(--brand-red);
    color: white;
}

.btn-primary:hover {
    background: #d13d2a;
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--brand-red);
    border: 1px solid var(--brand-red);
}

.btn-ghost:hover {
    background: var(--brand-red);
    color: white;
}

.btn-small {
    height: 32px;
    padding: 0 16px;
    font-size: 12px;
}

/* Forms */
.form-group {
    margin-bottom: 24px;
}

.form-label {
    display: block;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.form-input,
.form-textarea,
.form-select {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    font-family: var(--font-stack);
    font-size: var(--font-size-base);
    background: var(--canvas-bg);
    transition: border-color var(--transition-fast);
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: var(--focus-ring);
    box-shadow: 0 0 0 2px rgba(38, 132, 255, 0.1);
}

.form-textarea {
    min-height: 120px;
    resize: vertical;
}

/* Search & Filters */
.search-filters {
    display: flex;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 200px;
}

.filter-group {
    display: flex;
    gap: 8px;
}

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    height: 20px;
    padding: 0 8px;
    border-radius: var(--badge-radius);
    font-size: 12px;
    font-weight: 600;
    background: var(--panel-bg);
    color: var(--text-secondary);
}

/* Comments */
.comment {
    padding: 16px 0;
    border-bottom: 1px solid var(--border-color);
}

.comment:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.comment-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand-red);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 600;
    font-size: 12px;
}

.comment-author {
    font-weight: 600;
    color: var(--text-primary);
}

.comment-date {
    font-size: 12px;
    color: var(--text-secondary);
}

.comment-body {
    color: var(--text-secondary);
    line-height: 1.5;
}

/* Roadmap */
.roadmap-columns {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--grid-gutter);
}

.roadmap-column {
    background: var(--panel-bg);
    border-radius: var(--card-radius);
    padding: 16px;
}

.roadmap-column h3 {
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border-color);
}

/* Vote Button */
.vote-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--card-radius);
    background: var(--canvas-bg);
    color: var(--text-secondary);
    cursor: pointer;
    transition: all var(--transition-fast);
    font-size: 14px;
    font-weight: 600;
}

.vote-btn:hover {
    border-color: var(--brand-red);
    color: var(--brand-red);
}

.vote-btn.voted {
    background: var(--brand-red);
    border-color: var(--brand-red);
    color: white;
}

.vote-btn.voted:hover {
    background: #d13d2a;
}

/* Responsive Design */
@media (max-width: 1023px) {
    /* Hide primary navigation links on mobile */
    .primary-links {
        display: none;
    }
    
    /* Show hamburger menu */
    .hamburger {
        display: block !important;
    }
    
    /* Adjust logo positioning to avoid hamburger overlap on tablets */
    .logo {
        margin-left: 50px; /* Give space for hamburger menu */
        display: flex;
        align-items: center;
        max-width: calc(100vw - 120px); /* Prevent overflow */
    }
    
    .logo-image {
        height: 26px; /* Medium size for tablets */
        max-width: 120px;
    }
    
    .logo-text {
        font-size: 18px; /* Medium text for tablets */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* Sidebar overlay - let JavaScript handle display */
    .sidebar-overlay {
        opacity: 0;
        transition: opacity var(--transition-normal);
        pointer-events: none;
    }
    
    /* Show overlay when sidebar is open */
    .sidebar.open ~ .sidebar-overlay {
        opacity: 1;
        pointer-events: auto;
    }
    
    .sidebar {
        transform: translateX(-100%);
        transition: transform var(--transition-normal);
    }
    
    .sidebar.open {
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .card-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .roadmap-columns {
        grid-template-columns: 1fr;
        gap: 16px;
    }
}

@media (max-width: 767px) {
    .container {
        padding: 0 16px;
    }
    
    .top-nav {
        padding: 0 16px;
        position: relative;
    }
    
    /* Adjust logo positioning to avoid hamburger overlap */
    .logo {
        margin-left: 50px; /* Give space for hamburger menu */
        display: flex;
        align-items: center;
        max-width: calc(100vw - 120px); /* Prevent overflow */
    }
    
    .logo-image {
        height: 24px; /* Slightly smaller on mobile */
        max-width: 100px;
    }
    
    .logo-text {
        font-size: 16px; /* Smaller text on mobile */
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    .main-content {
        padding: 16px;
    }
    
    .card-grid {
        grid-template-columns: 1fr;
    }
    
    .search-filters {
        flex-direction: column;
    }
    
    .search-box {
        min-width: auto;
    }
    
    .auth-links {
        gap: 8px;
    }
    
    .auth-links .link {
        font-size: 14px;
    }
    
    .btn {
        padding: 0 16px;
    }
    
    /* Improve mobile sidebar */
    .sidebar {
        width: 280px;
    }
    
    /* Better mobile hamburger positioning */
    .hamburger {
        position: fixed !important;
        top: 12px !important;
        left: 12px !important;
        z-index: 1002 !important;
        background: var(--brand-red) !important;
        color: white !important;
        border: none !important;
        padding: 10px !important;
        border-radius: var(--card-radius) !important;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15) !important;
    }
    
    /* Improve sidebar overlay */
    .sidebar-overlay {
        background: rgba(0, 0, 0, 0.6) !important;
        backdrop-filter: blur(2px);
    }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .card:hover {
        transform: none;
    }
    
    .btn:hover {
        transform: none;
    }
}

/* Focus styles for keyboard navigation */
*:focus {
    outline: 2px solid var(--focus-ring);
    outline-offset: 2px;
}

/* Skip link for accessibility */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--brand-red);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--card-radius);
    z-index: 1001;
}

.skip-link:focus {
    top: 6px;
}

/* Loading states */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    border-top-color: var(--brand-red);
    animation: spin 1s ease-in-out infinite;
}

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