/* SentraFlow Maritime Operations Platform - Custom Styles */

/* Color Variables */
:root {
    --maritime-blue: #0077be;
    --maritime-dark-blue: #003f5c;
    --maritime-light-blue: #4a90e2;
    --ocean-blue: #006994;
    --wave-blue: #0099cc;
    --deep-blue: #002b5b;
    --seafoam: #70a1d7;
    --white-foam: #f8fafc;
    --lighthouse-red: #dc3545;
    --sunset-orange: #fd7e14;
    --maritime-gray: #6c757d;
}

/* Global Styles */
body {
    font-family: 'Inter', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--white-foam);
    color: #333;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Header Styles */
.main-header {
    background: url('../images/ocean-background.jpg');
    background-size: cover;
    background-position: center bottom;
    background-repeat: no-repeat;
    background-attachment: scroll;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 100vw;
    margin-left: calc(-50vw + 50%);
    position: relative;
    min-height: 350px;
    background-color: #4FC3F7;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-logo-link {
    display: block;
    text-decoration: none;
    width: 90%;
    max-width: 800px;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.15),
        0 8px 16px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    margin: 0 auto;
}

.header-logo-link:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 
        0 25px 50px rgba(0, 0, 0, 0.2),
        0 10px 20px rgba(0, 0, 0, 0.15);
}

.header-logo {
    width: 100%;
    height: auto;
    border-radius: 15px;
    filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.1));
    display: block;
}
    min-height: 220px;
    max-height: 320px;
    object-fit: contain;
    object-position: center;
    transition: all 0.3s ease;
    display: block;
    padding: 20px 0 30px 0;
    position: relative;
    z-index: 10;
    filter: drop-shadow(0 0 25px rgba(79, 195, 247, 0.5)) 
            drop-shadow(0 0 50px rgba(0, 119, 190, 0.4))
            drop-shadow(0 0 75px rgba(79, 195, 247, 0.2))
            drop-shadow(0 3px 15px rgba(0, 63, 92, 0.3))
            blur(0.3px);
}

.header-logo:hover {
    transform: scale(1.02);
    filter: drop-shadow(0 0 35px rgba(79, 195, 247, 0.7)) 
            drop-shadow(0 0 70px rgba(0, 119, 190, 0.5))
            drop-shadow(0 0 100px rgba(79, 195, 247, 0.3))
            drop-shadow(0 4px 20px rgba(0, 63, 92, 0.4))
            blur(0.2px);
}

/* Main content area */
.main-content {
    padding: 20px;
    background-color: #f8f9fa;
}

/* Footer Styles */
.footer {
    margin-top: auto;
    border-top: 1px solid #dee2e6;
    background-color: #212529 !important;
    flex-shrink: 0;
}

.footer h5, .footer h6 {
    color: #ffffff;
    font-weight: 600;
}

.footer .social-links a {
    font-size: 1.2rem;
    transition: color 0.3s ease;
}

.footer .social-links a:hover {
    color: var(--maritime-blue) !important;
}

.footer ul li {
    margin-bottom: 0.5rem;
}

.footer ul li a {
    transition: color 0.3s ease;
}

.footer ul li a:hover {
    color: #ffffff !important;
}

/* Top User Bar */
.top-user-bar {
    background-color: #f8f9fa !important;
    border-bottom: 1px solid #dee2e6 !important;
    font-size: 0.875rem;
}

.top-user-bar .btn-sm {
    padding: 0.375rem 0.75rem;
    font-size: 0.875rem;
}

/* Navigation Styles */
.navbar {
    z-index: 1030;
    border-top: 2px solid var(--maritime-light-blue);
    margin-top: 0;
}

.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-brand small {
    font-size: 0.75rem;
    font-weight: 400;
    line-height: 1.2;
}

.navbar-dark .navbar-nav .nav-link {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    transition: all 0.3s ease;
    padding: 0.5rem 1rem;
    margin: 0 0.25rem;
}

.navbar-dark .navbar-nav .nav-link:hover,
.navbar-dark .navbar-nav .nav-link.active {
    color: #fff;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 0.375rem;
}

/* Better spacing for desktop navigation */
@media (min-width: 992px) {
    .navbar-nav {
        gap: 0.5rem;
    }
    
    .navbar-dark .navbar-nav .nav-link {
        padding: 0.75rem 1.25rem;
        margin: 0 0.125rem;
        font-size: 0.95rem;
    }
    
    /* Ensure user menu stays at top-left */
    .navbar .container-fluid {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }
    
    .navbar .order-0 {
        order: 0;
        flex-shrink: 0;
    }
    
    .navbar .order-1 {
        order: 1;
        flex-grow: 1;
    }
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 76px);
    padding-top: 0;
}

/* Card Styles */
.card {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

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

.card-header {
    background-color: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    font-weight: 600;
    border-radius: 0.75rem 0.75rem 0 0 !important;
}

/* Gradient Cards */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--maritime-blue), var(--ocean-blue));
}

.bg-primary {
    background-color: var(--maritime-blue) !important;
}

.bg-success {
    background-color: #198754 !important;
}

.bg-warning {
    background-color: #ffc107 !important;
}

.bg-danger {
    background-color: var(--lighthouse-red) !important;
}

/* Metric Cards */
.metric-card {
    border-left: 4px solid var(--maritime-blue);
    transition: all 0.3s ease;
}

.metric-card:hover {
    border-left-color: var(--ocean-blue);
}

.metric-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 1.5rem;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    margin: 0.5rem 0;
}

.metric-label {
    color: var(--maritime-gray);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
}

/* Module Cards */
.module-card {
    border-top: 4px solid transparent;
    transition: all 0.3s ease;
}

.module-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.module-card:nth-child(1) { border-top-color: var(--maritime-blue); }
.module-card:nth-child(2) { border-top-color: #198754; }
.module-card:nth-child(3) { border-top-color: #ffc107; }
.module-card:nth-child(4) { border-top-color: var(--lighthouse-red); }

.module-icon {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    font-size: 2rem;
}

/* Activity Feed */
.activity-feed {
    max-height: 300px;
    overflow-y: auto;
}

.activity-item {
    display: flex;
    align-items: center;
    padding: 0.75rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

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

/* ESG Score Badges */
.badge-score {
    font-size: 0.875rem;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

.badge-score.environmental { background-color: #198754; }
.badge-score.social { background-color: #0d6efd; }
.badge-score.governance { background-color: #6f42c1; }
.badge-score.overall { background-color: var(--maritime-blue); }

/* Circular Progress Indicators */
.circular-progress {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: conic-gradient(var(--maritime-blue) 0deg, var(--maritime-blue) calc(var(--progress, 0) * 3.6deg), #e9ecef calc(var(--progress, 0) * 3.6deg));
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    position: relative;
}

.circular-progress::before {
    content: '';
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: white;
    position: absolute;
}

.progress-value {
    position: relative;
    z-index: 1;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--maritime-blue);
}

.circular-progress.environmental {
    background: conic-gradient(#198754 0deg, #198754 calc(var(--progress, 0) * 3.6deg), #e9ecef calc(var(--progress, 0) * 3.6deg));
}

.circular-progress.social {
    background: conic-gradient(#0d6efd 0deg, #0d6efd calc(var(--progress, 0) * 3.6deg), #e9ecef calc(var(--progress, 0) * 3.6deg));
}

.circular-progress.governance {
    background: conic-gradient(#6f42c1 0deg, #6f42c1 calc(var(--progress, 0) * 3.6deg), #e9ecef calc(var(--progress, 0) * 3.6deg));
}

/* Table Styles */
.table {
    border-radius: 0.75rem;
    overflow: hidden;
}

.table thead th {
    background-color: var(--white-foam);
    border-bottom: 2px solid rgba(0, 0, 0, 0.1);
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    color: var(--maritime-gray);
}

.table tbody tr:hover {
    background-color: rgba(0, 119, 190, 0.05);
}

/* Status Badges */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 0.5rem;
}

/* Progress Bars */
.progress {
    border-radius: 0.5rem;
    background-color: rgba(0, 0, 0, 0.05);
}

.progress-bar {
    border-radius: 0.5rem;
}

/* Chat Styles */
.chat-messages {
    background-color: #f8f9fa;
    border-radius: 0.75rem;
    padding: 1rem;
    border: 1px solid #dee2e6;
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem;
    border-radius: 0.5rem;
}

.chat-message.user {
    background-color: var(--maritime-blue);
    color: white;
    margin-left: 20%;
}

.chat-message.ai {
    background-color: white;
    border: 1px solid #dee2e6;
    margin-right: 20%;
}

/* Modal Styles */
.modal-content {
    border: none;
    border-radius: 0.75rem;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}

.modal-header {
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 0.75rem 0.75rem 0 0;
}

/* Button Styles */
.btn {
    border-radius: 0.5rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

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

.btn-primary:hover {
    background-color: var(--ocean-blue);
    border-color: var(--ocean-blue);
    transform: translateY(-1px);
}

.btn-outline-primary {
    color: var(--maritime-blue);
    border-color: var(--maritime-blue);
}

.btn-outline-primary:hover {
    background-color: var(--maritime-blue);
    border-color: var(--maritime-blue);
}

/* Alert Styles */
.alert {
    border: none;
    border-radius: 0.75rem;
    border-left: 4px solid;
}

.alert-primary { border-left-color: var(--maritime-blue); }
.alert-success { border-left-color: #198754; }
.alert-warning { border-left-color: #ffc107; }
.alert-danger { border-left-color: var(--lighthouse-red); }
.alert-info { border-left-color: #0dcaf0; }

/* Responsive Design */
@media (max-width: 768px) {
    .metric-value {
        font-size: 2rem;
    }
    
    .module-icon {
        width: 60px;
        height: 60px;
        font-size: 1.5rem;
    }
    
    .circular-progress {
        width: 60px;
        height: 60px;
    }
    
    .circular-progress::before {
        width: 45px;
        height: 45px;
    }
    
    .progress-value {
        font-size: 1rem;
    }
    
    /* Center mobile menu toggle */
    .navbar-toggler {
        margin: 0 auto;
        display: block;
    }
    
    .navbar .container-fluid {
        justify-content: center;
    }
}

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

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Loading States */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    border-radius: 0.75rem;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: var(--maritime-blue);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--ocean-blue);
}

/* Print Styles */
@media print {
    .navbar,
    .btn,
    .modal {
        display: none !important;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #dee2e6;
    }
}

/* Focus States for Accessibility */
.btn:focus,
.form-control:focus {
    box-shadow: 0 0 0 0.2rem rgba(0, 119, 190, 0.25);
}

/* Utility Classes */
.text-maritime-blue { color: var(--maritime-blue); }
.bg-maritime-blue { background-color: var(--maritime-blue); }
.border-maritime-blue { border-color: var(--maritime-blue); }

.shadow-maritime {
    box-shadow: 0 4px 12px rgba(0, 119, 190, 0.15);
}

.rounded-maritime {
    border-radius: 0.75rem;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .card {
        border: 2px solid #000;
    }
    
    .badge {
        border: 1px solid #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
