/**
 * Custom Styles for Entrepreneur Platform
 * Extends Bootstrap 5 with custom styling
 */

/* ==========================================================================
   CSS Variables
   ========================================================================== */
:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #212529;
    --body-bg: #f5f7fa;
    --card-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
    --card-shadow-hover: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    --transition-speed: 0.3s;
}

/* ==========================================================================
   Base Styles
   ========================================================================== */
body {
    background-color: var(--body-bg);
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

/* ==========================================================================
   Typography
   ========================================================================== */
h1, h2, h3, h4, h5, h6 {
    font-weight: 600;
}

.text-muted {
    color: #6c757d !important;
}

/* ==========================================================================
   Navbar Customization
   ========================================================================== */
.navbar {
    box-shadow: var(--card-shadow);
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.25rem;
}

.nav-link {
    transition: color var(--transition-speed) ease;
}

.nav-link:hover {
    opacity: 0.8;
}

/* ==========================================================================
   Card Styles
   ========================================================================== */
.card {
    border: none;
    box-shadow: var(--card-shadow);
    transition: box-shadow var(--transition-speed) ease, 
                transform var(--transition-speed) ease;
}

.card:hover {
    box-shadow: var(--card-shadow-hover);
}

.card-entrepreneur {
    cursor: pointer;
}

.card-entrepreneur:hover {
    transform: translateY(-5px);
}

.card-header {
    background-color: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
}

/* ==========================================================================
   Buttons
   ========================================================================== */
.btn {
    border-radius: 0.375rem;
    font-weight: 500;
    transition: all var(--transition-speed) ease;
}

.btn-primary {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.btn-primary:hover {
    background-color: #0b5ed7;
    border-color: #0a58ca;
    transform: translateY(-1px);
}

.btn-outline-primary:hover {
    transform: translateY(-1px);
}

.btn-whatsapp {
    background-color: #25d366;
    border-color: #25d366;
    color: #fff;
}

.btn-whatsapp:hover {
    background-color: #128c7e;
    border-color: #128c7e;
    color: #fff;
}

/* ==========================================================================
   Forms
   ========================================================================== */
.form-control,
.form-select {
    border-radius: 0.375rem;
    border: 1px solid #dee2e6;
    padding: 0.625rem 0.875rem;
    transition: border-color var(--transition-speed) ease,
                box-shadow var(--transition-speed) ease;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.15);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.375rem;
}

.form-text {
    color: var(--secondary-color);
    font-size: 0.875rem;
}

.input-group-text {
    background-color: var(--light-color);
    border: 1px solid #dee2e6;
}

/* ==========================================================================
   Hero Section
   ========================================================================== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6610f2 100%);
    color: #fff;
    padding: 4rem 0;
    margin-bottom: 2rem;
}

.hero-section h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.hero-section .lead {
    font-size: 1.25rem;
    opacity: 0.9;
}

/* ==========================================================================
   Entrepreneur Grid
   ========================================================================== */
.entrepreneur-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.entrepreneur-card {
    height: 100%;
}

.entrepreneur-card .card-img-top {
    height: 180px;
    object-fit: cover;
    background-color: var(--light-color);
}

.entrepreneur-card .card-body {
    display: flex;
    flex-direction: column;
}

.entrepreneur-card .card-title {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.entrepreneur-card .card-text {
    color: var(--secondary-color);
    font-size: 0.9rem;
    flex-grow: 1;
}

.entrepreneur-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 180px;
    background-color: var(--light-color);
    color: var(--secondary-color);
}

/* ==========================================================================
   Category Filter
   ========================================================================== */
.category-filter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 2rem;
}

.category-filter .btn {
    border-radius: 2rem;
    padding: 0.375rem 1rem;
    font-size: 0.875rem;
}

/* ==========================================================================
   Badge Styles
   ========================================================================== */
.badge {
    font-weight: 500;
    padding: 0.35em 0.65em;
}

.badge-status-active {
    background-color: var(--success-color);
}

.badge-status-inactive {
    background-color: var(--secondary-color);
}

.badge-status-pending {
    background-color: var(--warning-color);
    color: var(--dark-color);
}

.badge-status-rejected {
    background-color: var(--danger-color);
}

/* ==========================================================================
   Chat Styles
   ========================================================================== */
.chat-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 400px;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 0.5rem;
}

.chat-message {
    max-width: 80%;
    margin-bottom: 1rem;
    clear: both;
}

.chat-message.sent {
    float: right;
}

.chat-message.received {
    float: left;
}

.chat-bubble {
    padding: 0.75rem 1rem;
    border-radius: 1rem;
    position: relative;
}

.chat-message.sent .chat-bubble {
    background-color: var(--primary-color);
    color: #fff;
    border-bottom-right-radius: 0.25rem;
}

.chat-message.received .chat-bubble {
    background-color: #e9ecef;
    color: var(--dark-color);
    border-bottom-left-radius: 0.25rem;
}

.chat-time {
    font-size: 0.75rem;
    color: var(--secondary-color);
    margin-top: 0.25rem;
}

.chat-message.sent .chat-time {
    text-align: right;
}

.chat-form {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #dee2e6;
}

/* ==========================================================================
   Dashboard Styles
   ========================================================================== */
.dashboard-card {
    background: #fff;
    border-radius: 0.5rem;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.dashboard-stat {
    text-align: center;
    padding: 1.5rem;
}

.dashboard-stat .stat-value {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.dashboard-stat .stat-label {
    color: var(--secondary-color);
    font-size: 0.875rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* ==========================================================================
   Admin Panel
   ========================================================================== */
.admin-sidebar {
    background-color: var(--dark-color);
    min-height: 100vh;
}

.admin-sidebar .nav-link {
    color: rgba(255, 255, 255, 0.8);
    padding: 0.75rem 1rem;
    border-radius: 0.25rem;
    margin-bottom: 0.25rem;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
}

.admin-sidebar .nav-link i {
    margin-right: 0.5rem;
    width: 1.25rem;
    text-align: center;
}

/* ==========================================================================
   Table Styles
   ========================================================================== */
.table {
    background-color: #fff;
}

.table thead th {
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
    color: var(--secondary-color);
}

.table td {
    vertical-align: middle;
}

.table-hover tbody tr:hover {
    background-color: rgba(0, 0, 0, 0.02);
}

/* ==========================================================================
   Pagination
   ========================================================================== */
.pagination {
    margin-bottom: 0;
}

.page-link {
    border-radius: 0.375rem;
    margin: 0 0.125rem;
    color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ==========================================================================
   Alerts
   ========================================================================== */
.alert {
    border: none;
    border-radius: 0.5rem;
    border-left: 4px solid;
}

.alert-success {
    background-color: rgba(25, 135, 84, 0.1);
    border-left-color: var(--success-color);
    color: #0f5132;
}

.alert-danger {
    background-color: rgba(220, 53, 69, 0.1);
    border-left-color: var(--danger-color);
    color: #842029;
}

.alert-warning {
    background-color: rgba(255, 193, 7, 0.1);
    border-left-color: var(--warning-color);
    color: #664d03;
}

.alert-info {
    background-color: rgba(13, 202, 240, 0.1);
    border-left-color: #0dcaf0;
    color: #055160;
}

/* ==========================================================================
   Footer
   ========================================================================== */
footer {
    background-color: var(--dark-color);
    color: rgba(255, 255, 255, 0.8);
    padding: 2rem 0;
    margin-top: auto;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

footer a:hover {
    color: #fff;
}

/* ==========================================================================
   Utility Classes
   ========================================================================== */
.shadow-sm {
    box-shadow: var(--card-shadow) !important;
}

.shadow-hover:hover {
    box-shadow: var(--card-shadow-hover) !important;
}

.rounded-lg {
    border-radius: 0.5rem !important;
}

.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, #6610f2 100%);
}

.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ==========================================================================
   Loading Spinner
   ========================================================================== */
.loading-spinner {
    display: inline-block;
    width: 1.5rem;
    height: 1.5rem;
    border: 2px solid currentColor;
    border-right-color: transparent;
    border-radius: 50%;
    animation: spinner 0.75s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ==========================================================================
   Empty State
   ========================================================================== */
.empty-state {
    text-align: center;
    padding: 3rem;
    color: var(--secondary-color);
}

.empty-state i {
    font-size: 3rem;
    margin-bottom: 1rem;
    opacity: 0.5;
}

.empty-state h5 {
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */
@media (max-width: 768px) {
    .hero-section {
        padding: 2rem 0;
    }
    
    .hero-section h1 {
        font-size: 1.75rem;
    }
    
    .entrepreneur-grid {
        grid-template-columns: 1fr;
    }
    
    .chat-message {
        max-width: 90%;
    }
    
    .dashboard-stat .stat-value {
        font-size: 2rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
}

@media (max-width: 576px) {
    .category-filter {
        justify-content: center;
    }
    
    .btn-group-sm > .btn {
        padding: 0.25rem 0.5rem;
        font-size: 0.75rem;
    }
}

/* ==========================================================================
   Print Styles
   ========================================================================== */
@media print {
    .navbar,
    footer,
    .btn,
    .chat-form {
        display: none !important;
    }
    
    body {
        background-color: #fff;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}
