/* ===== GLOBAL STYLES ===== */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #051A23 0%, #072734 100%);
    min-height: 100vh;
}

/* ===== LOGIN PAGE STYLES ===== */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
}

.login-container {
    width: 100%;
    max-width: 400px;
}

.login-card {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    text-align: center;
    animation: fadeInUp 0.6s ease-out;
}

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

.login-logo {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.login-title {
    font-size: 2rem;
    color: #333;
    margin-bottom: 0.5rem;
    font-weight: 600;
}

.login-subtitle {
    color: #666;
    margin-bottom: 2rem;
}

.login-form {
    text-align: left;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #555;
}

.form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e1e5e9;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.checkbox-group {
    display: flex;
    align-items: center;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: auto;
    margin-right: 0.5rem;
}

.checkbox-label {
    display: flex;
    align-items: center;
    cursor: pointer;
    user-select: none;
}

.checkbox-label input[type="checkbox"] {
    margin-right: 0.75rem;
    width: auto;
    cursor: pointer;
}

.checkbox-text {
    font-weight: 500;
    color: #2c3e50;
}

.admin-only-badge {
    display: inline-block;
    background: #e74c3c;
    color: white;
    font-size: 0.7rem;
    font-weight: 600;
    padding: 2px 6px;
    border-radius: 4px;
    margin-left: 8px;
    vertical-align: middle;
}

.login-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #051A23 0%, #072734 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.login-btn:active {
    transform: translateY(0);
}

.login-footer {
    margin-top: 2rem;
    text-align: center;
    color: #666;
    font-size: 0.9rem;
}

.version-info {
    margin-top: 1rem;
    font-size: 0.8rem;
    color: #999;
}

/* ===== DASHBOARD PAGE STYLES ===== */
.dashboard-page {
    background: linear-gradient(135deg, #051A23 0%, #072734 100%);
    min-height: 100vh;
    padding: 20px;
}

.dashboard-container {
    max-width: 1400px;
    margin: 0 auto;
}

.dashboard-header {
    background: linear-gradient(135deg, #051923 0%, #072E3F 100%);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-title h1 {
    color: white;
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.header-logo {
    height: 50px;
    width: auto;
    object-fit: contain;
}

.header-subtitle {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.1rem;
}

.header-nav {
    display: flex;
    gap: 10px;
}

.header-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease, transform 0.2s ease;
    cursor: pointer;
}

.header-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

.user-info {
    background: rgba(255, 255, 255, 0.15);
    pointer-events: none;
}

.logout-btn {
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* ===== NAVIGATION TABS ===== */
.navigation-tabs {
    background: #e2e8f0;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.nav-tabs {
    display: flex;
    gap: 5px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-tabs::-webkit-scrollbar {
    display: none;
}

.nav-tab {
    background: #cbd5e0;
    color: #4a5568;
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

.nav-tab:hover {
    background: #b1bdc9;
    color: #2d3748;
}

.nav-tab.active {
    background: #08A0C3;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(8, 160, 195, 0.3);
}

.tool-count {
    background: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.9);
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-left: 8px;
    display: inline-block;
}

.nav-tab:not(.active) .tool-count {
    background: rgba(102, 126, 234, 0.15);
    color: #667eea;
}

.tool-count:empty {
    display: none;
}

/* ===== MAIN CONTENT ===== */
.main-content {
    display: grid;
    gap: 40px;
}

.tools-section {
    background: #e2e8f0;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.section-title {
    font-size: 1.8rem;
    font-weight: 600;
    color: #2d3748;
}

.knowledge-hub-section .section-title {
    color: white;
}

.add-tool-btn {
    background: linear-gradient(135deg, #051A23 0%, #072734 100%);
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.add-tool-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

/* ===== TOOLS GRID ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 20px;
}

.tool-card {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 15px;
    padding: 0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 280px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
}

.tool-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(135deg, #051A23 0%, #072734 100%);
}

.tool-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0;
    gap: 15px;
    padding: 20px 20px 15px 20px;
    border-radius: 15px 15px 0 0;
}

.tool-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.3rem;
    font-weight: 600;
    color: #2d3748;
    flex: 1;
    min-width: 0;
}

.tool-icon {
    font-size: 1.5rem;
}

.tool-actions {
    display: flex;
    gap: 5px;
    flex-shrink: 0;
}

.tool-action-btn {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #64748b;
    border: none;
    border-radius: 8px;
    padding: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.tool-action-btn:hover {
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Action buttons uniform styling (not affected by categories) */
.tool-action-btn {
    background: #e2e8f0 !important;
    color: #4a5568 !important;
    border: none;
    border-radius: 8px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.tool-action-btn:hover {
    background: #cbd5e0 !important;
    transform: scale(1.05) translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===== CUSTOM TOOLTIPS ===== */
.tool-action-btn {
    position: relative;
}

.tool-action-btn::after {
    content: attr(title);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 6px 8px;
    border-radius: 4px;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    margin-top: 5px;
    z-index: 1000;
}

.tool-action-btn::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 4px solid transparent;
    border-bottom-color: #333;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    pointer-events: none;
    margin-top: 1px;
    z-index: 1000;
}

.tool-action-btn:hover::after,
.tool-action-btn:hover::before {
    opacity: 1;
    visibility: visible;
}

.tool-description {
    color: #4a5568;
    margin-bottom: 15px;
    font-size: 0.95rem;
    padding: 0 20px;
}

.tool-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #718096;
    margin-top: auto;
    padding: 0 20px;
}

.tool-status {
    display: flex;
    align-items: center;
    gap: 5px;
}

.status-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #28a745;
}

.status-indicator.incomplete {
    background: #ffc107;
}

.tool-buttons {
    display: flex;
    gap: 10px;
    margin-top: 0;
    padding: 0 20px 20px 20px;
}

.tool-btn {
    flex: 1;
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.tool-btn.primary {
    background: #667eea;
    color: white;
}

.tool-btn.primary:hover {
    background: #5a6fd8;
    transform: translateY(-1px);
}

.tool-btn.secondary {
    background: #6c757d;
    color: white;
}

.tool-btn.secondary:hover {
    background: #5a6268;
}

/* ===== CATEGORY-SPECIFIC OPEN TOOL BUTTONS ===== */

/* SEO Category - Green */
.tool-card[data-category="seo"] .tool-header {
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
}
.tool-card[data-category="seo"] .tool-btn.primary {
    background: #10B981 !important;
    border: none !important;
}
.tool-card[data-category="seo"] .tool-btn.primary:hover {
    background: #059669 !important;
}

/* PBN Category - Blue */
.tool-card[data-category="pbn"] .tool-header {
    background: linear-gradient(135deg, #eff6ff 0%, #dbeafe 100%);
}
.tool-card[data-category="pbn"] .tool-btn.primary {
    background: #3B82F6 !important;
    border: none !important;
}
.tool-card[data-category="pbn"] .tool-btn.primary:hover {
    background: #1E40AF !important;
}

/* Operations Category - Orange */
.tool-card[data-category="operations"] .tool-header {
    background: linear-gradient(135deg, #fffbeb 0%, #fef3c7 100%);
}
.tool-card[data-category="operations"] .tool-btn.primary {
    background: #F59E0B !important;
    border: none !important;
}
.tool-card[data-category="operations"] .tool-btn.primary:hover {
    background: #D97706 !important;
}

/* Sales Category - Red */
.tool-card[data-category="sales"] .tool-header {
    background: linear-gradient(135deg, #fef2f2 0%, #fecaca 100%);
}
.tool-card[data-category="sales"] .tool-btn.primary {
    background: #EF4444 !important;
    border: none !important;
}
.tool-card[data-category="sales"] .tool-btn.primary:hover {
    background: #DC2626 !important;
}

/* Finance Category - Purple */
.tool-card[data-category="finance"] .tool-header {
    background: linear-gradient(135deg, #faf5ff 0%, #e9d5ff 100%);
}
.tool-card[data-category="finance"] .tool-btn.primary {
    background: #8B5CF6 !important;
    border: none !important;
}
.tool-card[data-category="finance"] .tool-btn.primary:hover {
    background: #7C3AED !important;
}

/* Tech Category - Cyan */
.tool-card[data-category="tech"] .tool-header {
    background: linear-gradient(135deg, #ecfeff 0%, #a5f3fc 100%);
}
.tool-card[data-category="tech"] .tool-btn.primary {
    background: #06B6D4 !important;
    border: none !important;
}
.tool-card[data-category="tech"] .tool-btn.primary:hover {
    background: #0891B2 !important;
}

/* HR Category - Orange-Red */
.tool-card[data-category="hr"] .tool-header {
    background: linear-gradient(135deg, #fff7ed 0%, #fed7aa 100%);
}
.tool-card[data-category="hr"] .tool-btn.primary {
    background: #F97316 !important;
    border: none !important;
}
.tool-card[data-category="hr"] .tool-btn.primary:hover {
    background: #EA580C !important;
}

/* Social Category - Teal */
.tool-card[data-category="social"] .tool-header {
    background: linear-gradient(135deg, #f0fdfa 0%, #a7f3d0 100%);
}
.tool-card[data-category="social"] .tool-btn.primary {
    background: #14B8A6 !important;
    border: none !important;
}
.tool-card[data-category="social"] .tool-btn.primary:hover {
    background: #0D9488 !important;
}

/* Management Category - Gray */
.tool-card[data-category="management"] .tool-header {
    background: linear-gradient(135deg, #f9fafb 0%, #e5e7eb 100%);
}
.tool-card[data-category="management"] .tool-btn.primary {
    background: #6B7280 !important;
    border: none !important;
}
.tool-card[data-category="management"] .tool-btn.primary:hover {
    background: #4B5563 !important;
}

/* ===== EMPTY STATE ===== */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-icon {
    font-size: 4rem;
    margin-bottom: 20px;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: #333;
}

.empty-state p {
    margin-bottom: 20px;
    color: #666;
}

/* ===== MANAGEMENT SECTION ===== */
.management-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.management-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
}

.management-card {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.management-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.management-card h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.2rem;
}

.management-card p {
    color: #666;
    margin-bottom: 20px;
    font-size: 0.9rem;
}

.management-btn {
    background: linear-gradient(135deg, #051A23 0%, #072734 100%);
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: transform 0.2s ease;
}

.management-btn:hover {
    transform: translateY(-2px);
}

.backup-buttons {
    display: flex;
    gap: 10px;
}

.backup-buttons .management-btn {
    flex: 1;
}

/* ===== DRIVE BROWSER ===== */
.drive-browser-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
}

.drive-browser-card h3 {
    margin-bottom: 10px;
    color: #333;
    font-size: 1.5rem;
}

.drive-browser-card p {
    color: #666;
    margin-bottom: 20px;
}

.drive-browser-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.drive-tab {
    background: #f8f9fa;
    color: #666;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drive-tab:hover {
    background: #e9ecef;
}

.drive-tab.active {
    background: #667eea;
    color: white;
}

.drive-not-configured {
    text-align: center;
    padding: 40px;
    color: #666;
}

.drive-not-configured h4 {
    margin-bottom: 10px;
    color: #333;
}

.configure-drive-btn {
    background: #667eea;
    color: white;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    display: inline-block;
    margin-top: 15px;
    transition: background 0.3s ease;
}

.configure-drive-btn:hover {
    background: #5a6fd8;
}

/* ===== QUICK LINKS ===== */
.quick-links-section {
    background: #e2e8f0;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 40px;
}

.quick-links-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.quick-links-header h3 {
    color: #2d3748;
    font-size: 1.5rem;
}

.quick-links-info {
    color: #4a5568;
    font-size: 0.9rem;
}

.quick-links-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.quick-link-item {
    background: #cbd5e0;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease;
}

.quick-link-item:hover {
    transform: translateY(-3px);
}

.quick-link {
    display: flex;
    align-items: center;
    padding: 15px;
    text-decoration: none;
    color: #2d3748;
    transition: background 0.3s ease;
}

.quick-link:hover {
    background: #a0aec0;
}

.quick-link-icon {
    font-size: 1.2rem;
    margin-right: 10px;
}

.quick-link-text {
    font-weight: 500;
}

/* ===== ADMIN PAGE STYLES ===== */
.admin-page {
    background: linear-gradient(135deg, #051A23 0%, #072734 100%);
    min-height: 100vh;
    padding: 20px;
}

.admin-container {
    max-width: 1200px;
    margin: 0 auto;
}

.admin-header {
    background: linear-gradient(135deg, #051923 0%, #072E3F 100%);
    border-radius: 15px;
    padding: 20px 30px;
    margin-bottom: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.admin-header .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.admin-header h1 {
    color: white;
    font-size: 2.2rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 15px;
}

.admin-content {
    display: grid;
    gap: 30px;
}

.admin-section {
    background: #e2e8f0;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.admin-section h2 {
    color: #2d3748;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 600;
}

/* ===== ADMIN TABS ===== */
.admin-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 30px;
}

.admin-tab {
    background: #cbd5e0;
    color: #4a5568;
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.admin-tab:hover {
    background: #a0aec0;
}

.admin-tab.active {
    background: #667eea;
    color: white;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

/* ===== FORMS ===== */
.tool-form {
    max-width: 800px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 0.9rem;
}

.form-section {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-section h3 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2rem;
}

.form-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 10px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: linear-gradient(135deg, #051A23 0%, #072734 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

.btn-secondary:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

.btn-danger {
    background: #dc3545;
    color: white;
}

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

/* ===== DRIVE CONFIGURATION ===== */
.drive-config {
    max-width: 800px;
}

.drive-status-card {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.status-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.status-badge {
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 500;
}

.status-badge.success {
    background: #d4edda;
    color: #155724;
}

.status-badge.error {
    background: #f8d7da;
    color: #721c24;
}

.drive-config-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 20px;
}

.drive-tab {
    background: #f8f9fa;
    color: #666;
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.drive-tab:hover {
    background: #e9ecef;
}

.drive-tab.active {
    background: #667eea;
    color: white;
}

.drive-tab-content {
    display: none;
}

.drive-tab-content.active {
    display: block;
}

.setup-instructions {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.setup-instructions h3 {
    margin-bottom: 15px;
    color: #333;
}

.setup-instructions ol {
    padding-left: 20px;
}

.setup-instructions li {
    margin-bottom: 10px;
    color: #555;
}

.setup-instructions a {
    color: #667eea;
    text-decoration: none;
}

.setup-instructions a:hover {
    text-decoration: underline;
}

/* ===== MANAGED FOLDERS ===== */
.managed-folders {
    margin-top: 30px;
}

.managed-folders h3 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.3rem;
}

.folder-actions {
    margin-bottom: 20px;
}

.folders-list {
    display: grid;
    gap: 15px;
}

.folder-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.folder-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.folder-info {
    flex: 1;
}

.folder-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.folder-id {
    color: #666;
    font-size: 0.9rem;
}

.folder-actions {
    display: flex;
    gap: 10px;
}

.folder-action-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.folder-action-btn.edit {
    background: #ffc107;
    color: #212529;
}

.folder-action-btn.delete {
    background: #dc3545;
    color: white;
}

.folder-action-btn:hover {
    transform: translateY(-1px);
}

/* ===== KNOWLEDGE HUB CONFIGURATION ===== */
.knowledge-hub-config {
    max-width: 800px;
}

.knowledge-hub-config .config-description {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
}

.knowledge-hub-config .config-description p {
    color: #666;
    line-height: 1.6;
    margin: 0;
}

.knowledge-hub-folders {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
}

.knowledge-hub-folders h3 {
    color: #333;
    margin-bottom: 15px;
}

.knowledge-hub-folders .folder-actions {
    margin-bottom: 20px;
}

.knowledge-hub-folders .folders-list {
    display: grid;
    gap: 10px;
}

.knowledge-hub-folders .folder-item {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.knowledge-hub-folders .folder-item:hover {
    border-color: #667eea;
    transform: translateY(-1px);
}

.knowledge-hub-folders .folder-info {
    display: flex;
    flex-direction: column;
}

.knowledge-hub-folders .folder-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.knowledge-hub-folders .folder-id {
    font-size: 0.9rem;
    color: #666;
    font-family: monospace;
}

.knowledge-hub-folders .folder-actions {
    display: flex;
    gap: 10px;
}

.knowledge-hub-folders .folder-action-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.knowledge-hub-folders .folder-action-btn:hover {
    background: #5a67d8;
    transform: translateY(-1px);
}

.knowledge-hub-folders .folder-action-btn.delete {
    background: #e53e3e;
}

.knowledge-hub-folders .folder-action-btn.delete:hover {
    background: #c53030;
}

.knowledge-hub-folders .empty-state {
    text-align: center;
    padding: 40px;
    color: #666;
}

.knowledge-hub-folders .empty-state p {
    margin-bottom: 10px;
}

/* ===== TOOLS MANAGEMENT ===== */
.tools-management {
    max-width: 1000px;
}

.tools-filter {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}

.tools-filter input,
.tools-filter select {
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    font-size: 1rem;
}

.tools-filter input {
    flex: 1;
}

.tools-list {
    display: grid;
    gap: 15px;
}

.tool-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 20px;
    transition: all 0.3s ease;
}

.tool-item:hover {
    border-color: #667eea;
    transform: translateY(-2px);
}

.tool-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 10px;
}

.tool-item-title {
    font-weight: 600;
    color: #333;
    font-size: 1.1rem;
}

.tool-item-category {
    background: #667eea;
    color: white;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
}

.tool-item-description {
    color: #666;
    margin-bottom: 15px;
}

.tool-item-actions {
    display: flex;
    gap: 10px;
}

.tool-item-btn {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.tool-item-btn.edit {
    background: #ffc107;
    color: #212529;
}

.tool-item-btn.delete {
    background: #dc3545;
    color: white;
}

.tool-item-btn.preview {
    background: #17a2b8;
    color: white;
}

.tool-item-btn:hover {
    transform: translateY(-1px);
}

/* ===== MODALS ===== */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.modal-content {
    background: white;
    border-radius: 15px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    animation: slideIn 0.3s ease;
}

.modal-content.large {
    max-width: 90%;
    max-height: 90vh;
}
.modal-content.tool-large {
    width: 80vw;
    height: 80vh;
    max-width: 80vw;
    max-height: 80vh;
}
.modal-content.tool-large .modal-body {
    padding: 20px;
    height: calc(100% - 70px); /* Account for header */
    overflow: hidden;
}

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

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px;
    border-bottom: 1px solid #e9ecef;
}

.modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.3rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: #333;
}

.modal-body {
    padding: 30px;
    overflow-y: auto;
    max-height: 60vh;
}

/* Enhanced scrolling for contract generator modal */
.modal-content.tool-large .modal-body {
    max-height: calc(80vh - 70px); /* Account for header in large modals */
    overflow-y: auto;
}

/* Specific styling for contract generator content */
.contract-generator {
    max-height: none; /* Remove any height restrictions */
}

.contract-generator .modal-body {
    padding: 0; /* Remove padding for full width usage */
}

/* ===== LOADING STATES ===== */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.9);
    z-index: 2000;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.loading-overlay.active {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

.loading-text {
    margin-top: 20px;
    color: #666;
    font-size: 1.1rem;
}

.loading-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #666;
    font-size: 0.9rem;
}

.loading-indicator .loading-spinner {
    width: 20px;
    height: 20px;
    border-width: 2px;
}

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 768px) {
    .dashboard-page,
    .admin-page {
        padding: 10px;
    }
    
    .header-content {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-title h1 {
        font-size: 2rem;
    }
    
    .header-nav {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .nav-tabs {
        flex-wrap: wrap;
        gap: 10px;
    }
    
    .tools-grid {
        grid-template-columns: 1fr;
    }
    
    .management-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .drive-status-card {
        grid-template-columns: 1fr;
    }
    
    .tools-filter {
        flex-direction: column;
    }
    
    .modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .modal-body {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 30px 20px;
    }
    
    .header-title h1 {
        font-size: 1.8rem;
    }
    
    .nav-tab {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    
    .tool-buttons {
        flex-direction: column;
    }
    
    .quick-links-grid {
        grid-template-columns: 1fr;
    }
}

/* ===== UTILITY CLASSES ===== */
.text-center {
    text-align: center;
}

.text-muted {
    color: #666;
}

.mb-20 {
    margin-bottom: 20px;
}

.mt-20 {
    margin-top: 20px;
}

.hidden {
    display: none;
}

.visible {
    display: block;
}

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

.slide-up {
    animation: slideUp 0.5s ease;
}

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

/* ===== IFRAME STYLES ===== */
.tool-iframe {
    width: 100%;
    height: 500px;
    border: none;
    border-radius: 10px;
    background: #f8f9fa;
}

.tool-iframe.fullscreen {
    height: 80vh;
}
.tool-iframe.tool-fullscreen {
    height: calc(80vh - 80px); /* Account for modal header */
    width: 100%;
    border: none;
    border-radius: 0; /* Remove border radius for full modal coverage */
    margin: 0;
    padding: 0;
    /* Scrolling is handled by HTML attributes */
}

/* Ensure modal body allows iframe scrolling */
.modal-content.tool-large .modal-body {
    padding: 0; /* Remove ALL padding for full coverage */
    height: calc(100% - 70px); /* Account for header */
    overflow: hidden; /* Prevent scrollbars on modal body */
    display: flex; /* Make iframe fill container */
    flex-direction: column;
}

/* Ensure all iframes in modals can scroll and fill completely */
.modal-body iframe {
    flex: 1;
    min-height: 0; /* Allow iframe to shrink if needed */
    border: none; /* Remove any borders */
    border-radius: 0; /* Remove border radius for full coverage */
    margin: 0; /* Remove any margins */
}

/* ===== DRIVE BROWSER STYLES ===== */
.drive-content {
    padding: 20px;
    text-align: center;
}

.drive-content h4 {
    margin-bottom: 15px;
    color: #333;
    font-size: 1.3rem;
}

.drive-content p {
    margin-bottom: 20px;
    color: #666;
}

.folder-links {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.folder-link {
    display: flex;
    align-items: center;
    padding: 15px;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
}

.folder-link:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
}

.folder-icon {
    font-size: 1.5rem;
    margin-right: 10px;
}

.folder-name {
    font-weight: 500;
}

.folder-info {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 15px;
    margin-top: 20px;
    text-align: left;
}

.folder-info p {
    margin-bottom: 10px;
    color: #555;
    font-size: 0.9rem;
}

.folder-info strong {
    color: #333;
}

/* ===== NOTIFICATION STYLES ===== */
.notification {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 15px 20px;
    border-radius: 10px;
    color: white;
    font-weight: 500;
    z-index: 1500;
    animation: slideInRight 0.3s ease;
}

.notification.success {
    background: #28a745;
}

.notification.error {
    background: #dc3545;
}

.notification.warning {
    background: #ffc107;
    color: #212529;
}

.notification.info {
    background: #17a2b8;
}

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

/* ===== INSTRUCTIONS POPUP ===== */
.instructions-popup {
    position: absolute;
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1001;
    max-width: 350px;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.2s ease;
}

.instructions-popup.show {
    opacity: 1;
    transform: translateY(0);
}

.instructions-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
    border-radius: 8px 8px 0 0;
}

.instructions-popup-header h4 {
    margin: 0;
    color: #333;
    font-size: 1rem;
    font-weight: 600;
}

.instructions-close {
    background: none;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: all 0.2s ease;
}

.instructions-close:hover {
    background: #e9ecef;
    color: #333;
}

.instructions-popup-content {
    padding: 15px 20px;
    color: #555;
    font-size: 0.9rem;
    line-height: 1.7;
    max-height: 400px;
    overflow-y: auto;
}

.instructions-popup-content p {
    margin: 0 0 12px 0;
    line-height: 1.6;
}

.instructions-popup-content p:last-child {
    margin-bottom: 0;
}

.instructions-popup-content strong {
    color: #333;
    font-weight: 600;
}

.instructions-popup-content em {
    font-style: italic;
    color: #444;
}

.instructions-popup-content ul {
    margin: 12px 0;
    padding-left: 20px;
}

.instructions-popup-content li {
    margin: 6px 0;
    line-height: 1.5;
}

.instructions-popup-content h1,
.instructions-popup-content h2,
.instructions-popup-content h3,
.instructions-popup-content h4 {
    color: #333;
    margin: 16px 0 8px 0;
    font-weight: 600;
}

.instructions-popup-content h1 { font-size: 1.2rem; }
.instructions-popup-content h2 { font-size: 1.1rem; }
.instructions-popup-content h3 { font-size: 1.05rem; }
.instructions-popup-content h4 { font-size: 1rem; }

.instructions-popup-content::-webkit-scrollbar {
    width: 6px;
}

.instructions-popup-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.instructions-popup-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.instructions-popup-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* ===== DRIVE FILES GRID ===== */
.drive-folder-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.drive-folder-header h4 {
    margin: 0;
    color: #333;
    font-size: 1.4rem;
    font-weight: 600;
}

.drive-folder-actions {
    display: flex;
    gap: 10px;
}

.drive-action-btn {
    background: #f8f9fa;
    color: #666;
    padding: 8px 16px;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drive-action-btn:hover {
    background: #e9ecef;
    border-color: #667eea;
    color: #667eea;
    transform: translateY(-1px);
}

.drive-files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.drive-file-item {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 10px;
    padding: 15px;
    display: flex;
    align-items: flex-start;
    gap: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 80px;
}

.drive-file-item:hover {
    background: #e9ecef;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.drive-file-icon {
    font-size: 2rem;
    min-width: 40px;
    text-align: center;
}

.drive-file-info {
    flex: 1;
    min-width: 0;
}

.drive-file-name {
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    font-size: 1rem;
    line-height: 1.3;
    word-wrap: break-word;
    overflow-wrap: break-word;
    hyphens: auto;
}

.drive-file-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #666;
}

.drive-file-size,
.drive-file-date {
    white-space: nowrap;
}

.error-message {
    text-align: center;
    padding: 40px 20px;
    color: #dc3545;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 10px;
    margin: 20px 0;
}

.error-message p {
    margin-bottom: 15px;
    color: #721c24;
    font-weight: 500;
}

/* ===== ACCESSIBILITY ===== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles */
button:focus,
input:focus,
select:focus,
textarea:focus,
a:focus {
    outline: 2px solid #667eea;
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .tool-card,
    .management-card,
    .folder-item,
    .tool-item {
        border-width: 3px;
    }
}

/* 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;
    }
}

/* ===== KNOWLEDGE HUB STYLES ===== */
.knowledge-hub-browser {
    height: 600px;
    display: flex;
    flex-direction: column;
}

.knowledge-hub-tabs {
    display: flex;
    align-items: center;
    gap: 15px !important;
    margin-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
    padding-bottom: 10px;
}

.knowledge-hub-tab {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 8px 16px;
    margin-right: 15px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.knowledge-hub-tab:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.knowledge-hub-tab.active {
    background: #007bff;
    color: white;
    border-color: #007bff;
}

.knowledge-hub-content {
    flex: 1;
    overflow-y: auto;
}

.knowledge-hub-files {
    display: grid;
    gap: 15px;
}

.knowledge-hub-file-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.knowledge-hub-file-item:hover {
    background: #e9ecef;
    border-color: #adb5bd;
    transform: translateY(-2px);
}

.knowledge-hub-file-item .file-icon {
    font-size: 1.5rem;
    min-width: 40px;
    text-align: center;
}

.knowledge-hub-file-item .file-info {
    flex: 1;
}

.knowledge-hub-file-item .file-name {
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 5px;
}

.knowledge-hub-file-item .file-meta {
    display: flex;
    gap: 15px;
    font-size: 0.85rem;
    color: #6c757d;
    flex-wrap: wrap;
}

.knowledge-hub-file-item .file-folder {
    background: #667eea;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.knowledge-hub-file-item .item-type {
    background: #28a745;
    color: white;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 0.8rem;
    font-weight: 500;
}

.knowledge-hub-file-item.folder-item {
    cursor: pointer;
    background: #f8f9fa;
}

.knowledge-hub-file-item.folder-item:hover {
    background: #e9ecef;
    border-color: #28a745;
}

.knowledge-hub-file-item .folder-btn {
    background: #28a745;
}

.knowledge-hub-file-item .folder-btn:hover {
    background: #218838;
}

.knowledge-hub-file-item .file-actions {
    display: flex;
    gap: 5px;
}

.knowledge-hub-file-item .file-action-btn {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 6px 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
}

.knowledge-hub-file-item .file-action-btn:hover {
    background: #0056b3;
    transform: scale(1.1);
}

.knowledge-hub-files .empty-state,
.knowledge-hub-files .error-state {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    font-style: italic;
}

.knowledge-hub-files .error-state {
    color: #dc3545;
}

.knowledge-hub-files .loading-indicator {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.knowledge-hub-files .loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

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

/* Knowledge Hub Breadcrumb */
.knowledge-hub-breadcrumb, .drive-breadcrumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    padding: 5px 12px;
    margin-bottom: 10px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.breadcrumb-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 3px;
}

.breadcrumb-item {
    background: rgba(255, 255, 255, 0.2);
    color: #333;
    border: none;
    padding: 3px 6px;
    border-radius: 3px;
    font-size: 0.85rem;
    transition: all 0.3s ease;
}

.breadcrumb-item.clickable {
    cursor: pointer;
    color: #d73527;
}

.breadcrumb-item.clickable:hover {
    background: rgba(255, 255, 255, 0.3);
    color: #b52d20;
}

.breadcrumb-item.current {
    background: rgba(255, 255, 255, 0.3);
    font-weight: 500;
    color: #333;
}

.breadcrumb-separator {
    color: #666;
    margin: 0 3px;
    font-size: 0.8rem;
}

.breadcrumb-current {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.9rem;
}

/* Tech App File Upload Styles */
.upload-options {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    justify-content: center;
}

.upload-option-btn {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.upload-option-btn:hover {
    background: rgba(0, 0, 0, 0.8);
    border-color: rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    color: #fff;
}

.upload-option-btn:active {
    transform: translateY(0);
}

.file-upload-area {
    border: 2px dashed rgba(255, 255, 255, 0.3);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.05);
    position: relative;
}

.file-upload-area:hover {
    border-color: rgba(255, 255, 255, 0.5);
    background: rgba(255, 255, 255, 0.1);
}

.file-upload-area input[type="file"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.upload-placeholder {
    pointer-events: none;
}

.upload-icon {
    font-size: 2rem;
    margin-bottom: 10px;
}

.upload-placeholder p {
    color: #333;
    margin: 10px 0 5px;
    font-size: 1rem;
}

.upload-placeholder small {
    color: #666;
    font-size: 0.85rem;
}

.uploaded-files-list {
    margin-top: 15px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.05);
    padding: 8px;
    min-height: 40px;
}

.uploaded-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    margin-bottom: 5px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 1;
    visibility: visible;
}

.uploaded-file-info {
    display: flex;
    align-items: center;
    flex-grow: 1;
}

.uploaded-file-icon {
    margin-right: 8px;
    font-size: 1.2rem;
}

.uploaded-file-name {
    color: #333;
    font-size: 0.9rem;
}

.uploaded-file-size {
    color: #666;
    font-size: 0.8rem;
    margin-left: 10px;
}

.uploaded-file-remove {
    background: rgba(255, 0, 0, 0.2);
    border: 1px solid rgba(255, 0, 0, 0.4);
    color: #ff6b6b;
    padding: 4px 8px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.8rem;
    transition: all 0.3s ease;
}

.uploaded-file-remove:hover {
    background: rgba(255, 0, 0, 0.3);
    border-color: rgba(255, 0, 0, 0.6);
}

/* ===== PYTHON SCRIPT STYLES ===== */
.python-file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 16px;
    background: rgba(52, 168, 83, 0.1);
    border: 1px solid rgba(52, 168, 83, 0.3);
    border-radius: 8px;
    margin-bottom: 10px;
}

.python-file-item .file-icon {
    font-size: 1.5rem;
    margin-right: 12px;
}

.python-file-item .file-details {
    flex-grow: 1;
}

.python-file-item .file-name {
    color: #333;
    font-weight: 600;
    font-size: 0.95rem;
    margin-bottom: 2px;
}

.python-file-item .file-size {
    color: #666;
    font-size: 0.8rem;
}

.python-file-item .remove-btn {
    background: rgba(255, 87, 34, 0.2);
    border: 1px solid rgba(255, 87, 34, 0.4);
    color: #ff5722;
    padding: 6px 10px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: bold;
    transition: all 0.3s ease;
}

.python-file-item .remove-btn:hover {
    background: rgba(255, 87, 34, 0.3);
    border-color: rgba(255, 87, 34, 0.6);
}

.script-preview {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 6px;
    padding: 15px;
    margin-top: 10px;
}

.script-preview h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 0.95rem;
}

.script-preview ul {
    list-style: none;
    padding: 0;
}

.script-preview li {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.1);
    padding: 8px 12px;
    margin-bottom: 5px;
    border-radius: 4px;
    color: #333;
    font-size: 0.9rem;
}

.info-message {
    text-align: center;
    padding: 20px;
}

.info-message p {
    color: #666;
    font-size: 0.9rem;
    margin: 0;
}

/* Python Tool Execution Modal */
.python-modal {
    background: rgba(0, 0, 0, 0.8);
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.python-modal-content {
    background: white;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80%;
    overflow-y: auto;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

.python-modal-header {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    padding: 20px;
    border-radius: 12px 12px 0 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.python-modal-header h3 {
    margin: 0;
    font-size: 1.3rem;
}

.python-modal-close {
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 5px;
    border-radius: 4px;
    transition: background 0.3s ease;
}

.python-modal-close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.python-modal-body {
    padding: 20px;
}

.python-input-form .form-group {
    margin-bottom: 20px;
}

.python-input-form label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.python-input-form input,
.python-input-form select {
    width: 100%;
    padding: 10px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.python-input-form input:focus,
.python-input-form select:focus {
    outline: none;
    border-color: #4CAF50;
}

.python-execution-status {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin: 15px 0;
    text-align: center;
}

.python-execution-status.loading {
    border-color: #007bff;
    background: #e3f2fd;
}

.python-execution-status.success {
    border-color: #28a745;
    background: #d4edda;
}

.python-execution-status.error {
    border-color: #dc3545;
    background: #f8d7da;
}

.python-results {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    max-height: 300px;
    overflow-y: auto;
}

.python-output {
    font-family: 'Courier New', monospace;
    white-space: pre-wrap;
    font-size: 0.9rem;
    line-height: 1.4;
}

.python-modal-actions {
    padding: 20px;
    border-top: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.python-run-btn {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.python-run-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(76, 175, 80, 0.3);
}

.python-run-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.python-copy-btn {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.python-copy-btn:hover {
    background: #0056b3;
}

/* Python Tool Container */
.python-tool-container {
    padding: 20px;
    max-height: calc(80vh - 100px);
    overflow-y: auto;
}

.python-tool-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 2px solid #e9ecef;
}

.python-tool-header h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 1.4rem;
}

.python-tool-header p {
    color: #666;
    margin: 0 0 15px 0;
    font-size: 1rem;
}

.tool-instructions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 15px;
    margin-top: 15px;
    color: #333;
    font-size: 0.95rem;
    line-height: 1.5;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.results-header h5 {
    margin: 0;
    color: #333;
    font-size: 1.1rem;
}

.results-actions {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid #e9ecef;
    text-align: center;
}

/* Spinner for Python execution */
.python-spinner .spinner {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 10px auto;
}

/* Python tool card styling */
.tool-card.python-script {
    border-left: 4px solid #4CAF50;
}

.tool-card.python-script .tool-icon {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

/* Responsive adjustments for Python modals */
@media (max-width: 768px) {
    .python-tool-container {
        padding: 15px;
        max-height: calc(90vh - 80px);
    }
    
    .python-modal-actions {
        flex-direction: column;
        gap: 10px;
    }
    
    .python-run-btn {
        width: 100%;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}