/* BIC - Business Intelligence & Campaign Manager - Main Stylesheet */
/* GLPI-Inspired Design */

:root {
    --primary-color: #4285f4;
    --primary-dark: #0d47a1;
    --secondary-color: #5c6bc0;
    --success-color: #4caf50;
    --danger-color: #f44336;
    --warning-color: #ff9800;
    --info-color: #2196f3;
    --light-bg: #f5f5f5;
    --dark-text: #333333;
    --light-text: #666666;
    --border-color: #ddd;
    --sidebar-width: 250px;
    --header-height: 60px;
}

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 14px;
    color: var(--dark-text);
    background-color: var(--light-bg);
    line-height: 1.6;
}

/* Login Page Styles */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
}

.login-container {
    width: 100%;
    max-width: 450px;
    padding: 20px;
}

.login-box {
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    padding: 40px;
}

.login-logo {
    text-align: center;
    margin-bottom: 30px;
}

.login-box h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--dark-text);
    font-size: 18px;
    font-weight: 500;
}

.login-footer {
    text-align: center;
    margin-top: 30px;
    font-size: 12px;
    color: var(--light-text);
}

/* Main Layout */
.main-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: #2c3e50;
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    transition: all 0.3s ease;
}

.sidebar-header {
    padding: 20px;
    background: #1a252f;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-logo svg {
    width: 40px;
    height: 40px;
}

.sidebar-logo h3 {
    font-size: 18px;
    font-weight: 600;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 15px 20px;
    color: #ecf0f1;
    text-decoration: none;
    transition: all 0.3s ease;
    gap: 12px;
}

.sidebar-menu a:hover {
    background: rgba(255,255,255,0.1);
    padding-left: 25px;
}

.sidebar-menu a.active {
    background: var(--primary-color);
    border-left: 4px solid white;
}

.sidebar-menu .icon {
    width: 20px;
    text-align: center;
    font-size: 18px;
}

.main-content {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.header {
    background: white;
    height: var(--header-height);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 30px;
    position: sticky;
    top: 0;
    z-index: 999;
}

.header-left h1 {
    font-size: 24px;
    color: var(--dark-text);
    font-weight: 500;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--primary-color);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
}

.content-wrapper {
    padding: 30px;
    flex: 1;
}

/* Cards */
.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    background: #fafafa;
}

.card-header h3 {
    font-size: 18px;
    font-weight: 500;
    color: var(--dark-text);
}

.card-body {
    padding: 20px;
}

.card-footer {
    padding: 15px 20px;
    background: #fafafa;
    border-top: 1px solid var(--border-color);
}

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

.stat-card {
    background: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.stat-info h4 {
    font-size: 14px;
    color: var(--light-text);
    font-weight: 500;
    margin-bottom: 10px;
}

.stat-info p {
    font-size: 32px;
    font-weight: bold;
    color: var(--dark-text);
}

.stat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
}

.stat-icon.primary { background: rgba(66, 133, 244, 0.1); color: var(--primary-color); }
.stat-icon.success { background: rgba(76, 175, 80, 0.1); color: var(--success-color); }
.stat-icon.warning { background: rgba(255, 152, 0, 0.1); color: var(--warning-color); }
.stat-icon.danger { background: rgba(244, 67, 54, 0.1); color: var(--danger-color); }
.stat-icon.info { background: rgba(33, 150, 243, 0.1); color: var(--info-color); }

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

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

.form-control {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(66, 133, 244, 0.1);
}

.form-control:disabled {
    background-color: #f5f5f5;
    cursor: not-allowed;
}

select.form-control {
    cursor: pointer;
}

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

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

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

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover:not(:disabled) {
    background: #388e3c;
}

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

.btn-danger:hover:not(:disabled) {
    background: #d32f2f;
}

.btn-warning {
    background: var(--warning-color);
    color: white;
}

.btn-warning:hover:not(:disabled) {
    background: #f57c00;
}

.btn-secondary {
    background: #757575;
    color: white;
}

.btn-secondary:hover:not(:disabled) {
    background: #616161;
}

.btn-block {
    display: block;
    width: 100%;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 12px;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 16px;
}

/* Alerts */
.alert {
    padding: 15px 20px;
    border-radius: 4px;
    margin-bottom: 20px;
    border-left: 4px solid;
}

.alert-success {
    background: #e8f5e9;
    border-color: var(--success-color);
    color: #2e7d32;
}

.alert-danger {
    background: #ffebee;
    border-color: var(--danger-color);
    color: #c62828;
}

.alert-warning {
    background: #fff3e0;
    border-color: var(--warning-color);
    color: #e65100;
}

.alert-info {
    background: #e3f2fd;
    border-color: var(--info-color);
    color: #1565c0;
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    margin-bottom: 20px;
}

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

table thead {
    background: #fafafa;
    border-bottom: 2px solid var(--border-color);
}

table th {
    padding: 15px;
    text-align: left;
    font-weight: 600;
    color: var(--dark-text);
    font-size: 13px;
    text-transform: uppercase;
}

table td {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
}

table tbody tr:hover {
    background: #f5f5f5;
}

/* Badges */
.badge {
    display: inline-block;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background: var(--success-color);
    color: white;
}

.badge-danger {
    background: var(--danger-color);
    color: white;
}

.badge-warning {
    background: var(--warning-color);
    color: white;
}

.badge-info {
    background: var(--info-color);
    color: white;
}

.badge-secondary {
    background: #757575;
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    overflow-y: auto;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h3 {
    font-size: 18px;
    font-weight: 500;
}

.modal-close {
    font-size: 28px;
    cursor: pointer;
    color: var(--light-text);
}

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

.modal-body {
    padding: 20px;
}

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

/* AI Prompt Section */
.ai-prompt-section {
    background: #f8f9fa;
    border: 2px dashed var(--primary-color);
    border-radius: 8px;
    padding: 20px;
    margin: 20px 0;
}

.ai-prompt-section h4 {
    color: var(--primary-color);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.prompt-box {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    padding: 15px;
    margin: 10px 0;
    position: relative;
}

.copy-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 5px 10px;
    font-size: 12px;
}

/* File Upload */
.file-upload-area {
    border: 2px dashed var(--border-color);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.file-upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(66, 133, 244, 0.05);
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(66, 133, 244, 0.1);
}

/* HTML Editor */
.html-editor {
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
}

.editor-toolbar {
    background: #fafafa;
    border-bottom: 1px solid var(--border-color);
    padding: 10px;
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

.editor-btn {
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    background: white;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.editor-btn:hover {
    background: #f0f0f0;
}

.editor-content {
    min-height: 300px;
    padding: 15px;
    background: white;
}

/* Utility Classes */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }
.text-muted { color: var(--light-text); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-danger { color: var(--danger-color); }
.text-warning { color: var(--warning-color); }

.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

.d-flex { display: flex; }
.justify-between { justify-content: space-between; }
.align-center { align-items: center; }
.gap-1 { gap: 10px; }
.gap-2 { gap: 20px; }

.w-100 { width: 100%; }

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 0;
        transform: translateX(-100%);
    }
    
    .sidebar.mobile-open {
        width: var(--sidebar-width);
        transform: translateX(0);
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
}

/* Loading Spinner */
.spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

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

/* Print Styles */
@media print {
    .sidebar, .header, .btn, .modal { display: none !important; }
    .main-content { margin-left: 0; }
    .card { box-shadow: none; border: 1px solid #ddd; }
}
