html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

/* Custom Font */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: #2d3748;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: #f8fafc;
}

/* Updated Color Variables - Better Contrast */
:root {
    --primary-color: #3b82f6;
    --primary-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    --blue-gradient: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
    --dark-blue-gradient: linear-gradient(135deg, #1e3a8a 0%, #3730a3 100%);
    --hero-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 100%); /* Different purple gradient for hero */
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-color: #1f2937;
    --navbar-dark: #374151; /* Single solid color for navbar */
    --light-bg: #f8fafc;
    --border-color: #e5e7eb;
    --ad-bg: #f1f5f9;
    --sidebar-bg: #ffffff;
    --card-bg: #ffffff;
}

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: var(--blue-gradient) !important;
}

/* Navbar specific solid background override - NO GRADIENTS */
.navbar.bg-gradient-primary {
    background: var(--navbar-dark) !important;
    background-image: none !important; /* Ensure no gradient images */
}

.bg-gradient-light {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
}

/* Typography */
.display-4 {
    font-weight: 700;
    background: var(--blue-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.lead {
    font-weight: 400;
    color: #64748b;
}

/* Navigation - Significantly Reduced Height */
.navbar {
    padding-top: 0.125rem !important;
    padding-bottom: 0.125rem !important;
    min-height: 40px; /* Further reduced from 48px */
}

.navbar-brand {
    font-size: 1.1rem; /* Further reduced from 1.25rem */
    letter-spacing: -0.5px;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    line-height: 1.2;
}

.navbar-nav .nav-link {
    padding-top: 0.375rem;
    padding-bottom: 0.375rem;
    font-weight: 500;
    font-size: 0.9rem; /* Slightly smaller font */
    transition: all 0.3s ease;
    line-height: 1.2;
}

.navbar-nav .nav-link:hover {
    transform: translateY(-1px);
}

.navbar-toggler {
    padding: 0.125rem 0.375rem;
    font-size: 0.9rem;
    line-height: 1;
}

/* Navbar container adjustments */
.navbar .container {
    padding-top: 0;
    padding-bottom: 0;
}

/* Badge adjustments for smaller navbar */
.navbar .badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.4rem;
}

/* Icon adjustments */
.navbar-brand i,
.navbar-nav .nav-link i {
    font-size: 0.85rem;
}

/* Dropdown menu positioning adjustment for shorter navbar */
.navbar-nav .dropdown-menu {
    top: 100%;
    margin-top: 0.0625rem;
}

/* User dropdown adjustments */
.navbar-nav .dropdown-toggle {
    font-size: 0.875rem;
}

/* Cards and Components */
.card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: var(--card-bg);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.card-title {
    font-weight: 600;
    color: var(--dark-color);
}

/* Forms */
.form-control {
    border-radius: 8px;
    border: 2px solid var(--border-color);
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    background: white;
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Regular textarea size control */
textarea.form-control {
    min-height: 120px;
    max-height: 400px;
    resize: vertical;
    overflow-y: auto;
}

/* HTML content textarea - optimized for performance and larger content */
textarea[name="AnalysisRequest.HtmlContent"] {
    min-height: 150px;
    max-height: 80vh !important;
    font-family: 'Courier New', Consolas, monospace;
    font-size: 0.875rem;
    line-height: 1.4;
    resize: vertical;
    overflow-y: auto;
    background: #f8fafc;
    border: 2px solid #e2e8f0;
}

/* Analyze Page Layout - Updated with Better Visual Separation */
.analyze-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0;
    background: var(--light-bg);
    min-height: calc(100vh - 50px); /* Adjusted for even shorter navbar */
}

.analyze-header {
    background: var(--hero-gradient); /* Using different purple gradient */
    color: white;
    padding: 3rem 0;
    text-align: center;
    margin-bottom: 0;
    position: relative;
    /* Add subtle border or shadow to separate from navbar */
    border-top: 3px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.analyze-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.analyze-header p {
    font-size: 1.1rem;
    opacity: 0.95;
    margin-bottom: 0;
    text-shadow: 0 1px 2px rgba(0,0,0,0.1);
}

.analyze-layout {
    display: flex;
    min-height: calc(100vh - 200px);
    background: white;
    box-shadow: 0 -4px 6px rgba(0, 0, 0, 0.05);
}

/* Left Sidebar - Tool Panel Style */
.analyze-sidebar-left {
    width: 250px;
    background: var(--sidebar-bg);
    border-right: 2px solid #e2e8f0;
    padding: 1.5rem;
    box-shadow: 2px 0 4px rgba(0,0,0,0.05);
}

/* Main Content Area */
.analyze-main-content {
    flex: 1;
    padding: 2rem;
    background: #f8fafc;
    overflow-y: auto;
}

/* Right Sidebar */
.analyze-sidebar-right {
    width: 250px;
    background: var(--sidebar-bg);
    border-left: 2px solid #e2e8f0;
    padding: 1.5rem;
    box-shadow: -2px 0 4px rgba(0,0,0,0.05);
}

/* Tool Buttons - Updated with Better Colors */
.tool-button {
    display: block;
    width: 100%;
    padding: 1rem;
    margin-bottom: 0.75rem;
    background: var(--hero-gradient); /* Using the same purple gradient as hero for consistency */
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: center;
    text-decoration: none;
    transition: all 0.3s ease;
    cursor: pointer;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.tool-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.3);
    color: white;
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%); /* Darker on hover */
}

.tool-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
    transform: none;
}

.tool-button.secondary {
    background: linear-gradient(135deg, #6b7280 0%, #4b5563 100%);
}

.tool-button.secondary:hover {
    box-shadow: 0 4px 12px rgba(107, 114, 128, 0.3);
    background: linear-gradient(135deg, #4b5563 0%, #374151 100%);
}

/* Input/Output Panels */
.io-panel {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.io-panel-header {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    padding: 1rem 1.5rem;
    border-bottom: 2px solid #e2e8f0;
    font-weight: 600;
    color: var(--dark-color);
    display: flex;
    align-items: center;
}

.io-panel-header i {
    margin-right: 0.5rem;
    color: #6366f1; /* Purple to match hero */
}

.io-panel-body {
    padding: 1.5rem;
}

/* Ad Placement Styles - Cleaner Design */
.ad-sidebar {
    position: sticky;
    top: 20px;
    height: fit-content;
}

.ad-container {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.ad-container:hover {
    border-color: #6366f1; /* Purple accent */
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.15);
    background: rgba(99, 102, 241, 0.02);
}

.ad-container.ad-banner {
    min-height: 180px;
    width: 100%;
}

.ad-container.ad-square {
    min-height: 200px;
    aspect-ratio: 1;
}

.ad-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    width: 100%;
}

.ad-placeholder i {
    font-size: 2rem;
    color: #6366f1; /* Purple accent */
    margin-bottom: 1rem;
    opacity: 0.7;
}

.ad-placeholder .ad-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

.ad-placeholder .ad-dimensions {
    font-size: 0.75rem;
    color: #9ca3af;
    font-family: monospace;
}

/* Buttons */
.btn {
    border-radius: 8px;
    font-weight: 600;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
    border: none;
}

.btn-primary {
    background: var(--hero-gradient); /* Using purple gradient for consistency */
    border: none;
    color: white;
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(139, 92, 246, 0.4);
    color: white;
    background: linear-gradient(135deg, #5b21b6 0%, #7c3aed 100%);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

/* Alerts */
.alert {
    border-radius: 12px;
    border: none;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
}

.alert-info {
    background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%);
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.alert-danger {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%);
    color: #dc2626;
    border-left: 4px solid #ef4444;
}

.alert-success {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%);
    color: #059669;
    border-left: 4px solid #10b981;
}

/* Tables */
.table {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    background: white;
}

.table th {
    background: var(--light-bg);
    font-weight: 600;
    color: var(--dark-color);
    border: none;
    padding: 1rem;
}

.table td {
    padding: 1rem;
    vertical-align: middle;
    border-color: var(--border-color);
}

/* Progress Bars */
.progress {
    border-radius: 8px;
    height: 24px !important;
    background-color: #f1f5f9;
}

.progress-bar {
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.8rem;
}

/* Badges */
.badge {
    font-weight: 500;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
}

/* JSON Formatter Style Layout - Fixed Responsive Design */
.json-formatter-layout {
    background: #fff;
    min-height: calc(100vh - 50px); /* Adjusted for even shorter navbar */
    padding: 0;
    margin: 0;
}

.json-formatter-header {
    background: linear-gradient(135deg, #26d0ce 0%, #1a2980 100%);
    color: white;
    padding: 1rem 0;
    margin: 0;
}

.json-formatter-container {
    max-width: 100%;
    padding: 0 20px;
    margin: 0;
}

/* Fixed row layout - force flex display */
.json-formatter-row {
    display: flex !important;
    margin: 0;
    min-height: 600px;
    gap: 15px;
    flex-wrap: nowrap; /* Prevent wrapping on laptops */
}

/* Column styling with proper flex sizing */
.input-column {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    min-height: 600px;
    flex: 0 0 42%; /* Fixed width percentage instead of Bootstrap classes */
    max-width: 42%;
}

.middle-column {
    background: #26d0ce;
    border-radius: 4px;
    padding: 15px;
    min-height: 600px;
    text-align: center;
    flex: 0 0 16%; /* Fixed width percentage */
    max-width: 16%;
}

.output-column {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    min-height: 600px;
    flex: 0 0 42%; /* Fixed width percentage */
    max-width: 42%;
}

/* JSON Formatter button styling */
.json-btn {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    padding: 8px 12px;
    background: transparent;
    border: 2px solid white;
    color: white;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 0;
}

.json-btn:hover {
    background: white;
    color: #26d0ce;
}

.json-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Input styling to match JSON formatter */
.json-input {
    width: 100%;
    min-height: 300px;
    border: 1px solid #ccc;
    padding: 10px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    resize: vertical;
    background: white;
    border-radius: 4px;
}

.json-input:focus {
    outline: none;
    border-color: #26d0ce;
    box-shadow: 0 0 5px rgba(38, 208, 206, 0.3);
}

/* Header top ad area - Increased Height */
.top-ad-area {
    background: #e9ecef;
    padding: 30px 20px; /* Increased from 15px to 30px */
    text-align: center;
    border-bottom: 1px solid #ddd;
    min-height: 120px; /* Added minimum height for better ad accommodation */
}

/* Middle column ad area */
.middle-ad-area {
    background: rgba(255, 255, 255, 0.1);
    margin: 15px -15px;
    padding: 10px;
    min-height: 200px; /* Reduced from 250px for better fit */
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px dashed rgba(255, 255, 255, 0.5);
    border-radius: 4px;
}

/* Form labels */
.json-label {
    font-size: 12px;
    font-weight: bold;
    color: #333;
    margin-bottom: 5px;
    display: block;
    text-transform: uppercase;
}

/* Results styling */
.results-container {
    background: white;
    border: 1px solid #ccc;
    border-radius: 4px;
    min-height: 400px;
    padding: 15px;
}

.results-header {
    background: #f8f9fa;
    padding: 10px;
    border-bottom: 1px solid #ddd;
    font-weight: bold;
    color: #333;
    font-size: 14px;
    margin: -15px -15px 15px -15px;
    border-radius: 4px 4px 0 0;
}

/* Stats cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 12px; /* Reduced padding for better fit */
    text-align: center;
}

.stat-card.success {
    background: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.stat-card.warning {
    background: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

.stat-card.danger {
    background: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.stat-card.info {
    background: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.stat-number {
    font-size: 20px; /* Reduced from 24px */
    font-weight: bold;
    display: block;
}

.stat-label {
    font-size: 10px; /* Reduced from 11px */
    text-transform: uppercase;
    margin-top: 5px;
}

/* Results table */
.results-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px; /* Reduced from 12px */
    margin-top: 15px; /* Reduced margin */
}

.results-table th,
.results-table td {
    padding: 6px; /* Reduced from 8px */
    border: 1px solid #ddd;
    text-align: left;
}

.results-table th {
    background: #f8f9fa;
    font-weight: bold;
    font-size: 10px;
    text-transform: uppercase;
}

.results-table code {
    background: #f8f9fa;
    padding: 2px 4px;
    font-size: 10px;
    color: #e83e8c;
    border-radius: 2px;
}

/* Confidence bar */
.confidence-bar {
    background: #e9ecef;
    height: 15px;
    width: 50px; /* Reduced from 60px */
    position: relative;
    border: 1px solid #ddd;
    border-radius: 2px;
}

.confidence-fill {
    background: #28a745;
    height: 100%;
    transition: width 0.3s ease;
    border-radius: 1px;
}

.confidence-text {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 9px; /* Reduced font size */
    font-weight: bold;
    color: white;
    text-shadow: 1px 1px 1px rgba(0,0,0,0.5);
}

/* Bottom ad area with padding */
.bottom-ad-area {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #ddd;
}

/* Responsive breakpoints - Fixed for better laptop support */
@media (max-width: 1200px) {
    .json-formatter-container {
        padding: 0 15px;
    }
    
    .input-column,
    .output-column {
        flex: 0 0 40%;
        max-width: 40%;
    }
    
    .middle-column {
        flex: 0 0 20%;
        max-width: 20%;
    }
    
    .middle-ad-area {
        min-height: 180px;
    }
    
    .stat-number {
        font-size: 18px;
    }
}

@media (max-width: 992px) {
    .json-formatter-row {
        flex-direction: column;
        flex-wrap: wrap;
        gap: 15px;
    }
    
    .input-column,
    .middle-column,
    .output-column {
        flex: 1 1 100%;
        max-width: 100%;
        border: 1px solid #ddd;
        border-radius: 4px;
    }
    
    .stats-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

@media (max-width: 768px) {
    .json-formatter-container {
        padding: 0 10px;
    }
    
    .top-ad-area {
        padding: 20px 10px; /* Adjusted for mobile but still increased */
    }
    
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 576px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

/* Override Bootstrap completely for this layout */
.json-formatter-layout .container-fluid {
    padding-left: 20px;
    padding-right: 20px;
}

.json-formatter-layout .row {
    margin-left: 0;
    margin-right: 0;
}

.json-formatter-layout [class*="col-"] {
    padding-left: 0;
    padding-right: 0;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}