/**
 * 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
   ============================================ */


/* Sidebar fix for overlap with fixed header */
.admin-sidebar, .sidebar {
    background-color: #2c3e50;
    min-height: calc(100vh - 56px);
    padding: 20px 0;
    position: fixed;
    top: 56px;
    left: 0;
    height: calc(100vh - 56px);
    width: 220px;
    z-index: 1030;
    overflow-y: auto;
}

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

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

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

/* ============================================
   PHASE 9: HOMEPAGE ENHANCEMENTS
   ============================================ */

/* CSS Custom Properties for Phase 9 */
:root {
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --gradient-success: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --gradient-info: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
    --transition-speed: 0.3s;
    --border-radius: 8px;
    --box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --box-shadow-hover: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* Hero Slider Styles */
.hero-swiper {
    width: 100%;
    height: 600px;
    position: relative;
}

.hero-swiper .swiper-slide {
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.hero-swiper .swiper-slide::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.8), rgba(108, 117, 125, 0.6));
    z-index: 1;
}

.hero-swiper .slide-content {
    position: relative;
    z-index: 2;
    color: white;
    text-align: center;
    padding: 0 20px;
    max-width: 800px;
}

.hero-swiper .slide-content h1 {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease-out;
}

.hero-swiper .slide-content h2 {
    font-size: 1.8rem;
    font-weight: 400;
    margin-bottom: 1rem;
    opacity: 0.95;
    animation: fadeInUp 1s ease-out 0.2s both;
}

.hero-swiper .slide-content p {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    animation: fadeInUp 1s ease-out 0.4s both;
}

.hero-swiper .slide-content .btn {
    animation: fadeInUp 1s ease-out 0.6s both;
    padding: 12px 30px;
    font-size: 1.1rem;
    border-radius: 50px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.hero-swiper .swiper-button-next,
.hero-swiper .swiper-button-prev {
    color: white;
    background: rgba(255, 255, 255, 0.2);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    transition: all var(--transition-speed);
}

.hero-swiper .swiper-button-next:hover,
.hero-swiper .swiper-button-prev:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
}

.hero-swiper .swiper-button-next::after,
.hero-swiper .swiper-button-prev::after {
    font-size: 20px;
}

.hero-swiper .swiper-pagination-bullet {
    width: 12px;
    height: 12px;
    background: white;
    opacity: 0.5;
    transition: all var(--transition-speed);
}

.hero-swiper .swiper-pagination-bullet-active {
    opacity: 1;
    width: 30px;
    border-radius: 6px;
}

/* Sticky Header Styles */
.navbar-scrolled {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transition: all var(--transition-speed);
}

.navbar-scrolled .navbar-brand {
    font-size: 1.1rem;
    transition: all var(--transition-speed);
}

/* Scroll to Top Button */
#scrollToTop {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
    display: none;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: var(--gradient-primary);
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: all var(--transition-speed);
}

#scrollToTop:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}

/* About Snippet Section */
.about-snippet {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.about-snippet::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(13, 110, 253, 0.1) 0%, transparent 70%);
    border-radius: 50%;
}

.about-snippet h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: #2c3e50;
}

.about-snippet .lead {
    font-size: 1.2rem;
    color: #555;
    margin-bottom: 3rem;
}

.about-highlight {
    background: white;
    padding: 30px;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed);
    height: 100%;
}

.about-highlight:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.about-highlight .icon {
    width: 60px;
    height: 60px;
    background: var(--gradient-primary);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
    font-size: 24px;
}

.about-highlight h4 {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 15px;
    color: #2c3e50;
}

.about-highlight p {
    color: #666;
    margin: 0;
}

/* Enhanced Statistics Section */
.stats-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 60px 0;
    color: white;
}

.stats-card-enhanced {
    text-align: center;
    padding: 30px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    backdrop-filter: blur(10px);
    transition: all var(--transition-speed);
}

.stats-card-enhanced:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-5px);
}

.stats-card-enhanced .counter {
    font-size: 3rem;
    font-weight: 700;
    display: block;
    margin-bottom: 10px;
}

.stats-card-enhanced i {
    font-size: 2.5rem;
    margin-bottom: 15px;
    opacity: 0.9;
}

.stats-card-enhanced p {
    font-size: 1.1rem;
    margin: 0;
    opacity: 0.95;
}

/* Blog Card Enhancements */
.blog-card {
    transition: all var(--transition-speed);
    border-radius: var(--border-radius);
    overflow: hidden;
}

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

.blog-card img {
    transition: all var(--transition-speed);
}

.blog-card:hover img {
    transform: scale(1.05);
}

/* Mobile Menu Enhancements */
@media (max-width: 991px) {
    body.mobile-menu-open {
        overflow: hidden;
    }
    
    body.mobile-menu-open::before {
        content: '';
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        animation: fadeIn 0.3s ease-out;
    }
    
    .navbar-collapse {
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        max-width: 300px;
        height: 100vh;
        background: white;
        z-index: 1050;
        transition: right 0.3s ease-out;
        overflow-y: auto;
        box-shadow: -2px 0 10px rgba(0, 0, 0, 0.1);
    }
    
    .navbar-collapse.show {
        right: 0;
    }
    
    .navbar-nav {
        padding: 20px;
    }
    
    .navbar-nav .nav-link {
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        color: #333 !important;
    }
    
    .navbar-nav .nav-link:hover {
        background: #f8f9fa;
        transform: translateX(5px);
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(50px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* AOS Animation Overrides */
[data-aos] {
    transition-duration: 1s;
}

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: var(--gradient-primary) !important;
}

.bg-gradient-secondary {
    background: var(--gradient-secondary) !important;
}

.bg-gradient-success {
    background: var(--gradient-success) !important;
}

.bg-gradient-info {
    background: var(--gradient-info) !important;
}

/* Enhanced Shadows */
.shadow-soft {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08) !important;
}

.shadow-medium {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12) !important;
}

.shadow-strong {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.16) !important;
}

/* Smooth Transitions */
.transition-all {
    transition: all var(--transition-speed) ease;
}

/* Hover Effects */
.hover-lift {
    transition: all var(--transition-speed);
}

.hover-lift:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-hover);
}

.hover-scale {
    transition: all var(--transition-speed);
}

.hover-scale:hover {
    transform: scale(1.05);
}

/* Responsive Adjustments for Phase 9 */
@media (max-width: 768px) {
    .hero-swiper {
        height: 400px;
    }
    
    .hero-swiper .slide-content h1 {
        font-size: 2rem;
    }
    
    .hero-swiper .slide-content h2 {
        font-size: 1.3rem;
    }
    
    .hero-swiper .slide-content p {
        font-size: 1rem;
    }
    
    .about-snippet h2 {
        font-size: 2rem;
    }
    
    .stats-card-enhanced .counter {
        font-size: 2.5rem;
    }
    
    #scrollToTop {
        bottom: 20px;
        right: 20px;
        width: 45px;
        height: 45px;
        font-size: 18px;
    }
}

@media (max-width: 576px) {
    .hero-swiper {
        height: 350px;
    }
    
    .hero-swiper .slide-content h1 {
        font-size: 1.5rem;
    }
    
    .hero-swiper .slide-content h2 {
        font-size: 1.1rem;
    }
    
    .hero-swiper .slide-content .btn {
        padding: 10px 20px;
        font-size: 1rem;
    }
}
