/* ============================================================================
   BUG TRACKER STYLES
   Mystical Tarot Platform
   ============================================================================ */

:root {
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --secondary: #8b5cf6;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #3b82f6;
    
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    
    --critical: #dc2626;
    --high: #ea580c;
    --medium: #ca8a04;
    --low: #16a34a;
    
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow: 0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    
    --radius: 8px;
    --radius-lg: 12px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    min-height: 100vh;
    color: var(--gray-800);
    line-height: 1.6;
}

/* ============================================================================
   LAYOUT
   ============================================================================ */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.header {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 20px 0;
    margin-bottom: 30px;
    box-shadow: var(--shadow-md);
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.header h1 {
    font-size: 1.5rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.header h1 .icon {
    font-size: 1.8rem;
}

.header-nav {
    display: flex;
    gap: 15px;
    align-items: center;
}

.header-nav a {
    color: var(--gray-600);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius);
    transition: all 0.2s;
}

.header-nav a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.header-nav a.active {
    background: var(--primary);
    color: white;
}

/* ============================================================================
   CARDS & PANELS
   ============================================================================ */

.card {
    background: white;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

.card-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
}

.card-header h2 {
    font-size: 1.25rem;
    color: var(--gray-800);
    display: flex;
    align-items: center;
    gap: 10px;
}

.card-body {
    padding: 25px;
}

/* ============================================================================
   FORMS
   ============================================================================ */

.form-group {
    margin-bottom: 20px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

label {
    display: block;
    font-weight: 600;
    color: var(--gray-700);
    margin-bottom: 6px;
    font-size: 0.9rem;
}

label .required {
    color: var(--danger);
}

input[type="text"],
input[type="email"],
input[type="url"],
input[type="password"],
select,
textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.2s;
    background: white;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

textarea {
    min-height: 120px;
    resize: vertical;
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%236b7280'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
    padding-right: 45px;
}

.form-hint {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 5px;
}

/* ============================================================================
   BUTTONS
   ============================================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-secondary {
    background: var(--gray-200);
    color: var(--gray-700);
}

.btn-secondary:hover {
    background: var(--gray-300);
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--danger);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-lg {
    padding: 16px 32px;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
}

/* ============================================================================
   BADGES
   ============================================================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Severity badges */
.severity-critical {
    background: #fef2f2;
    color: var(--critical);
    border: 1px solid #fecaca;
}

.severity-high {
    background: #fff7ed;
    color: var(--high);
    border: 1px solid #fed7aa;
}

.severity-medium {
    background: #fefce8;
    color: var(--medium);
    border: 1px solid #fef08a;
}

.severity-low {
    background: #f0fdf4;
    color: var(--low);
    border: 1px solid #bbf7d0;
}

/* Status badges */
.status-new {
    background: #eff6ff;
    color: #2563eb;
    border: 1px solid #bfdbfe;
}

.status-confirmed {
    background: #fef3c7;
    color: #d97706;
    border: 1px solid #fde68a;
}

.status-progress {
    background: #dbeafe;
    color: #1d4ed8;
    border: 1px solid #93c5fd;
}

.status-testing {
    background: #f3e8ff;
    color: #7c3aed;
    border: 1px solid #c4b5fd;
}

.status-resolved {
    background: #d1fae5;
    color: #059669;
    border: 1px solid #6ee7b7;
}

.status-wontfix {
    background: #f3f4f6;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.status-duplicate {
    background: #fce7f3;
    color: #be185d;
    border: 1px solid #f9a8d4;
}

/* ============================================================================
   DASHBOARD STATS
   ============================================================================ */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: var(--radius-lg);
    padding: 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 15px;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: var(--radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.stat-icon.critical { background: #fef2f2; color: var(--critical); }
.stat-icon.high { background: #fff7ed; color: var(--high); }
.stat-icon.medium { background: #fefce8; color: var(--medium); }
.stat-icon.low { background: #f0fdf4; color: var(--low); }
.stat-icon.total { background: #eff6ff; color: var(--info); }
.stat-icon.resolved { background: #d1fae5; color: var(--success); }

.stat-content h3 {
    font-size: 1.75rem;
    color: var(--gray-800);
    line-height: 1;
}

.stat-content p {
    color: var(--gray-500);
    font-size: 0.9rem;
    margin-top: 4px;
}

/* ============================================================================
   BUG TABLE
   ============================================================================ */

.table-container {
    overflow-x: auto;
}

.bug-table {
    width: 100%;
    border-collapse: collapse;
}

.bug-table th,
.bug-table td {
    padding: 15px;
    text-align: left;
    border-bottom: 1px solid var(--gray-200);
}

.bug-table th {
    background: var(--gray-50);
    font-weight: 600;
    color: var(--gray-600);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.bug-table tbody tr {
    transition: background 0.2s;
}

.bug-table tbody tr:hover {
    background: var(--gray-50);
}

.bug-table .bug-id {
    font-weight: 600;
    color: var(--primary);
}

.bug-table .bug-title {
    max-width: 300px;
}

.bug-table .bug-title a {
    color: var(--gray-800);
    text-decoration: none;
    font-weight: 500;
}

.bug-table .bug-title a:hover {
    color: var(--primary);
}

.bug-table .bug-meta {
    font-size: 0.85rem;
    color: var(--gray-500);
    margin-top: 4px;
}

.bug-table .actions {
    display: flex;
    gap: 8px;
}

/* ============================================================================
   BUG DETAIL VIEW
   ============================================================================ */

.bug-detail-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 25px;
}

.bug-detail-header h1 {
    font-size: 1.5rem;
    color: var(--gray-800);
}

.bug-detail-meta {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 10px;
}

.bug-detail-meta span {
    font-size: 0.9rem;
    color: var(--gray-500);
}

.bug-info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.bug-info-item {
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.bug-info-item label {
    font-size: 0.8rem;
    text-transform: uppercase;
    color: var(--gray-500);
    margin-bottom: 5px;
}

.bug-info-item p {
    color: var(--gray-800);
    font-weight: 500;
}

.bug-section {
    margin-bottom: 25px;
}

.bug-section h3 {
    font-size: 1rem;
    color: var(--gray-700);
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--gray-200);
}

.bug-section-content {
    background: var(--gray-50);
    padding: 15px;
    border-radius: var(--radius);
    white-space: pre-wrap;
    font-size: 0.95rem;
    color: var(--gray-700);
}

/* ============================================================================
   FILTERS
   ============================================================================ */

.filters {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--radius);
}

.filters select,
.filters input {
    padding: 8px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius);
    font-size: 0.9rem;
}

/* ============================================================================
   COMMENTS
   ============================================================================ */

.comments-list {
    margin-top: 20px;
}

.comment {
    padding: 15px;
    background: var(--gray-50);
    border-radius: var(--radius);
    margin-bottom: 15px;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

.comment-author {
    font-weight: 600;
    color: var(--gray-800);
}

.comment-date {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.comment-body {
    color: var(--gray-700);
}

/* ============================================================================
   ALERTS & MESSAGES
   ============================================================================ */

.alert {
    padding: 15px 20px;
    border-radius: var(--radius);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert-error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-info {
    background: #eff6ff;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* ============================================================================
   EMPTY STATE
   ============================================================================ */

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--gray-500);
}

.empty-state .icon {
    font-size: 4rem;
    margin-bottom: 20px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--gray-700);
    margin-bottom: 10px;
}

/* ============================================================================
   LOGIN PAGE
   ============================================================================ */

.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.login-card {
    width: 100%;
    max-width: 400px;
}

.login-card .card-header {
    text-align: center;
    padding: 30px;
}

.login-card .card-header h2 {
    justify-content: center;
}

/* ============================================================================
   SUCCESS PAGE
   ============================================================================ */

.success-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.success-card {
    text-align: center;
    max-width: 500px;
}

.success-icon {
    font-size: 5rem;
    margin-bottom: 20px;
}

.success-card h1 {
    color: var(--gray-800);
    margin-bottom: 15px;
}

.success-card p {
    color: var(--gray-600);
    margin-bottom: 25px;
}

.bug-reference {
    background: var(--gray-50);
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 25px;
}

.bug-reference strong {
    font-size: 1.25rem;
    color: var(--primary);
}

/* ============================================================================
   RESPONSIVE
   ============================================================================ */

@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .bug-table th,
    .bug-table td {
        padding: 10px;
        font-size: 0.9rem;
    }
    
    .bug-table .hide-mobile {
        display: none;
    }
}

@media (max-width: 480px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .container {
        padding: 15px;
    }
}

/* ============================================================================
   UTILITIES
   ============================================================================ */

.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-20 { margin-top: 20px; }
.mb-20 { margin-bottom: 20px; }
.flex { display: flex; }
.gap-10 { gap: 10px; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }