/**
 * CUEVOO LMS - Main Stylesheet
 * Bootstrap 5 + iOS-Inspired Design
 * Version: 2.0.0
 */

@import url('https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css');
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Manrope:wght@400;500;600;700&display=swap');

/* ============================================
   CSS VARIABLES - iOS DESIGN TOKENS
   ============================================ */

:root {
    /* Colors */
    --primary: #1f84ef;
    --primary-light: #2d8ff5;
    --primary-dark: #1a6fd9;
    --secondary: #1fbec4;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #0ea5e9;
    --light: #f9f6f5;
    --dark: #181a1e;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.15);

    /* Border Radius */
    --radius-sm: 0.5rem;
    --radius-md: 0.875rem;
    --radius-lg: 1.25rem;
    --radius-xl: 1.5rem;
    --radius-2xl: 2rem;

    /* Transitions */
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   GLOBAL STYLES
   ============================================ */

* {
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, var(--light) 0%, #f4f4f4 100%);
    min-height: 100vh;
    color: var(--dark);
    overflow-x: hidden;
    position: relative;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Manrope', sans-serif;
    font-weight: 600;
    color: var(--dark);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: var(--transition);
}

a:hover {
    color: var(--primary-dark);
    text-decoration: none;
}

/* ============================================
   ANIMATED PARTICLES BACKGROUND
   ============================================ */

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.particle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: rgba(31, 132, 239, 0.3);
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.particle:nth-child(2n) {
    background: rgba(31, 190, 196, 0.3);
    animation-delay: -1s;
    animation-duration: 8s;
}

.particle:nth-child(3n) {
    background: rgba(31, 132, 239, 0.2);
    animation-delay: -3s;
    animation-duration: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    90% {
        opacity: 1;
    }
    50% {
        transform: translateY(-100px) rotate(180deg);
    }
}

/* ============================================
   iOS CARD DESIGN
   ============================================ */

.card {
    border: none;
    border-radius: var(--radius-xl);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transition: var(--transition);
    padding: 1.5rem;
}

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

.card.glass {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-100);
    padding: 1.5rem;
}

.card-body {
    padding: 1.5rem;
}

.card-footer {
    background: transparent;
    border-top: 1px solid var(--gray-100);
    padding: 1.5rem;
}

/* ============================================
   BUTTONS - iOS STYLE
   ============================================ */

.btn {
    border-radius: var(--radius-lg);
    border: none;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: var(--transition);
    font-size: 0.95rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    box-shadow: 0 4px 15px rgba(31, 132, 239, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-light), var(--primary-dark));
    color: white;
    box-shadow: 0 6px 25px rgba(31, 132, 239, 0.4);
    transform: translateY(-2px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-secondary {
    background: var(--gray-100);
    color: var(--dark);
    border: 1px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-200);
    color: var(--dark);
    border-color: var(--gray-300);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-icon {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-lg);
    background: var(--gray-100);
    border: none;
    cursor: pointer;
    transition: var(--transition);
    font-size: 1.1rem;
}

.btn-icon:hover {
    background: var(--gray-200);
    transform: scale(1.05);
}

.btn-icon-danger:hover {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

/* ============================================
   FORMS - iOS STYLE
   ============================================ */

.form-control,
.form-select {
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0.75rem 1rem;
    font-size: 1rem;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.8);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.25rem rgba(31, 132, 239, 0.1);
    background: white;
}

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

.form-label {
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 0.5rem;
    font-size: 0.95rem;
}

.form-label .required {
    color: var(--danger);
    margin-left: 2px;
}

.input-group-text {
    background: transparent;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
}

/* ============================================
   ALERTS
   ============================================ */

.alert {
    border-radius: var(--radius-lg);
    border: none;
    padding: 1rem 1.25rem;
    font-size: 0.95rem;
    animation: slideDown 0.3s ease-out;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
    border-left: 4px solid var(--success);
}

.alert-danger {
    background: rgba(239, 68, 68, 0.1);
    color: #7f1d1d;
    border-left: 4px solid var(--danger);
}

.alert-warning {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
    border-left: 4px solid var(--warning);
}

.alert-info {
    background: rgba(31, 132, 239, 0.1);
    color: #1e40af;
    border-left: 4px solid var(--info);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================
   BADGES
   ============================================ */

.badge {
    padding: 0.4rem 0.75rem;
    border-radius: var(--radius-md);
    font-weight: 600;
    font-size: 0.8rem;
}

.badge-new {
    background: rgba(59, 130, 246, 0.1);
    color: #1e40af;
}

.badge-contacted {
    background: rgba(245, 158, 11, 0.1);
    color: #92400e;
}

.badge-qualified {
    background: rgba(139, 92, 246, 0.1);
    color: #5b21b6;
}

.badge-converted {
    background: rgba(16, 185, 129, 0.1);
    color: #065f46;
}

.badge-lost {
    background: rgba(239, 68, 68, 0.1);
    color: #991b1b;
}

/* ============================================
   TABLES
   ============================================ */

.table {
    border-collapse: separate;
    border-spacing: 0 0.75rem;
}

.table thead th {
    background: transparent;
    border: none;
    font-weight: 600;
    color: var(--dark);
    padding: 1rem;
    font-size: 0.95rem;
}

.table tbody tr {
    background: rgba(255, 255, 255, 0.9);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
}

.table tbody tr:hover {
    background: white;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.table tbody td {
    border: none;
    padding: 1rem;
    vertical-align: middle;
}

/* ============================================
   DASHBOARD LAYOUT
   ============================================ */

.dashboard-body {
    background: linear-gradient(135deg, var(--light) 0%, #f4f4f4 100%);
}

.navbar-custom {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
}

.navbar-custom .navbar-brand {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--primary);
}

.nav-link {
    color: var(--dark);
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--radius-lg);
    margin: 0 0.25rem;
}

.nav-link:hover {
    color: var(--primary);
    background: var(--gray-100);
}

.nav-link.active {
    color: var(--primary);
    background: rgba(31, 132, 239, 0.1);
}

/* ============================================
   STAT CARDS
   ============================================ */

.stat-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    box-shadow: var(--shadow-md);
    border-left: 4px solid transparent;
    transition: var(--transition);
}

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

.stat-card h6 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--gray-500);
    margin-bottom: 0.5rem;
}

.stat-card .stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--dark);
    margin: 0.5rem 0;
}

.stat-card .stat-percentage {
    font-size: 0.85rem;
    color: var(--gray-500);
}

.stat-card-new { border-left-color: #3b82f6; }
.stat-card-contacted { border-left-color: #f59e0b; }
.stat-card-qualified { border-left-color: #8b5cf6; }
.stat-card-converted { border-left-color: #10b981; }
.stat-card-lost { border-left-color: #ef4444; }
.stat-card-total { border-left-color: #6366f1; }

/* ============================================
   METRIC CARDS
   ============================================ */

.metric-card {
    background: rgba(255, 255, 255, 0.95);
    border-radius: var(--radius-xl);
    padding: 1.5rem;
    text-align: center;
    box-shadow: var(--shadow-md);
    transition: var(--transition);
}

.metric-card:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-4px);
}

.metric-label {
    font-size: 0.85rem;
    color: var(--gray-500);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.75rem;
}

.metric-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--primary);
    margin: 0.5rem 0;
}

.metric-subtext {
    font-size: 0.8rem;
    color: var(--gray-500);
}

/* ============================================
   MODALS - iOS STYLE
   ============================================ */

.modal-content {
    border-radius: var(--radius-2xl);
    border: none;
    box-shadow: var(--shadow-2xl);
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
}

.modal-header {
    background: transparent;
    border-bottom: 1px solid var(--gray-100);
    padding: 1.5rem;
}

.modal-title {
    font-weight: 600;
    color: var(--dark);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    background: transparent;
    border-top: 1px solid var(--gray-100);
    padding: 1.5rem;
}

.btn-close {
    filter: invert(0.2);
}

/* ============================================
   SIDEBAR/NAVIGATION
   ============================================ */

.sidebar {
    background: rgba(255, 255, 255, 0.95);
    border-right: 1px solid var(--gray-100);
    box-shadow: var(--shadow-sm);
    min-height: 100vh;
    position: sticky;
    top: 0;
}

.sidebar-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--gray-100);
}

.sidebar-logo {
    height: 40px;
    margin-bottom: 0.5rem;
}

.sidebar-header h6 {
    margin: 0;
    font-size: 0.95rem;
    color: var(--dark);
}

.nav-sidebar {
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    flex: 1;
}

.nav-sidebar a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-lg);
    color: var(--dark);
    text-decoration: none;
    font-weight: 500;
    transition: var(--transition);
    font-size: 0.95rem;
}

.nav-sidebar a:hover {
    background: var(--gray-100);
    color: var(--primary);
}

.nav-sidebar a.active {
    background: rgba(31, 132, 239, 0.1);
    color: var(--primary);
}

.nav-sidebar a .icon {
    font-size: 1.2rem;
    width: 24px;
    text-align: center;
}

.sidebar-footer {
    padding: 1rem;
    border-top: 1px solid var(--gray-100);
}

/* ============================================
   PAGINATION
   ============================================ */

.pagination {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

.pagination-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--gray-200);
    background: white;
    border-radius: var(--radius-lg);
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--primary);
    transition: var(--transition);
}

.pagination-btn:hover {
    background: var(--gray-100);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.pagination-current {
    padding: 0.5rem 1rem;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: var(--radius-lg);
    font-weight: 500;
}

/* ============================================
   UTILITIES
   ============================================ */

.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.text-small { font-size: 0.875rem; }
.font-weight-bold { font-weight: 600; }

.shadow-custom {
    box-shadow: var(--shadow-md);
}

.shadow-custom-lg {
    box-shadow: var(--shadow-lg);
}

.rounded-custom {
    border-radius: var(--radius-xl);
}

.bg-gradient {
    background: linear-gradient(135deg, var(--light) 0%, #f4f4f4 100%);
}

.glass-effect {
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 768px) {
    .card {
        padding: 1.25rem;
    }

    .stat-card {
        padding: 1.25rem;
    }

    .table {
        font-size: 0.85rem;
    }

    .table tbody td {
        padding: 0.75rem;
    }

    .btn {
        padding: 0.65rem 1.25rem;
        font-size: 0.9rem;
    }

    .sidebar {
        position: static;
        min-height: auto;
        border-right: none;
        border-bottom: 1px solid var(--gray-100);
        margin-bottom: 1rem;
    }

    .nav-sidebar {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .sidebar-footer {
        border-top: none;
        border-left: 1px solid var(--gray-100);
        padding-left: 1rem;
    }
}

@media (max-width: 480px) {
    .card {
        padding: 1rem;
    }

    .stat-card {
        padding: 1rem;
    }

    .metric-card {
        padding: 1rem;
    }

    .modal-content {
        border-radius: var(--radius-lg);
    }

    .btn {
        padding: 0.6rem 1rem;
        font-size: 0.85rem;
    }
}

/* ============================================
   ANIMATIONS
   ============================================ */

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

.animate-in {
    animation: slideUp 0.6s ease-out;
}
