/* Threelytics Backend Module Styles */

/* User Journey Visualization Styles */
.threelytics-journey-visualization {
    position: relative;
    overflow: hidden;
}

.threelytics-journey-controls {
    margin-bottom: 15px;
}

.threelytics-journey-controls button {
    margin-right: 10px;
    padding: 5px 10px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
}

.threelytics-journey-controls button:hover {
    background-color: #e5e5e5;
}

.threelytics-journey-legend {
    display: flex;
    margin-top: 10px;
    flex-wrap: wrap;
}

.threelytics-journey-legend-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
    margin-bottom: 5px;
}

.threelytics-journey-legend-color {
    width: 12px;
    height: 12px;
    margin-right: 5px;
    border-radius: 2px;
}

.threelytics-journey-legend-label {
    font-size: 12px;
}

.threelytics-journey-tooltip {
    position: absolute;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 10px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
    pointer-events: none;
    z-index: 1000;
    font-size: 12px;
    max-width: 300px;
}

.threelytics-backend-module {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: #333;
    padding: 20px;
    max-width: 1200px;
    margin: 0 auto;
}

/* Ensure the module content is scrollable */
.threelytics-backend-module {
    height: auto;
    min-height: 600px;
    overflow: visible;
    position: relative;
}

/* Make content area scrollable */
.threelytics-content {
    overflow: visible;
    position: relative;
}

/* Ensure tables don't overflow */
.threelytics-table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

/* Fix for TYPO3 backend module */
.typo3-module-frame {
    overflow: auto !important;
}

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

.threelytics-logo {
    display: flex;
    align-items: center;
}

.threelytics-logo h1 {
    margin: 0 0 0 10px;
    font-size: 24px;
    font-weight: 500;
}

.threelytics-period-selector {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.threelytics-period-selector label {
    margin-right: 10px;
}

.threelytics-period-selector-row {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.threelytics-period-selector-item {
    margin-right: 15px;
    display: flex;
    flex-direction: column;
}

.threelytics-period-selector-item:last-child {
    margin-right: 0;
}

.threelytics-period-selector-item label {
    margin-bottom: 5px;
    font-size: 12px;
    color: #666;
}

.threelytics-period-selector-item-separator {
    margin: 0 5px;
    align-self: flex-end;
    margin-bottom: 10px;
    color: #666;
}

.threelytics-custom-date-range {
    margin-top: 10px;
    padding: 10px;
    background-color: #f8f8f8;
    border-radius: 4px;
    border: 1px solid #ddd;
}

.threelytics-custom-date-range input[type="text"] {
    width: 120px;
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 3px;
}

.threelytics-custom-date-range button {
    padding: 5px 10px;
    background-color: #0078e7;
    color: white;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    margin-top: 20px;
}

.threelytics-custom-date-range button:hover {
    background-color: #0066cc;
}

.threelytics-navigation {
    margin-bottom: 30px;
}

.threelytics-navigation ul {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    border-bottom: 1px solid #ddd;
}

.threelytics-navigation li {
    margin-right: 20px;
    padding: 10px 0;
}

.threelytics-navigation li a {
    text-decoration: none;
    color: #555;
    padding: 10px 0;
}

.threelytics-navigation li.active a {
    color: #0078e7;
    border-bottom: 2px solid #0078e7;
    font-weight: 500;
}

.threelytics-content {
    margin-bottom: 30px;
}

.threelytics-dashboard-row {
    display: flex;
    margin: 0 -15px 30px;
    flex-wrap: wrap;
}

.threelytics-dashboard-card {
    flex: 1;
    min-width: 200px;
    margin: 0 15px 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.threelytics-dashboard-card-title {
    font-size: 14px;
    color: #666;
    margin-bottom: 10px;
}

.threelytics-dashboard-card-value {
    font-size: 24px;
    font-weight: 500;
}

.threelytics-dashboard-column {
    flex: 1;
    min-width: 300px;
    margin: 0 15px 20px;
}

.threelytics-dashboard-full {
    flex: 1 1 100%;
    margin: 0 15px 20px;
}

.threelytics-dashboard-chart {
    width: 100%;
    margin: 0 15px 20px;
    padding: 20px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.threelytics-chart-container {
    height: 200px;
    margin-bottom: 20px;
    position: relative;
    width: 100%;
    min-height: 200px;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 10px;
    overflow: hidden;
}

/* Ensure canvas elements are visible */
.threelytics-chart-container canvas {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    max-height: 100%;
}

.threelytics-chart-legend {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 20px;
}

.threelytics-chart-legend-item {
    display: flex;
    align-items: center;
    margin-right: 20px;
    margin-bottom: 10px;
}

.threelytics-chart-legend-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 5px;
}

.threelytics-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.threelytics-table th {
    text-align: left;
    padding: 10px;
    border-bottom: 2px solid #ddd;
    font-weight: 500;
}

.threelytics-table td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.threelytics-table-small {
    font-size: 13px;
}

.threelytics-page-title {
    font-weight: 500;
}

.threelytics-page-url {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 400px;
}

.threelytics-dashboard-more {
    text-align: right;
    margin-top: 10px;
}

.threelytics-dashboard-more a {
    text-decoration: none;
    color: #0078e7;
    font-size: 14px;
}

.threelytics-footer {
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
    color: #666;
    font-size: 12px;
    text-align: center;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .threelytics-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .threelytics-period-selector {
        margin-top: 15px;
    }
    
    .threelytics-navigation ul {
        flex-wrap: wrap;
    }
    
    .threelytics-dashboard-row {
        flex-direction: column;
    }
    
    .threelytics-dashboard-card,
    .threelytics-dashboard-column,
    .threelytics-dashboard-chart {
        min-width: auto;
    }
}
