/* Marketing R&D System - Main Stylesheet */
/* Version: 1.0.0 */

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

:root {
    /* Be Well Brand Colors - Dark Theme */
    --bg-primary: #1C2630;
    --bg-secondary: #2A3441;
    --bg-tertiary: #374151;
    --text-primary: #f3f4f6;
    --text-secondary: #d1d5db;
    --text-muted: #8892A0;
    --border-color: #4b5563;
    --accent-tan: #A47C5B;
    --accent-green: #3E5B3D;
    --accent-brown: #5B3A29;
    --accent-hover: #D4A574;
    
    /* Status Colors */
    --status-new: #3b82f6;
    --status-review: #f59e0b;
    --status-approved: #10b981;
    --status-testing: #8b5cf6;
    --status-implemented: #6b7280;
    --status-rejected: #ef4444;
    
    /* Role Colors */
    --role-staff: #3b82f6;
    --role-management: #A47C5B;
    --role-admin: #ef4444;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
}

/* Sandbox Mode Styling */
.sandbox-mode {
    background-image: repeating-linear-gradient(
        45deg,
        transparent,
        transparent 10px,
        rgba(245, 158, 11, 0.03) 10px,
        rgba(245, 158, 11, 0.03) 20px
    );
}

.sandbox-banner {
    background: #f59e0b;
    color: #000;
    padding: 0.75rem;
    text-align: center;
    font-weight: 600;
    position: sticky;
    top: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.sandbox-banner button {
    background: rgba(0,0,0,0.2);
    color: #000;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.sandbox-banner button:hover {
    background: rgba(0,0,0,0.3);
}

.sandbox-role-switcher {
    background: rgba(255,255,255,0.1);
    color: var(--text-primary);
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.5rem;
    border-radius: 4px;
    font-size: 0.875rem;
    cursor: pointer;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #1a1a1a 0%, #2d3436 100%);
    color: white;
    padding: 1.5rem 2rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    border-bottom: 2px solid var(--accent-tan);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 1rem;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 300;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.header h1 i {
    color: var(--accent-tan);
}

.header-controls {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Role Badge */
.role-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.875rem;
    text-transform: uppercase;
    font-weight: 500;
}

.role-staff {
    background: var(--role-staff);
}

.role-management {
    background: var(--role-management);
}

.role-admin {
    background: var(--role-admin);
}

/* Buttons */
.btn {
    background: rgba(255,255,255,0.1);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    padding: 0.5rem 1rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s;
    text-decoration: none;
    font-family: inherit;
}

.btn:hover {
    background: rgba(164, 124, 91, 0.3);
    border-color: var(--accent-tan);
    transform: translateY(-1px);
}

.btn:disabled,
.btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-green), #2A4029);
    border-color: transparent;
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #4A6B49, var(--accent-green));
}

.btn-danger {
    background: var(--status-rejected);
    border-color: transparent;
    color: white;
}

/* Container */
.container {
    max-width: 2400px;
    margin: 2rem auto;
    padding: 0 2rem;
}

/* Cards */
.card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
}

.card:hover {
    border-color: var(--accent-tan);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

/* Navigation Grid */
.nav-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

.nav-card {
    background: linear-gradient(135deg, #253341 0%, #1C2630 100%);
    border: 1px solid rgba(164, 124, 91, 0.2);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-primary);
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.nav-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--accent-tan) 0%, var(--accent-hover) 100%);
    transform: translateX(-100%);
    transition: transform 0.3s;
}

.nav-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.4);
    border-color: var(--accent-tan);
}

.nav-card:hover::before {
    transform: translateX(0);
}

.nav-card-icon {
    width: 48px;
    height: 48px;
    background: rgba(164, 124, 91, 0.2);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 1.5rem;
    color: var(--accent-tan);
}

.nav-card h3 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
    font-weight: 400;
}

.nav-card p {
    color: var(--text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
}

/* Forms */
.form-group {
    margin-bottom: 1.5rem;
}

.form-label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-control {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 1rem;
    transition: all 0.2s;
}

.form-control:focus {
    outline: none;
    border-color: var(--accent-tan);
    box-shadow: 0 0 0 3px rgba(164, 124, 91, 0.1);
}

/* Select */
select.form-control {
    cursor: pointer;
}

/* Textarea */
textarea.form-control {
    resize: vertical;
    min-height: 100px;
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 9999;
    padding: 2rem;
    overflow-y: auto;
}

.modal.active,
.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.modal-content {
    background: var(--bg-secondary);
    border-radius: 12px;
    max-width: 1400px;
    width: 98%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

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

.modal-header h2 {
    font-size: 1.5rem;
    font-weight: 400;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
}

.close-modal {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: var(--text-primary);
}

/* Status Badges */
.status-badge {
    display: inline-block;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.status-new { background: var(--status-new); }
.status-review { background: var(--status-review); color: #000; }
.status-approved { background: var(--status-approved); }
.status-testing { background: var(--status-testing); }
.status-implemented { background: var(--status-implemented); }
.status-rejected { background: var(--status-rejected); }

/* Loading State */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 3rem;
}

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

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

/* Empty State */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

/* Watermark for Sandbox */
.sandbox-watermark {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(-45deg);
    font-size: 120px;
    color: rgba(245, 158, 11, 0.05);
    pointer-events: none;
    z-index: -1;
    font-weight: bold;
    white-space: nowrap;
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 0 1rem;
    }
    
    .nav-grid {
        grid-template-columns: 1fr;
    }
    
    .header-content {
        flex-direction: column;
        text-align: center;
    }
    
    .header-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .modal {
        padding: 1rem;
    }
}

/* Print Styles */
@media print {
    .sandbox-banner,
    .header-controls,
    .btn,
    .modal {
        display: none !important;
    }
    
    body {
        background: white;
        color: black;
    }
    
    .sandbox-mode::after {
        content: "SANDBOX TEST DATA";
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%) rotate(-45deg);
        font-size: 120px;
        color: rgba(245, 158, 11, 0.1);
        z-index: -1;
    }
}

/* Warm Leads Specific Styles */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 2rem;
}

.controls-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    align-items: center;
    flex-wrap: wrap;
}

.search-box {
    flex: 1;
    min-width: 250px;
    position: relative;
}

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

.search-box input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.filter-select {
    padding: 0.75rem 1rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
}

.leads-table-container {
    background: var(--bg-secondary);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.leads-table {
    width: 100%;
    border-collapse: collapse;
}

.leads-table th {
    background: var(--bg-tertiary);
    padding: 1rem;
    text-align: left;
    font-weight: 600;
    color: var(--text-secondary);
    border-bottom: 1px solid var(--border-color);
}

.leads-table td {
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-primary);
}

.leads-table tr:hover {
    background: rgba(164, 124, 91, 0.1);
}

.loading-cell, .empty-cell {
    text-align: center;
    padding: 3rem;
    color: var(--text-muted);
}

.empty-cell i {
    font-size: 3rem;
    opacity: 0.3;
    margin-bottom: 1rem;
    display: block;
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    padding: 0.5rem;
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-icon:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-tan);
}

.btn-icon.btn-success {
    color: #10b981;
    border-color: #10b981;
}

.btn-icon.btn-danger {
    color: #ef4444;
    border-color: #ef4444;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 500;
}

.status-default {
    background: var(--bg-tertiary);
    color: var(--text-secondary);
}

.status-success {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

.status-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
}

.status-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
}

/* Form Styles */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group.full-width {
    grid-column: span 2;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    border-radius: 4px;
    color: var(--text-primary);
    font-size: 0.95rem;
}

.required {
    color: #ef4444;
}

/* Modal Specific for Convert */
.convert-info {
    padding: 2rem 0;
    text-align: center;
}

.convert-info p {
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

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

.btn-success {
    background: #10b981;
}

.btn-success:hover {
    background: #059669;
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    background: var(--bg-secondary);
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    z-index: 10000;
}

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

.toast-success {
    border-left: 4px solid #10b981;
}

.toast-error {
    border-left: 4px solid #ef4444;
}

.toast-info {
    border-left: 4px solid #3b82f6;
}

/* Responsive Modal Styles */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        width: 95%;
        margin: 1rem;
    }
    
    .form-grid {
        grid-template-columns: 1fr;
    }
    
    .form-group.full-width {
        grid-column: 1;
    }
}