/**
 * OKRify Email Campaign Tracker - Main Stylesheet
 * Modern, responsive design with professional color scheme
 */

/* ==================== RESET & BASE ==================== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #00A4EF;
    --secondary-color: #70AD47;
    --success-color: #28A745;
    --warning-color: #FFA500;
    --danger-color: #FF6B6B;
    --info-color: #17A2B8;
    --dark-color: #2C3E50;
    --light-color: #ECF0F1;
    --gray-color: #95A5A6;
    --white: #FFFFFF;
    
    --sidebar-width: 250px;
    --header-height: 70px;
    
    --font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --border-radius: 8px;
    --box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: var(--font-family);
    font-size: 14px;
    line-height: 1.6;
    color: var(--dark-color);
    background-color: #F5F7FA;
}

/* ==================== LAYOUT ==================== */
.wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #2C3E50 0%, #34495E 100%);
    color: var(--white);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 1000;
    display: flex;
    flex-direction: column;
}

.sidebar-header {
    padding: 20px;
    text-align: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 5px;
}

.sidebar-header p {
    font-size: 12px;
    opacity: 0.8;
}

.sidebar-nav {
    flex: 1;
    padding: 20px 0;
}

.nav-item {
    display: flex;
    align-items: center;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.nav-item.active {
    background-color: rgba(0, 164, 239, 0.2);
    border-left-color: var(--primary-color);
    color: var(--white);
}

.nav-icon {
    font-size: 20px;
    margin-right: 12px;
    width: 24px;
}

.nav-label {
    font-size: 14px;
    font-weight: 500;
}

.nav-divider {
    height: 1px;
    background-color: rgba(255, 255, 255, 0.1);
    margin: 15px 20px;
}

.sidebar-footer {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

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

.top-header {
    height: var(--header-height);
    background-color: var(--white);
    border-bottom: 1px solid #E0E0E0;
    padding: 0 30px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
}

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

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.user-info strong {
    font-size: 14px;
    color: var(--dark-color);
}

.user-info small {
    font-size: 11px;
    color: var(--gray-color);
    text-transform: capitalize;
}

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

/* ==================== PAGE HEADER ==================== */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.page-header h1 {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
}

.page-actions {
    display: flex;
    gap: 10px;
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 30px 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

/* ==================== CARDS ==================== */
.card {
    background-color: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    margin-bottom: 20px;
}

.card-header {
    padding: 20px;
    border-bottom: 1px solid #E0E0E0;
}

.card-header h2 {
    font-size: 18px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.card-body {
    padding: 20px;
}

/* ==================== METRICS CARDS ==================== */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background: var(--white);
    border-radius: var(--border-radius);
    padding: 20px;
    box-shadow: var(--box-shadow);
    display: flex;
    align-items: center;
    gap: 15px;
    transition: var(--transition);
}

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

.metric-icon {
    width: 50px;
    height: 50px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.metric-content {
    flex: 1;
}

.metric-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--dark-color);
    line-height: 1;
    margin-bottom: 5px;
}

.metric-label {
    font-size: 13px;
    color: var(--gray-color);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.metric-trend {
    font-size: 12px;
    color: var(--gray-color);
    margin-top: 5px;
}

/* ==================== BUTTONS ==================== */
.btn {
    display: inline-block;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: var(--transition);
}

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

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

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

.btn-secondary:hover {
    background-color: #7F8C8D;
}

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

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

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

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

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

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

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

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 10px 15px;
    font-size: 14px;
    border: 1px solid #DDD;
    border-radius: 6px;
    transition: var(--transition);
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 164, 239, 0.1);
}

.filter-form {
    background-color: transparent;
}

.filter-row {
    display: flex;
    gap: 15px;
    align-items: flex-end;
    flex-wrap: wrap;
}

.filter-row .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 0;
}

/* ==================== TABLES ==================== */
.table-responsive {
    overflow-x: auto;
}

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

.table thead {
    background-color: #F8F9FA;
}

.table th {
    padding: 12px 15px;
    text-align: left;
    font-size: 12px;
    font-weight: 700;
    color: var(--dark-color);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #E0E0E0;
}

.table td {
    padding: 12px 15px;
    border-bottom: 1px solid #F0F0F0;
    font-size: 13px;
}

.table tbody tr {
    transition: var(--transition);
}

.table tbody tr:hover {
    background-color: #F8F9FA;
}

.table-sm th,
.table-sm td {
    padding: 8px 12px;
    font-size: 12px;
}

/* ==================== BADGES ==================== */
.badge {
    display: inline-block;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-radius: 12px;
    line-height: 1;
}

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

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

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

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

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

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

.badge-sm {
    padding: 2px 6px;
    font-size: 10px;
}

/* ==================== ALERTS ==================== */
.alert {
    padding: 15px 20px;
    border-radius: var(--border-radius);
    margin-bottom: 20px;
    font-size: 14px;
}

.alert-success {
    background-color: #D4EDDA;
    color: #155724;
    border-left: 4px solid var(--success-color);
}

.alert-error,
.alert-danger {
    background-color: #F8D7DA;
    color: #721C24;
    border-left: 4px solid var(--danger-color);
}

.alert-warning {
    background-color: #FFF3CD;
    color: #856404;
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: #D1ECF1;
    color: #0C5460;
    border-left: 4px solid var(--info-color);
}

/* ==================== GRID SYSTEM ==================== */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col-1 { flex: 0 0 8.333%; max-width: 8.333%; }
.col-2 { flex: 0 0 16.666%; max-width: 16.666%; }
.col-3 { flex: 0 0 25%; max-width: 25%; }
.col-4 { flex: 0 0 33.333%; max-width: 33.333%; }
.col-5 { flex: 0 0 41.666%; max-width: 41.666%; }
.col-6 { flex: 0 0 50%; max-width: 50%; }
.col-7 { flex: 0 0 58.333%; max-width: 58.333%; }
.col-8 { flex: 0 0 66.666%; max-width: 66.666%; }
.col-9 { flex: 0 0 75%; max-width: 75%; }
.col-10 { flex: 0 0 83.333%; max-width: 83.333%; }
.col-11 { flex: 0 0 91.666%; max-width: 91.666%; }
.col-12 { flex: 0 0 100%; max-width: 100%; }

[class*="col-"] {
    padding: 0 10px;
}

/* ==================== UTILITIES ==================== */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.text-muted { color: var(--gray-color); }
.text-primary { color: var(--primary-color); }
.text-success { color: var(--success-color); }
.text-warning { color: var(--warning-color); }
.text-danger { color: var(--danger-color); }

.text-sm { font-size: 12px; }
.text-xs { font-size: 11px; }
.text-lg { font-size: 16px; }

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

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

/* ==================== ACTIVITY LIST ==================== */
.activity-list {
    max-height: 400px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #F0F0F0;
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    flex-shrink: 0;
}

.activity-details {
    flex: 1;
}

.activity-details strong {
    font-size: 14px;
    color: var(--dark-color);
}

/* ==================== TIMELINE ==================== */
.timeline {
    position: relative;
    padding-left: 50px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #E0E0E0;
}

.timeline-item {
    position: relative;
    margin-bottom: 30px;
}

.timeline-marker {
    position: absolute;
    left: -40px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #F0F0F0;
    border: 3px solid var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: var(--gray-color);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.timeline-marker.active {
    background-color: var(--primary-color);
    color: var(--white);
}

.timeline-content {
    background-color: #F8F9FA;
    border-radius: var(--border-radius);
    padding: 15px;
}

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

.timeline-header h4 {
    font-size: 14px;
    font-weight: 600;
    color: var(--dark-color);
    margin: 0;
}

.timeline-date {
    font-size: 11px;
    color: var(--gray-color);
}

.timeline-body {
    font-size: 13px;
}

.engagement-stats {
    display: flex;
    gap: 20px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.stat-item {
    font-size: 12px;
    color: var(--gray-color);
}

.stat-icon {
    font-size: 16px;
    margin-right: 5px;
    opacity: 0.5;
}

.stat-icon.active {
    opacity: 1;
}

/* ==================== CONTACT DETAILS ==================== */
.contact-avatar {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
}

.avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.info-row {
    padding: 12px 0;
    border-bottom: 1px solid #F0F0F0;
    font-size: 13px;
}

.info-row:last-child {
    border-bottom: none;
}

.info-row strong {
    display: block;
    color: var(--gray-color);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 5px;
}

/* ==================== LOGIN PAGE ==================== */
.login-page {
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

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

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

.login-header h1 {
    font-size: 32px;
    font-weight: 700;
    color: var(--primary-color);
    margin-bottom: 5px;
}

.login-header p {
    font-size: 14px;
    color: var(--gray-color);
}

.login-form .form-group {
    margin-bottom: 20px;
}

.login-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #E0E0E0;
}

/* ==================== STATUS SELECT ==================== */
.status-select {
    padding: 4px 8px;
    font-size: 12px;
    border: 1px solid #DDD;
    border-radius: 4px;
    background-color: var(--white);
    cursor: pointer;
}

/* ==================== RESPONSE ITEMS ==================== */
.response-item {
    background-color: #F8F9FA;
    border-radius: var(--border-radius);
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid var(--primary-color);
}

.response-header {
    display: flex;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.response-date {
    font-size: 12px;
    color: var(--gray-color);
}

.response-text {
    background-color: var(--white);
    padding: 15px;
    border-radius: 6px;
    font-size: 13px;
    line-height: 1.6;
    margin: 10px 0;
}

.meeting-info {
    padding: 10px;
    background-color: #E3F2FD;
    border-radius: 6px;
    font-size: 12px;
    margin-top: 10px;
}

/* ==================== STAT ROWS ==================== */
.stat-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #F0F0F0;
    font-size: 14px;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-label {
    color: var(--gray-color);
}

.stat-value {
    font-weight: 700;
    color: var(--dark-color);
}

/* ==================== RESPONSIVE ==================== */
@media (max-width: 768px) {
    .sidebar {
        width: 200px;
    }
    
    .main-content {
        margin-left: 200px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .row {
        flex-direction: column;
    }
    
    [class*="col-"] {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .page-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .filter-row {
        flex-direction: column;
    }
    
    .filter-row .form-group {
        width: 100%;
    }
}

@media (max-width: 576px) {
    .sidebar {
        width: 60px;
    }
    
    .main-content {
        margin-left: 60px;
    }
    
    .nav-label {
        display: none;
    }
    
    .sidebar-header p,
    .sidebar-footer {
        display: none;
    }
}

/* ==================== PRINT STYLES ==================== */
@media print {
    .sidebar,
    .top-header,
    .page-actions,
    .btn {
        display: none !important;
    }
    
    .main-content {
        margin-left: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #DDD;
        page-break-inside: avoid;
    }
}
