/**
 * Main Stylesheet
 * OBGYN Research & Collaboration Platform
 */

/* ============================================
   GENERAL STYLES
   ============================================ */

:root {
    --primary-color: #0d6efd;
    --secondary-color: #6c757d;
    --success-color: #198754;
    --danger-color: #dc3545;
    --warning-color: #ffc107;
    --info-color: #0dcaf0;
    --light-color: #f8f9fa;
    --dark-color: #212529;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

main {
    flex: 1;
}

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

.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.navbar-brand {
    font-weight: bold;
    font-size: 1.3rem;
}

.navbar-nav .nav-link {
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-2px);
}

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

.card {
    border: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    margin-bottom: 20px;
}

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

.card-header {
    background-color: var(--primary-color);
    color: white;
    font-weight: 600;
}

/* ============================================
   BUTTONS
   ============================================ */

.btn {
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
}

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

/* ============================================
   FORMS
   ============================================ */

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(13, 110, 253, 0.25);
}

.form-label {
    font-weight: 500;
    margin-bottom: 0.5rem;
}

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

.badge {
    padding: 0.5em 0.75em;
    font-weight: 500;
}

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

.alert {
    border: none;
    border-radius: 8px;
}

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

.table {
    background-color: white;
}

.table thead th {
    background-color: var(--light-color);
    font-weight: 600;
    border-bottom: 2px solid var(--primary-color);
}

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

.pagination .page-link {
    color: var(--primary-color);
}

.pagination .page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

/* ============================================
   PROFILE CARDS
   ============================================ */

.profile-card {
    text-align: center;
    padding: 20px;
}

.profile-card img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 4px solid var(--primary-color);
    margin-bottom: 15px;
}

.profile-card h5 {
    margin-bottom: 5px;
    font-weight: 600;
}

.profile-card .text-muted {
    font-size: 0.9rem;
}

/* ============================================
   STUDY CARDS
   ============================================ */

.study-card {
    position: relative;
}

.study-card .badge {
    position: absolute;
    top: 10px;
    right: 10px;
}

.study-card .card-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
}

.study-card .card-text {
    color: #666;
    font-size: 0.9rem;
}

.study-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #888;
    margin-top: 10px;
}

.study-meta i {
    margin-right: 5px;
}

/* ============================================
   STATS CARDS
   ============================================ */

.stats-card {
    background: linear-gradient(135deg, var(--primary-color), #0a58ca);
    color: white;
    padding: 20px;
    border-radius: 10px;
    text-align: center;
}

.stats-card h3 {
    font-size: 2.5rem;
    font-weight: bold;
    margin-bottom: 5px;
}

.stats-card p {
    margin: 0;
    opacity: 0.9;
}

/* ============================================
   CHAT / MESSAGES
   ============================================ */

.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background-color: #f8f9fa;
}

.message {
    margin-bottom: 15px;
    display: flex;
}

.message.sent {
    justify-content: flex-end;
}

.message.received {
    justify-content: flex-start;
}

.message-bubble {
    max-width: 70%;
    padding: 10px 15px;
    border-radius: 15px;
    word-wrap: break-word;
}

.message.sent .message-bubble {
    background-color: var(--primary-color);
    color: white;
}

.message.received .message-bubble {
    background-color: white;
    border: 1px solid #ddd;
}

.message-time {
    font-size: 0.75rem;
    color: #888;
    margin-top: 5px;
}

.chat-input {
    padding: 15px;
    background-color: white;
    border-top: 1px solid #ddd;
}

/* ============================================
   NOTIFICATIONS
   ============================================ */

.notification-item {
    padding: 15px;
    border-bottom: 1px solid #eee;
    transition: background-color 0.3s ease;
}

.notification-item:hover {
    background-color: #f8f9fa;
}

.notification-item.unread {
    background-color: #e7f3ff;
}

.notification-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
}

/* ============================================
   SEARCH
   ============================================ */

.search-box {
    position: relative;
}

.search-box input {
    padding-right: 40px;
}

.search-box .search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: #888;
}

/* ============================================
   FILTERS
   ============================================ */

.filter-section {
    background-color: white;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.filter-section h6 {
    font-weight: 600;
    margin-bottom: 15px;
}

/* ============================================
   TIMELINE
   ============================================ */

.timeline {
    position: relative;
    padding-left: 30px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: var(--primary-color);
}

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

.timeline-item::before {
    content: '';
    position: absolute;
    left: -35px;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: var(--primary-color);
    border: 3px solid white;
    box-shadow: 0 0 0 2px var(--primary-color);
}

/* ============================================
   TAGS
   ============================================ */

.tag {
    display: inline-block;
    padding: 5px 12px;
    background-color: #e9ecef;
    border-radius: 20px;
    font-size: 0.85rem;
    margin: 3px;
    transition: all 0.3s ease;
}

.tag:hover {
    background-color: var(--primary-color);
    color: white;
    cursor: pointer;
}

/* ============================================
   FILE UPLOAD
   ============================================ */

.file-upload-area {
    border: 2px dashed #ddd;
    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-color: #f8f9fa;
}

.file-upload-area.dragover {
    border-color: var(--primary-color);
    background-color: #e7f3ff;
}

/* ============================================
   LOADING SPINNER
   ============================================ */

.loading-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 1s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* ============================================
   FOOTER
   ============================================ */

footer {
    margin-top: auto;
}

footer a:hover {
    color: white !important;
}

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

@media (max-width: 768px) {
    .stats-card h3 {
        font-size: 2rem;
    }
    
    .profile-card img {
        width: 100px;
        height: 100px;
    }
    
    .message-bubble {
        max-width: 85%;
    }
}

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

.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;
}

.cursor-pointer {
    cursor: pointer;
}

.hover-shadow:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
}

/* ============================================
   ADMIN DASHBOARD
   ============================================ */

.admin-sidebar {
    background-color: #2c3e50;
    min-height: calc(100vh - 56px);
    padding: 20px 0;
}

.admin-sidebar .nav-link {
    color: rgba(255,255,255,0.8);
    padding: 12px 20px;
    transition: all 0.3s ease;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
    background-color: rgba(255,255,255,0.1);
    color: white;
}
