/*
 * This is a manifest file that'll be compiled into application.css.
 *
 * With Propshaft, assets are served efficiently without preprocessing steps. You can still include
 * application-wide styles in this file, but keep in mind that CSS precedence will follow the standard
 * cascading order, meaning styles declared later in the document or manifest will override earlier ones,
 * depending on specificity.
 *
 * Consider organizing styles into separate files for maintainability.
 */

@import url("/assets/home-ff18b491.css");
@import url("/assets/mobile-8e5fa03c.css");

/* Dashboard sticky column styles */
.sticky-left {
	position: sticky;
	z-index: 10;
	margin-right: -1px; /* Slight overlap to prevent gaps */
}

/* Individual sticky column positioning */
.sticky-col-1 { /* Date */
	left: 0;
	min-width: 120px !important;
	max-width: 120px !important;
	border-right: 2px solid #dee2e6 !important;
}

.sticky-col-2 { /* Net Revenue */
	left: 118px; /* Slight overlap to prevent gap */
	min-width: 100px !important;
	max-width: 100px !important;
}

.sticky-col-3 { /* Gross Profit */
	left: 216px; /* Adjusted for overlap */
	min-width: 100px !important;
	max-width: 100px !important;
}

.sticky-col-4 { /* Gross Margin */
	left: 314px; /* Adjusted for overlap */
	min-width: 90px !important;
	max-width: 90px !important;
}

.sticky-col-5 { /* ROAS */
	left: 402px; /* Adjusted for overlap */
	min-width: 80px !important;
	max-width: 80px !important;
}

.sticky-col-6 { /* Contribution */
	left: 480px; /* Adjusted for overlap */
	min-width: 100px !important;
	max-width: 100px !important;
	border-right: 2px solid #dee2e6 !important;
}

/* Ensure sticky columns have proper backgrounds to prevent overlap */
.sticky-left.col-date {
	background-color: #f8f9fa !important;
}

.sticky-left.col-revenue {
	background-color: #ccffcc !important;
}

.sticky-left.col-profit {
	background-color: #fff9cc !important;
}

.sticky-left.col-performance {
	background-color: #cce5ff !important;
}

.sticky-left.col-contribution {
	background-color: #ffe5cc !important;
}

/* Dark theme for sticky headers */
.table-dark .sticky-left.col-date {
	background-color: #6c757d !important;
}

.table-dark .sticky-left.col-revenue {
	background-color: #28a745 !important;
}

.table-dark .sticky-left.col-profit {
	background-color: #ffc107 !important;
	color: #212529 !important;
}

.table-dark .sticky-left.col-performance {
	background-color: #007bff !important;
}

.table-dark .sticky-left.col-contribution {
	background-color: #fd7e14 !important;
}

/* Ensure table is horizontally scrollable */
.table-responsive {
	overflow-x: auto;
}

/* Ensure proper spacing for dashboard table */
.dashboard-table {
	min-width: 1200px;
}

/* Dashboard column color scheme */
/* Date and Details columns - neutral */
.col-date,
.col-details {
	background-color: #f8f9fa !important;
}

/* Ad Spend columns - red tones for expenses */
.col-ad-platform {
	background-color: #ffe5e5 !important;
}

.col-ad-total {
	background-color: #ffcccc !important;
}

/* Revenue columns - green tones for income */
.col-revenue-light {
	background-color: #e5ffe5 !important;
}

.col-revenue {
	background-color: #ccffcc !important;
}

/* Profit and Performance columns */
.col-profit {
	background-color: #fff9cc !important;
}

.col-performance {
	background-color: #cce5ff !important;
}

.col-contribution {
	background-color: #ffe5cc !important;
}

/* Projection columns - purple for future values */
.col-projection {
	background-color: #e5ccff !important;
}

/* Header colors - slightly darker versions */
.table-dark th.col-date,
.table-dark th.col-details {
	background-color: #6c757d !important;
}

.table-dark th.col-ad-platform {
	background-color: #dc3545 !important;
	opacity: 0.8;
}

.table-dark th.col-ad-total {
	background-color: #dc3545 !important;
}

.table-dark th.col-revenue-light {
	background-color: #28a745 !important;
	opacity: 0.8;
}

.table-dark th.col-revenue {
	background-color: #28a745 !important;
}

.table-dark th.col-profit {
	background-color: #ffc107 !important;
	color: #212529 !important;
}

.table-dark th.col-performance {
	background-color: #007bff !important;
}

.table-dark th.col-contribution {
	background-color: #fd7e14 !important;
}

.table-dark th.col-projection {
	background-color: #6f42c1 !important;
}

/* Maintain readability on hover */
.table-hover tbody tr:hover td {
	opacity: 0.9;
}

/* Ensure badges remain visible */
.badge {
	font-weight: bold;
}

/* Dashboard footer styling */
.dashboard-table tfoot {
	position: sticky;
	bottom: 0;
	z-index: 5;
}

.dashboard-table tfoot td {
	padding: 12px 8px;
	border-top: 3px solid #dee2e6;
}

/* Ensure footer colors work with sticky columns */
.dashboard-table tfoot .sticky-left {
	z-index: 10;
}

.dashboard-table tfoot .sticky-left.col-date {
	background-color: #495057 !important;
}

.dashboard-table tfoot .sticky-left.col-revenue {
	background-color: #228b22 !important;
	color: white !important;
}

.dashboard-table tfoot .sticky-left.col-profit {
	background-color: #b8860b !important;
	color: white !important;
}

.dashboard-table tfoot .sticky-left.col-performance {
	background-color: #191970 !important;
	color: white !important;
}

.dashboard-table tfoot .sticky-left.col-contribution {
	background-color: #cc5500 !important;
	color: white !important;
}

/* Footer-specific column colors for dark background with proper contrast */
.dashboard-table tfoot .col-ad-platform {
	background-color: #8b0000 !important; /* Dark red */
	color: white !important;
}

.dashboard-table tfoot .col-ad-total {
	background-color: #a52a2a !important; /* Brown/dark red */
	color: white !important;
}

.dashboard-table tfoot .col-revenue-light {
	background-color: #006400 !important; /* Dark green */
	color: white !important;
}

.dashboard-table tfoot .col-revenue {
	background-color: #228b22 !important; /* Forest green */
	color: white !important;
}

.dashboard-table tfoot .col-profit {
	background-color: #b8860b !important; /* Dark goldenrod */
	color: white !important;
}

.dashboard-table tfoot .col-performance {
	background-color: #191970 !important; /* Midnight blue */
	color: white !important;
}

.dashboard-table tfoot .col-contribution {
	background-color: #cc5500 !important; /* Dark orange */
	color: white !important;
}

.dashboard-table tfoot .col-projection {
	background-color: #4b0082 !important; /* Indigo */
	color: white !important;
}

.dashboard-table tfoot .col-date,
.dashboard-table tfoot .col-details {
	background-color: #495057 !important; /* Dark gray */
	color: white !important;
}

/* Ensure all footer text is white and bold */
.dashboard-table tfoot td {
	color: white !important;
	font-weight: bold !important;
}

/* Ensure badges remain visible in footer with dark backgrounds */
.dashboard-table tfoot .badge {
	font-weight: bold !important;
	border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

/* Ensure icons in footer are white */
.dashboard-table tfoot i {
	color: white !important;
}

/* Platform toggle functionality styling */
.platform-toggle-btn {
	background: none;
	border: none;
	color: white;
	padding: 2px 4px;
	margin-left: 4px;
	transition: all 0.2s ease;
}

.platform-toggle-btn:hover {
	background-color: rgba(255, 255, 255, 0.1);
	border-radius: 3px;
	color: white;
}

.platform-toggle-btn .platform-toggle-icon {
	font-size: 0.8rem;
	transition: transform 0.2s ease;
}

.collapsible-platform {
	position: relative;
}

.collapsible-platform span {
	margin-right: 4px;
}


/* Smooth transitions for collapsible columns */
.collapsible-platform-cell,
.collapsible-platform-footer {
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* Responsive adjustments for platform toggle */
@media (max-width: 768px) {
	.platform-toggle-btn {
		padding: 1px 3px;
	}
	
	.platform-toggle-btn .platform-toggle-icon {
		font-size: 0.7rem;
	}
}

/* Modern Dashboard Controls Styling */
.dashboard-controls-card {
	background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
	border-radius: 16px;
	border: 1px solid #e9ecef;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
		0 2px 4px -1px rgba(0, 0, 0, 0.06);
	overflow: hidden;
	transition: all 0.3s ease;
}

/* Dashboard Table Card Styling - Match controls card */
.card.dashboard-table-card {
	border-radius: 16px !important;
	border: 1px solid #e9ecef;
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
		0 2px 4px -1px rgba(0, 0, 0, 0.06);
	overflow: hidden;
	transition: all 0.3s ease;
}

.dashboard-controls-card:hover {
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
		0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

.card.dashboard-table-card:hover {
	box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1),
		0 4px 6px -2px rgba(0, 0, 0, 0.05);
}

/* Table Card Header Styling */
.card.dashboard-table-card .card-header h3 {
	font-size: 1.1rem;
	font-weight: 600;
}

.card.dashboard-table-card .card-header .badge {
	font-size: 0.8rem;
	font-weight: 500;
}

/* Table Content Font Consistency */
.dashboard-table {
	font-size: 0.9rem;
}

.dashboard-table th {
	font-size: 0.85rem;
	font-weight: 600;
}

.dashboard-table td {
	font-size: 0.9rem;
}

.dashboard-table .fw-bold {
	font-weight: 600;
}

.controls-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.25rem 1.5rem;
	border-bottom: 1px solid #dee2e6;
}

.controls-title {
	margin: 0;
	font-size: 1.1rem;
	font-weight: 600;
	color: white;
	display: flex;
	align-items: center;
}

.controls-actions {
	display: flex;
	gap: 0.5rem;
}

.controls-actions .btn {
	border-color: rgba(255, 255, 255, 0.5);
	color: white;
	transition: all 0.2s ease;
}

.controls-actions .btn:hover {
	border-color: white;
	background-color: rgba(255, 255, 255, 0.1);
	color: white;
	transform: translateY(-1px);
}

.controls-body {
	padding: 1.5rem;
}

/* Modern Form Styling */
.modern-label {
	font-weight: 600;
	color: #495057;
	margin-bottom: 0.5rem;
	font-size: 0.9rem;
	display: flex;
	align-items: center;
}

.modern-input {
	border-radius: 8px;
	border: 2px solid #e9ecef;
	padding: 0.6rem 0.75rem;
	font-size: 0.95rem;
	transition: all 0.2s ease;
	background-color: #ffffff;
}

.modern-input:focus {
	border-color: #0d6efd;
	box-shadow: 0 0 0 3px rgba(13, 110, 253, 0.1);
	outline: none;
}

.modern-input:hover {
	border-color: #ced4da;
}

.modern-btn {
	border-radius: 8px;
	padding: 0.6rem 1rem;
	font-weight: 500;
	transition: all 0.2s ease;
	border: none;
	font-size: 0.9rem;
}

.modern-btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

/* Date Range Styling */
.date-range-group {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
}

.date-input-group {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
}

.date-input {
	flex: 1;
	min-width: 140px;
}

.date-separator {
	color: #6c757d;
	font-weight: 500;
	font-size: 0.9rem;
}

.apply-btn {
	background: #0d6efd;
	white-space: nowrap;
	flex-shrink: 0;
}

.apply-btn:hover {
	background: #0856ca;
}

.helper-text {
	font-size: 0.8rem;
	color: #6c757d;
}

/* Preset Buttons */
.preset-buttons {
	display: flex;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.preset-btn {
	border-radius: 6px;
	padding: 0.4rem 0.8rem;
	font-size: 0.85rem;
	transition: all 0.2s ease;
	border: 1px solid #ced4da;
	background-color: #ffffff;
}

.preset-btn:hover {
	background-color: #f8f9fa;
	border-color: #adb5bd;
	transform: translateY(-1px);
}

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

/* Status Badges */
.status-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.modern-badge {
	padding: 0.4rem 0.8rem;
	border-radius: 6px;
	font-size: 0.8rem;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
}

/* Modern Switch */
.modern-switch {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.modern-switch .form-check-input {
	width: 2.5rem;
	height: 1.25rem;
	border-radius: 1rem;
	border: 2px solid #ced4da;
	transition: all 0.2s ease;
}

.modern-switch .form-check-input:checked {
	background-color: #198754;
	border-color: #198754;
}

.modern-switch .form-check-input:focus {
	box-shadow: 0 0 0 3px rgba(25, 135, 84, 0.1);
}

.modern-switch .form-check-label {
	font-size: 0.9rem;
	color: #495057;
	font-weight: 500;
	display: flex;
	align-items: center;
}

/* Responsive Design */
@media (max-width: 992px) {
	.controls-header {
		flex-direction: column;
		gap: 1rem;
		text-align: center;
	}

	.controls-body {
		padding: 1rem;
	}

	.date-input-group {
		flex-direction: column;
		align-items: stretch;
	}

	.date-separator {
		text-align: center;
		margin: 0.25rem 0;
	}

	.preset-buttons {
		flex-direction: column;
	}

	.preset-btn {
		width: 100%;
		justify-content: center;
	}
}

@media (max-width: 768px) {
	.dashboard-controls-card {
		border-radius: 12px;
		margin: 0 -15px;
		box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
	}
	
	.card.dashboard-table-card {
		border-radius: 12px !important;
		margin: 0 -15px;
		box-shadow: 0 2px 4px -1px rgba(0, 0, 0, 0.1);
	}

	.controls-header {
		padding: 1rem;
	}

	.controls-title {
		font-size: 1rem;
	}

	.controls-body {
		padding: 1rem;
	}

	.modern-input {
		font-size: 16px; /* Prevents zoom on iOS */
	}

	.date-input {
		min-width: 100%;
	}
}
