/* Custom CSS for Competitive Intelligence Platform */

:root {
    /* Primary Color Palette */
    --color-white: #ffffff;
    --color-primary: #297ec8;
    --color-background: #eeeef2;
    --color-light-gray: #f5f7f9;
    --color-border: #e0e1e8;
    --color-text: #1d1e21;
    
    /* Gradients using your colors */
    --primary-gradient: linear-gradient(135deg, #297ec8 0%, #1e5a96 100%);
    --secondary-gradient: linear-gradient(45deg, #297ec8, #3a8ad1);
    --success-gradient: linear-gradient(45deg, #297ec8, #1e5a96);
    --danger-gradient: linear-gradient(45deg, #dc3545, #b02a37);
    --warning-gradient: linear-gradient(45deg, #ffc107, #e0a800);
    --info-gradient: linear-gradient(45deg, #297ec8, #0d6efd);
    
    /* UI Elements */
    --glass-bg: rgba(255, 255, 255, 0.95);
    --glass-border: rgba(224, 225, 232, 0.3);
    --shadow-light: 0 4px 20px rgba(41, 126, 200, 0.15);
    --shadow-hover: 0 8px 30px rgba(41, 126, 200, 0.25);
    
    --border-radius: 12px;
    --border-radius-sm: 8px;
    --transition: all 0.3s ease;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--color-background);
    min-height: 100vh;
    color: var(--color-text);
    line-height: 1.6;
}

.container-fluid {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
.header {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 25px 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow-light);
    border: 1px solid var(--color-border);
}

.header h1 {
    font-size: 2.2rem;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 5px;
}

.header p {
    font-size: 1.1rem;
    color: var(--color-primary);
    opacity: 0.8;
}

/* Navigation Tabs */
.nav-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    overflow-x: auto;
    padding-bottom: 5px;
}

.tab-btn {
    padding: 12px 20px;
    background: var(--secondary-gradient);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
    display: flex;
    align-items: center;
    text-decoration: none;
    white-space: nowrap;
    flex-shrink: 0;
}

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

.tab-btn.active {
    background: linear-gradient(45deg, #4f46e5, #7c3aed);
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.4);
}

.tab-btn i {
    margin-right: 8px;
}

/* Tab Content */
.tab-content {
    display: none;
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 30px;
    box-shadow: var(--shadow-light);
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.5s ease-in;
}

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

/* Dashboard Statistics */
.stats-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--color-white);
    padding: 25px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--color-border);
}

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

.stat-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-primary);
    margin-bottom: 5px;
}

.stat-label {
    font-size: 0.95rem;
    color: var(--color-text);
    font-weight: 500;
    opacity: 0.7;
}

/* Dashboard Grid */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

.dashboard-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 25px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--color-border);
}

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

.card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--color-text);
    border-bottom: 2px solid var(--color-border);
    padding-bottom: 12px;
}

/* Competitors */
.competitor-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.competitor-card {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--shadow-light);
    transition: var(--transition);
    border: 1px solid var(--color-border);
    position: relative;
}

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

.competitor-name {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 12px;
    color: var(--color-text);
}

.competitor-products {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 12px;
}

.product-tag {
    background: var(--secondary-gradient);
    color: white;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.competitor-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 5px;
}

.competitor-actions button {
    padding: 5px 8px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: var(--transition);
}

.btn-edit {
    background: var(--info-gradient);
    color: white;
}

.btn-delete {
    background: var(--danger-gradient);
    color: white;
}

/* Threat Levels */
.threat-level {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    display: inline-block;
}

.threat-high {
    background: #fee2e2;
    color: #dc2626;
}

.threat-medium {
    background: #fef3c7;
    color: #d97706;
}

.threat-low {
    background: #dcfce7;
    color: #16a34a;
}

/* Intelligence Items */
.intel-item {
    background: var(--color-white);
    border-radius: var(--border-radius);
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: var(--shadow-light);
    border-left: 4px solid var(--color-primary);
    transition: var(--transition);
    position: relative;
}

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

.intel-item.impact-critical {
    border-left-color: #dc2626;
    background: linear-gradient(to right, #fef2f2, white);
}

.intel-item.impact-high {
    border-left-color: #d97706;
    background: linear-gradient(to right, #fffbeb, white);
}

.intel-item.impact-medium {
    border-left-color: #059669;
    background: linear-gradient(to right, #f0fdf4, white);
}

.intel-item.impact-low {
    border-left-color: #6b7280;
    background: linear-gradient(to right, #f9fafb, white);
}

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

.intel-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--color-text);
    margin: 0;
    flex: 1;
}

.intel-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.intel-badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    font-weight: 500;
    text-transform: uppercase;
}

.intel-badge.type {
    background: #e5e7eb;
    color: #374151;
}

.intel-badge.impact-critical {
    background: #fecaca;
    color: #dc2626;
}

.intel-badge.impact-high {
    background: #fed7aa;
    color: #d97706;
}

.intel-badge.impact-medium {
    background: #bbf7d0;
    color: #059669;
}

.intel-badge.impact-low {
    background: #e5e7eb;
    color: #6b7280;
}

.intel-badge.confidence-high {
    background: #dcfce7;
    color: #16a34a;
}

.intel-badge.confidence-medium {
    background: #fef3c7;
    color: #d97706;
}

.intel-badge.confidence-low {
    background: #fee2e2;
    color: #dc2626;
}

.intel-meta {
    display: flex;
    gap: 15px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #6b7280;
}

.intel-details {
    background: var(--color-light-gray);
    padding: 15px;
    border-radius: var(--border-radius-sm);
    margin: 15px 0;
    border: 1px solid var(--color-border);
    font-style: italic;
    line-height: 1.6;
}

.intel-actions {
    background: rgba(41, 126, 200, 0.05);
    padding: 12px;
    border-radius: var(--border-radius-sm);
    margin-top: 10px;
    border: 1px solid rgba(41, 126, 200, 0.2);
    font-size: 0.9rem;
}

.intel-item-actions {
    position: absolute;
    top: 15px;
    right: 15px;
    display: flex;
    gap: 5px;
}

/* Matrix Table */
.matrix-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    background: var(--color-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-light);
}

.matrix-table th,
.matrix-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.matrix-table th {
    background: var(--color-primary);
    color: var(--color-white);
    font-weight: 600;
}

.matrix-table tr:hover {
    background-color: var(--color-light-gray);
}

.competitive-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.dot-high { background-color: #dc2626; }
.dot-medium { background-color: #d97706; }
.dot-low { background-color: #16a34a; }
.dot-none { background-color: #9ca3af; }

/* Filters */
.filters {
    display: flex;
    gap: 15px;
    margin-bottom: 25px;
    flex-wrap: wrap;
    padding: 20px;
    background: var(--color-light-gray);
    border-radius: var(--border-radius);
    border: 1px solid var(--color-border);
}

.filter-group {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.filter-group label {
    font-weight: 600;
    margin-bottom: 5px;
    color: var(--color-text);
    font-size: 0.9rem;
}

.filter-group select,
.filter-group input {
    padding: 8px 12px;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    background: var(--color-white);
    font-size: 0.9rem;
    transition: var(--transition);
}

.filter-group select:focus,
.filter-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(41, 126, 200, 0.15);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: var(--secondary-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

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

.btn-secondary {
    background: var(--color-border);
    color: var(--color-text);
}

.btn-success {
    background: var(--success-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.4);
}

.btn-danger {
    background: var(--danger-gradient);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(239, 68, 68, 0.4);
}

.export-btn {
    background: linear-gradient(45deg, #8b5cf6, #7c3aed);
    color: white;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.3);
}

.export-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.4);
}

/* Form Styles */
.form-group {
    margin-bottom: 1rem;
}

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

.form-control,
.form-select {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    font-size: 0.9rem;
    transition: var(--transition);
    background: var(--color-white);
}

.form-control:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(41, 126, 200, 0.15);
}

/* Modal Enhancements */
.modal-content {
    border-radius: var(--border-radius);
    border: none;
    box-shadow: var(--shadow-light);
    background: var(--color-white);
}

.modal-header {
    border-bottom: 1px solid var(--color-border);
    padding: 20px 25px;
    background: var(--color-light-gray);
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    border-top: 1px solid var(--color-border);
    padding: 20px 25px;
    background: var(--color-light-gray);
}

/* Responsive Design */
@media (max-width: 768px) {
    .container-fluid {
        padding: 15px;
    }
    
    .header {
        padding: 20px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .nav-tabs {
        justify-content: center;
    }
    
    .tab-btn {
        padding: 10px 16px;
        font-size: 0.85rem;
    }
    
    .dashboard-grid {
        grid-template-columns: 1fr;
    }
    
    .stats-row {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .competitor-grid {
        grid-template-columns: 1fr;
    }
    
    .filters {
        flex-direction: column;
        gap: 10px;
    }
    
    .filter-group {
        min-width: auto;
    }
    
    .modal-dialog {
        margin: 10px;
    }
}

@media (max-width: 480px) {
    .stats-row {
        grid-template-columns: 1fr;
    }
    
    .intel-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .intel-badges {
        justify-content: flex-start;
    }
    
    .competitor-actions,
    .intel-item-actions {
        position: static;
        margin-top: 10px;
        justify-content: flex-start;
    }
}

/* Loading States */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
    color: #6b7280;
}

.spinner {
    border: 3px solid #f3f4f6;
    border-top: 3px solid #6366f1;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin-right: 10px;
}

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

/* Alert Styles */
.alert {
    padding: 15px;
    border-radius: var(--border-radius-sm);
    margin-bottom: 20px;
    border: 1px solid transparent;
}

.alert-success {
    background: #dcfce7;
    color: #16a34a;
    border-color: #bbf7d0;
}

.alert-danger {
    background: #fee2e2;
    color: #dc2626;
    border-color: #fecaca;
}

.alert-warning {
    background: #fef3c7;
    color: #d97706;
    border-color: #fed7aa;
}

.alert-info {
    background: #dbeafe;
    color: #1d4ed8;
    border-color: #bfdbfe;
}

/* Empty States */
.empty-state {
    text-align: center;
    padding: 40px;
    color: var(--color-text);
    opacity: 0.7;
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--color-primary);
    opacity: 0.6;
}

.empty-state h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    color: var(--color-text);
}

.empty-state p {
    margin-bottom: 20px;
}

/* Battlecard Specific Styles */
.battlecard-preview {
    min-height: 400px;
    max-height: 500px;
    overflow-y: auto;
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-sm);
    padding: 15px;
    background: var(--color-white);
}

.preview-placeholder {
    text-align: center;
    padding: 60px 20px;
    color: var(--color-text);
    opacity: 0.6;
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 15px;
    color: var(--color-primary);
    opacity: 0.5;
}

.battlecard-content {
    line-height: 1.6;
}

.battlecard-content h4 {
    color: var(--color-primary);
    margin-bottom: 15px;
    font-weight: 600;
}

.battlecard-content h5 {
    color: var(--color-text);
    margin: 20px 0 10px 0;
    font-size: 1rem;
    font-weight: 600;
}

.battlecard-content .section {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--color-border);
}

.battlecard-content .section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.battlecard-content ul {
    margin: 10px 0;
    padding-left: 20px;
}

.battlecard-content li {
    margin-bottom: 5px;
}

.threat-level {
    margin-bottom: 20px;
}

.threat-level .badge {
    font-size: 0.85rem;
    padding: 6px 12px;
    border-radius: 15px;
    font-weight: 600;
}

.threat-high {
    background: #dc3545;
    color: white;
}

.threat-medium {
    background: #fd7e14;
    color: white;
}

.threat-low {
    background: #198754;
    color: white;
}

.checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
}

.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-check-input {
    margin: 0;
}

.form-check-label {
    font-size: 0.9rem;
    color: var(--color-text);
    cursor: pointer;
}

/* Responsive adjustments for battlecard */
@media (max-width: 768px) {
    .battlecard-preview {
        min-height: 300px;
    }
    
    .checkbox-group {
        gap: 6px;
    }
}


/* Additional utility classes */
.ms-2 {
    margin-left: 0.5rem;
}
