/* IT Franchise Management System - Custom Styles */

:root {
    --primary-color: #2563eb;
    --secondary-color: #64748b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #06b6d4;
    --light-color: #f8fafc;
    --dark-color: #1e293b;
    --gradient-primary: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --gradient-secondary: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
    --border-radius: 0.5rem;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--dark-color);
    padding-top: 76px;
}

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

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

/* Navigation */
.navbar {
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-md);
    transition: all 0.3s ease;
}

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

.nav-link {
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-link:hover {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* Hero Section */
.hero-section {
    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"><polygon fill="%23ffffff08" points="0,1000 1000,0 1000,1000"/></svg>');
    z-index: 1;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* Cards */
.card {
    border: none;
    border-radius: var(--border-radius);
    transition: all 0.3s ease;
    box-shadow: var(--shadow-sm);
}

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

.card-header {
    background: var(--light-color);
    border-bottom: 1px solid #e2e8f0;
    font-weight: 600;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--primary-color);
    box-shadow: 0 4px 14px 0 rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: #1d4ed8;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px 0 rgba(37, 99, 235, 0.4);
}

.btn-success {
    background: var(--success-color);
    box-shadow: 0 4px 14px 0 rgba(16, 185, 129, 0.3);
}

.btn-success:hover {
    background: #059669;
    transform: translateY(-2px);
}

.btn-danger {
    background: var(--danger-color);
    box-shadow: 0 4px 14px 0 rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: #dc2626;
    transform: translateY(-2px);
}

/* Forms */
.form-control {
    border-radius: var(--border-radius);
    border: 2px solid #e2e8f0;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.table thead th {
    background: var(--light-color);
    border: none;
    font-weight: 600;
    color: var(--dark-color);
    padding: 1rem;
}

.table tbody td {
    padding: 1rem;
    border-color: #f1f5f9;
    vertical-align: middle;
}

.table tbody tr:hover {
    background-color: #f8fafc;
}

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

/* Dashboard Styles */
.dashboard-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
    margin-bottom: 1.5rem;
}

.dashboard-card .card-icon {
    font-size: 3rem;
    opacity: 0.8;
}

.stats-card {
    background: white;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    border-left: 4px solid var(--primary-color);
    transition: all 0.3s ease;
}

.stats-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.stats-number {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

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

/* Sidebar */
.sidebar {
    background: white;
    box-shadow: var(--shadow-md);
    border-radius: var(--border-radius);
    padding: 1.5rem;
    height: fit-content;
}

.sidebar .nav-link,
.sidebar .nav-link:link,
.sidebar .nav-link:visited {
    color: var(--dark-color) !important;
    text-decoration: none !important;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active,
.sidebar .nav-link:focus {
    background: var(--primary-color) !important;
    color: white !important;
    text-decoration: none !important;
}

.sidebar .nav-link i {
    width: 20px;
    margin-right: 0.75rem;
    color: inherit !important;
}

.sidebar .sidebar-heading {
    color: var(--secondary-color) !important;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Override Bootstrap nav-link defaults for sidebar */
.sidebar .nav .nav-link {
    color: var(--dark-color) !important;
}

.sidebar .nav .nav-link:hover,
.sidebar .nav .nav-link:focus {
    color: white !important;
}

/* Ensure sidebar text is always visible */
.sidebar * {
    color: inherit;
}

.sidebar .nav-link * {
    color: inherit !important;
}

/* Enhanced Chatbot Styles */
#chatbot-widget {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 1050;
}

#chatbot-toggle {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: var(--primary-color);
    color: white;
    font-size: 20px;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    transition: all 0.3s ease;
    position: relative;
}

#chatbot-toggle:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(0,0,0,0.25);
    background: var(--secondary-color);
}

#chatbot-window {
    position: absolute;
    bottom: 80px;
    right: 0;
    width: 380px;
    height: 550px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease-out;
}

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

.chatbot-message {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.chatbot-message.user {
    align-items: flex-end;
}

.chatbot-message.bot {
    align-items: flex-start;
}

.chatbot-bubble {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 18px;
    word-wrap: break-word;
    line-height: 1.4;
    font-size: 14px;
}

.chatbot-bubble.user {
    background: var(--primary-color);
    color: white;
    border-bottom-right-radius: 6px;
}

.chatbot-bubble.bot {
    background: #f1f3f4;
    color: #333;
    border-bottom-left-radius: 6px;
    border: 1px solid #e0e0e0;
}

.quick-replies-container {
    margin: 10px 0;
}

.quick-reply-btn {
    margin: 2px;
    font-size: 12px;
    padding: 6px 12px;
    border-radius: 15px;
    transition: all 0.2s ease;
}

.quick-reply-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#chatbot-messages {
    height: 420px;
    overflow-y: auto;
    padding: 15px;
    background: #f8f9fa;
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
}

#chatbot-messages::-webkit-scrollbar {
    width: 6px;
}

#chatbot-messages::-webkit-scrollbar-track {
    background: transparent;
}

#chatbot-messages::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

#chatbot-messages::-webkit-scrollbar-thumb:hover {
    background: #999;
}

#chatbot-input {
    border: 1px solid #ddd;
    border-radius: 20px;
    padding: 10px 15px;
    font-size: 14px;
    resize: none;
    min-height: 40px;
    max-height: 100px;
    transition: border-color 0.2s ease;
}

#chatbot-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(var(--primary-color-rgb), 0.25);
}

#chatbot-send {
    border-radius: 50%;
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

#chatbot-typing-indicator {
    display: none;
    font-size: 12px;
    color: #666;
}

.chatbot-notification {
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }
    50% {
    transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    #chatbot-window {
        width: 320px;
        height: 500px;
        right: -10px;
    }
    
    #chatbot-widget {
        right: 10px;
        bottom: 10px;
    }
}

@media (max-width: 480px) {
    #chatbot-window {
        width: 280px;
        height: 450px;
    }
    
    .chatbot-bubble {
        max-width: 90%;
        font-size: 13px;
    }
}

.chat-message {
    margin-bottom: 1rem;
    padding: 0.75rem 1rem;
    border-radius: var(--border-radius);
    max-width: 80%;
}

.chat-message.user {
    background: var(--primary-color);
    color: white;
    margin-left: auto;
    text-align: right;
}

.chat-message.bot {
    background: white;
    color: var(--dark-color);
    box-shadow: var(--shadow-sm);
}

/* Project Status Colors */
.status-submitted { background-color: #3b82f6; }
.status-under_review { background-color: #f59e0b; }
.status-approved { background-color: #10b981; }
.status-rejected { background-color: #ef4444; }
.status-in_progress { background-color: #8b5cf6; }
.status-completed { background-color: #059669; }
.status-cancelled { background-color: #6b7280; }

/* Priority Colors */
.priority-low { color: #10b981; }
.priority-medium { color: #f59e0b; }
.priority-high { color: #ef4444; }
.priority-urgent { color: #dc2626; font-weight: bold; }

/* Wallet Styles */
.wallet-card {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-radius: var(--border-radius);
    padding: 2rem;
}

.wallet-balance {
    font-size: 2.5rem;
    font-weight: 700;
}

.token-package {
    border: 2px solid #e2e8f0;
    border-radius: var(--border-radius);
    padding: 1.5rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.token-package:hover {
    border-color: var(--primary-color);
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.token-package.selected {
    border-color: var(--primary-color);
    background: rgba(37, 99, 235, 0.05);
}

/* SEO Tools */
.seo-score {
    font-size: 3rem;
    font-weight: 700;
}

.seo-score.good { color: var(--success-color); }
.seo-score.average { color: var(--warning-color); }
.seo-score.poor { color: var(--danger-color); }

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .display-4 {
        font-size: 2.5rem;
    }
    
    .stats-number {
        font-size: 2rem;
    }
    
    #chatbot-window {
        width: 300px;
        height: 400px;
    }
    
    .sidebar {
        margin-bottom: 2rem;
    }
}

/* Loading Spinner */
.spinner {
    border: 4px solid #f3f3f3;
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 20px auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

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

.slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

/* Utility Classes */
.text-gradient {
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-custom {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.border-gradient {
    border: 2px solid;
    border-image: var(--gradient-primary) 1;
}

/* Print Styles */
@media print {
    .navbar,
    .sidebar,
    #chatbot-widget,
    .btn {
        display: none !important;
    }
    
    body {
        padding-top: 0;
    }
    
    .card {
        box-shadow: none;
        border: 1px solid #ddd;
    }
}