/* DataraFlow Theme Colors - Based on the logo */
:root {
    /* Logo-inspired color palette */
    --logo-blue: #2563eb;
    --logo-cyan: #0891b2;
    --logo-teal: #14b8a6;
    --logo-gradient: linear-gradient(135deg, #2563eb 0%, #0891b2 50%, #14b8a6 100%);
    --logo-gradient-dark: linear-gradient(135deg, #1e40af 0%, #0369a1 50%, #0f766e 100%);
    
    /* Extended color palette */
    --primary-blue: #2563eb;
    --primary-teal: #0891b2;
    --accent-teal: #14b8a6;
    --dark-blue: #1e40af;
    --light-gray: #f8fafc;
    --text-dark: #1e293b;
    --text-muted: #64748b;
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --border-color: rgba(37, 99, 235, 0.1);
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--text-dark);
    background-color: #ffffff;
}

/* Enhanced Navigation Styles */
.navbar {
    box-shadow: 0 2px 4px rgba(0,0,0,.1);
    transition: all 0.3s ease;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: all 0.2s ease;
    border-radius: 0.375rem;
    margin: 0 0.2rem;
    padding: 0.5rem 0.75rem !important;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255,255,255,0.1);
    transform: translateY(-1px);
}

.navbar-nav .nav-link.active {
    background-color: rgba(255,255,255,0.2);
    font-weight: 600;
}

/* Admin Navigation Tabs */
.nav-tabs {
    border-bottom: 2px solid #dee2e6;
    background: white;
    border-radius: 0.5rem 0.5rem 0 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
}

.nav-tabs .nav-link {
    border: none;
    color: var(--text-muted);
    font-weight: 500;
    padding: 1rem 1.5rem;
    margin-right: 0.5rem;
    border-radius: 0.5rem 0.5rem 0 0;
    transition: all 0.2s ease;
}

.nav-tabs .nav-link:hover {
    border-color: transparent;
    background-color: var(--light-gray);
    color: var(--primary-blue);
}

.nav-tabs .nav-link.active {
    color: var(--primary-blue);
    background-color: white;
    border-color: #dee2e6 #dee2e6 white;
    border-width: 2px 2px 2px 2px;
    font-weight: 600;
}

/* Breadcrumb Navigation */
.breadcrumb {
    background: transparent;
    padding: 0.5rem 0;
    margin-bottom: 1rem;
}

.breadcrumb-item + .breadcrumb-item::before {
    content: "›";
    color: var(--primary-teal);
    font-weight: bold;
}

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

.bg-gradient-dark {
    background: var(--logo-gradient-dark);
}

/* Logo-themed navigation */
.navbar-logo-theme {
    background: var(--logo-gradient-dark);
}

/* Logo-themed buttons */
.btn-logo-primary {
    background: var(--logo-gradient);
    border-color: var(--logo-blue);
    color: white;
    transition: all 0.3s ease;
}

.btn-logo-primary:hover {
    background: var(--logo-gradient-dark);
    border-color: var(--dark-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

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

.btn-outline-logo-primary:hover {
    background: var(--logo-gradient);
    border-color: var(--logo-blue);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(37, 99, 235, 0.3);
}

/* Logo-themed cards */
.card-logo-theme {
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.card-logo-theme:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(37, 99, 235, 0.1);
    border-color: var(--logo-blue);
}

/* Logo-themed stats */
.stats-number-logo {
    font-size: 2.5rem;
    font-weight: 700;
    background: var(--logo-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 0.5rem;
}

/* Logo-themed hero sections */
.hero-logo-theme {
    background: var(--logo-gradient);
    min-height: 60vh;
    position: relative;
    overflow: hidden;
}

.hero-logo-theme .container {
    position: relative;
    z-index: 1;
}

.hero-logo-theme::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="20" cy="20" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="80" cy="80" r="3" fill="rgba(255,255,255,0.1)"/><circle cx="60" cy="30" r="1.5" fill="rgba(255,255,255,0.1)"/></svg>');
    animation: float 20s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50% { transform: translateY(-20px); }
}

/* Logo-themed feature icons */
.feature-icon-logo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    background: var(--logo-gradient);
    box-shadow: 0 4px 15px rgba(37, 99, 235, 0.3);
}

/* Logo-themed progress bars */
.progress-bar-logo {
    background: var(--logo-gradient);
}

/* Logo-themed alerts */
.alert-logo-primary {
    background: linear-gradient(135deg, rgba(37, 99, 235, 0.1) 0%, rgba(20, 184, 166, 0.1) 100%);
    border-color: var(--logo-blue);
    color: var(--logo-blue);
}

/* Text colors */
.text-logo-blue { color: var(--logo-blue) !important; }
.text-logo-cyan { color: var(--logo-cyan) !important; }
.text-logo-teal { color: var(--logo-teal) !important; }

/* Logo Styles */
.logo-container {
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.logo-img {
    width: 45px;
    height: 45px;
    object-fit: contain;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
    transition: transform 0.3s ease;
}

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

/* Legacy logo styles (kept for backwards compatibility) */
.logo-d {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--primary-blue) 0%, var(--accent-teal) 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    font-weight: bold;
    box-shadow: 0 4px 15px rgba(44, 82, 130, 0.3);
    position: relative;
}

.logo-d::before {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(135deg, var(--accent-teal), var(--primary-teal));
    border-radius: 50%;
    z-index: -1;
    opacity: 0.3;
}

/* Navigation */
.navbar-brand {
    font-size: 1.5rem;
    font-weight: 600;
}

.navbar-nav .nav-link {
    font-weight: 500;
    padding: 0.5rem 1rem !important;
    border-radius: 20px;
    transition: all 0.3s ease;
}

.navbar-nav .nav-link:hover,
.navbar-nav .nav-link.active {
    background-color: rgba(255, 255, 255, 0.2);
    transform: translateY(-1px);
}

/* Hero Section */
.hero-section {
    min-height: 60vh;
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1000 1000"><circle cx="200" cy="200" r="3" fill="rgba(255,255,255,0.1)"/><circle cx="400" cy="100" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="600" cy="300" r="4" fill="rgba(255,255,255,0.1)"/><circle cx="800" cy="150" r="2" fill="rgba(255,255,255,0.1)"/><circle cx="300" cy="400" r="3" fill="rgba(255,255,255,0.1)"/></svg>');
    pointer-events: none;
}

.hero-stats {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 2rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.stat-card h3 {
    color: white;
    margin-bottom: 0.5rem;
}

/* Section Titles */
.section-title {
    font-size: 2rem;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 1rem;
}

/* Cards and Shadows */
.card {
    border: none;
    border-radius: 15px;
    overflow: hidden;
    transition: all 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
}

.shadow-sm {
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1) !important;
}

.shadow {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15) !important;
}

/* Table Styles */
.table {
    border-collapse: separate;
    border-spacing: 0;
}

.table thead th {
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.table tbody tr {
    transition: all 0.3s ease;
}

.table tbody tr:hover {
    background-color: rgba(66, 153, 225, 0.05);
    transform: scale(1.01);
}

.table tbody td {
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1rem;
    vertical-align: middle;
}

/* Rank Badges */
.rank-badge {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
    font-size: 0.9rem;
}

.rank-1 { background: linear-gradient(135deg, #ffd700, #ffed4e); color: #744210; }
.rank-2 { background: linear-gradient(135deg, #c0c0c0, #e2e8f0); color: #4a5568; }
.rank-3 { background: linear-gradient(135deg, #cd7f32, #d69e2e); color: white; }
.rank-other { background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal)); }

/* Progress Bars */
.progress {
    height: 8px;
    border-radius: 10px;
    background-color: rgba(66, 153, 225, 0.1);
    overflow: hidden;
}

.progress-bar {
    background: linear-gradient(90deg, var(--primary-blue), var(--accent-teal));
    border-radius: 10px;
    transition: width 0.8s ease;
}

/* Buttons */
.btn {
    border-radius: 25px;
    font-weight: 500;
    padding: 0.6rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.875rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--dark-blue), var(--primary-blue));
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(44, 82, 130, 0.3);
}

.btn-outline-primary {
    border: 2px solid var(--primary-teal);
    color: var(--primary-teal);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-teal);
    color: white;
    transform: translateY(-2px);
}

.btn-light {
    background: white;
    color: var(--primary-blue);
    box-shadow: 0 4px 15px rgba(255, 255, 255, 0.3);
}

.btn-light:hover {
    background: var(--light-gray);
    transform: translateY(-2px);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.75rem;
}

/* Chat Styles */
.chat-messages {
    max-height: 400px;
    overflow-y: auto;
    padding: 1rem;
    background: linear-gradient(to bottom, #f8f9fa, #ffffff);
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.message {
    display: flex;
    margin-bottom: 1rem;
    animation: slideIn 0.3s ease;
}

.message-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.75rem;
    flex-shrink: 0;
}

.ai-message .message-avatar {
    background: linear-gradient(135deg, var(--primary-blue), var(--accent-teal));
    color: white;
}

.user-message .message-avatar {
    background: linear-gradient(135deg, var(--success), #68d391);
    color: white;
}

.message-content {
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    max-width: 80%;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.ai-message .message-content {
    border-left: 4px solid var(--primary-teal);
}

/* Enhanced AI Response Formatting */
.ai-message .message-content h2,
.ai-message .message-content h3,
.ai-message .message-content h4 {
    color: var(--primary-blue);
    margin-top: 1rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.ai-message .message-content h2 {
    font-size: 1.1rem;
    border-bottom: 2px solid var(--primary-teal);
    padding-bottom: 0.25rem;
}

.ai-message .message-content h3 {
    font-size: 1rem;
}

.ai-message .message-content h4 {
    font-size: 0.95rem;
}

.ai-message .message-content ul {
    padding-left: 1.5rem;
    margin-bottom: 1rem;
}

.ai-message .message-content ul li {
    margin-bottom: 0.25rem;
    line-height: 1.5;
}

.ai-message .message-content hr {
    border: none;
    border-top: 1px solid var(--primary-teal);
    margin: 1rem 0;
    opacity: 0.5;
}

.ai-message .message-content p {
    margin-bottom: 0.75rem;
    line-height: 1.6;
}

.ai-message .message-content strong {
    color: var(--primary-blue);
    font-weight: 600;
}

.ai-message .message-content em {
    color: var(--accent-teal);
    font-style: italic;
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-avatar {
    margin-right: 0;
    margin-left: 0.75rem;
}

.user-message .message-content {
    background: linear-gradient(135deg, var(--primary-teal), var(--accent-teal));
    color: white;
    border-left: none;
    border-right: 4px solid rgba(255, 255, 255, 0.3);
}

/* Loading Animation */
.loading-dots {
    display: inline-block;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s infinite;
}

@keyframes dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Animations */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

.fade-in {
    animation: fadeIn 0.5s ease;
}

/* Input Groups */
.input-group-text {
    border: none;
    background: var(--light-gray);
    color: var(--text-muted);
}

.form-control {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 0.2rem rgba(66, 153, 225, 0.25);
}

/* Search Highlight */
.search-highlight {
    background-color: rgba(255, 235, 59, 0.3);
    border-radius: 3px;
    padding: 2px 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        min-height: 50vh;
        text-align: center;
    }
    
    .section-title {
        font-size: 1.5rem;
    }
    
    .table-responsive {
        font-size: 0.875rem;
    }
    
    .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    .d-flex.gap-3 {
        flex-direction: column;
        gap: 0.5rem !important;
    }
    
    .message-content {
        max-width: 90%;
    }
}

/* Status Indicators */
.status-online {
    color: var(--success);
}

.status-offline {
    color: var(--text-muted);
}

/* Badge Styles */
.badge {
    border-radius: 10px;
    font-weight: 500;
    padding: 0.5em 0.8em;
}

.bg-primary {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal)) !important;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-blue), var(--text-dark)) !important;
}

/* Scrollbar Styling */
.chat-messages::-webkit-scrollbar {
    width: 6px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-teal));
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, var(--dark-blue), var(--primary-blue));
}

/* Submission Forms */
#submissions .card {
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

#submissions .card-header {
    border: none;
    padding: 1.25rem 1.5rem;
    border-radius: 0;
}

#submissions .card-body {
    padding: 2rem;
}

.bg-gradient-success {
    background: linear-gradient(135deg, var(--success), #68d391) !important;
}

.bg-gradient-info {
    background: linear-gradient(135deg, #4299e1, #63b3ed) !important;
}

/* Form styling for submissions */
#submissions .form-control,
#submissions .form-select {
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 10px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background: white;
}

#submissions .form-control:focus,
#submissions .form-select:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 0.2rem rgba(66, 153, 225, 0.25);
    background: white;
}

#submissions .btn {
    border-radius: 25px;
    padding: 0.75rem 2rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: all 0.3s ease;
}

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

/* Submission History Table */
#submissionHistory .table {
    margin-bottom: 0;
}

#submissionHistory .table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-weight: 600;
    color: #495057;
    padding: 1rem;
}

#submissionHistory .table td {
    padding: 1rem;
    vertical-align: middle;
}

#submissionHistory .badge {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 15px;
}

/* Section Navigation Active States */
.navbar-nav .nav-link[href="#submissions"] {
    position: relative;
}

.navbar-nav .nav-link[href="#submissions"]:before {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 2px;
    background: var(--primary-teal);
    transition: width 0.3s ease;
}

.navbar-nav .nav-link[href="#submissions"].active:before {
    width: 80%;
}

/* Alert Notifications */
.alert {
    border: none;
    border-radius: 10px;
    padding: 1rem 1.25rem;
    font-weight: 500;
}

.alert-success {
    background: linear-gradient(135deg, rgba(72, 187, 120, 0.1), rgba(104, 211, 145, 0.1));
    color: var(--success);
    border-left: 4px solid var(--success);
}

.alert-warning {
    background: linear-gradient(135deg, rgba(237, 137, 54, 0.1), rgba(251, 211, 141, 0.1));
    color: var(--warning);
    border-left: 4px solid var(--warning);
}

.alert-danger {
    background: linear-gradient(135deg, rgba(245, 101, 101, 0.1), rgba(252, 165, 165, 0.1));
    color: var(--danger);
    border-left: 4px solid var(--danger);
}

/* Responsive Design for Submissions */
@media (max-width: 768px) {
    #submissions .card-body {
        padding: 1.5rem;
    }
    
    #submissions .btn {
        width: 100%;
        margin-top: 1rem;
    }
    
    #submissionHistory .table-responsive {
        font-size: 0.875rem;
    }
}

/* AI Chat Typing Animation */
.typing-dots {
    display: inline-block;
}

.typing-dots span {
    display: inline-block;
    animation: typing 1.4s infinite ease-in-out;
    opacity: 0;
    margin: 0 1px;
}

.typing-dots span:nth-child(1) {
    animation-delay: 0s;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0;
        transform: translateY(0);
    }
    30% {
        opacity: 1;
        transform: translateY(-10px);
    }
}
