/* Base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', 'Arial', sans-serif;
    color: #1a202c;
}

body {
    background-color: #f7fafc;
    color: #2d3748;
    line-height: 1.6;
}

.container {
    width: 100%;
}

h1, h2, h3, h4, h5, h6 {
    margin-bottom: 15px;
    color: #1a202c;
    font-weight: 600;
}

.hidden {
    display: none !important;
}

/* Cards */
.card {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 20px;
    margin-bottom: 20px;
}

.url-input-card {
    text-align: center;
    padding: 40px;
    background-color: #f9fafb;
}

.input-group {
    display: flex;
    max-width: 700px;
    margin: 20px auto 0;
}

input[type="text"] {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    font-size: 16px;
    outline: none;
    transition: all 0.2s;
    background-color: #f7fafc;
}

input[type="text"]:focus {
    border-color: #3182ce;
    box-shadow: 0 0 0 3px rgba(49, 130, 206, 0.1);
}

.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.primary-btn {
    background-color: #3182ce;
    color: white;
    margin-left: 10px;
}

.primary-btn:hover {
    background-color: #2b6cb0;
}

.secondary-btn {
    background-color: #38a169;
    color: white;
}

.secondary-btn:hover {
    background-color: #2f855a;
}

.back-btn {
    background-color: #edf2f7;
    color: #3182ce;
    padding: 8px 16px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.back-btn span {
    font-size: 18px;
    line-height: 1;
}

.subscription-card {
    margin-top: 20px;
}

.subscription-details {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 24px;
}

.plan-name, .remaining-scans {
    font-size: 18px;
    font-weight: 600;
    color: #3182ce;
}

/* Analysis View */
.top-bar {
    margin-bottom: 16px;
}

.url-analysis-row {
    display: flex;
    margin-bottom: 20px;
}

.url-analysis-row input[type="text"] {
    flex: 1;
}

.info-card {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
}

.info-card .subscription-details {
    flex: 1;
    justify-content: flex-start;
}

.website-ranking-container {
    text-align: center;
    padding: 0 20px;
    margin: 0 20px;
}

.website-ranking-container h3 {
    margin-bottom: 8px;
    font-size: 18px;
}

.ranking {
    font-size: 28px;
    font-weight: 700;
    color: #38a169;
}

.analysis-content {
    display: flex;
    margin-top: 20px;
    min-height: 700px;
}

/* Module Panel Styles */
.module-panel {
    width: 260px;
    background-color: #2d3748;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    padding: 16px 0;
    margin-right: 20px;
    color: #fff;
    transition: width 0.3s ease;
    overflow-y: auto;
    max-height: 650px;
    position: sticky;
    top: 20px;
}

.module-panel.collapsed {
    width: 64px;
}

.module-list {
    list-style: none;
}

.module-item {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    border-left: 4px solid transparent;
    color: #fff; /* Added to ensure white text */
}

.module-item:hover {
    background-color: rgba(255, 255, 255, 0.08);
    border-left-color: #38a169;
}

.module-item.active {
    background-color: rgba(255, 255, 255, 0.12);
    border-left-color: #38a169;
}

.module-icon {
    margin-right: 12px;
    font-size: 18px;
    min-width: 24px;
    text-align: center;
}

.module-label {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s;
    color: #fff; /* Added to ensure white text */
}

.collapsed .module-label {
    opacity: 0;
}

/* Module Content */
.module-content {
    flex: 1;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 24px;
    overflow-y: auto;
    min-height: 700px;
}

.module-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-wrap: wrap; /* Added to allow wrapping if needed */
    flex-direction: column; /* Ensure main sections stack vertically */
}

.module-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

/* Overview Section */
.overview-summary {
    display: flex;
    align-items: center;
    margin-bottom: 24px;
}

.score-circle {
    position: relative;
    width: 140px;
    height: 140px;
    margin-right: 24px;
    flex-shrink: 0;
}

.score-value {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 26px;
    font-weight: 700;
    color: #1a202c;
}

.module-scores-container {
    flex: 1;
    height: 300px;
    padding: 12px;
    background-color: #f9fafb;
    border-radius: 8px;
}

.module-scores-chart {
    height: 250px;
}

/* Issues List */
.issues-list {
    display: flex;
    flex-direction: column;
    gap: 16px; /* Consistent spacing */
    width: 100%; /* Full width */
    margin: 16px 0; /* Margin to separate from status-rectangles and detailed-table */
}

/* Issue Card */
.issue-card {
    padding: 24px; /* Spacious padding */
    background: linear-gradient(135deg, #f9fafb 0%, #edf2f7 100%); /* Default gradient for non-severity cards */
    border-radius: 12px; /* Smooth rounded corners */
    transition: all 0.3s ease; /* Smooth hover transition */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Subtle shadow */
    width: 100%; /* Full width */
}

.issue-card:hover {
    transform: translateY(-4px); /* Subtle lift effect */
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.1); /* Enhanced shadow on hover */
}

.issue-card p {
    font-size: 16px; /* Readable font size */
    font-weight: 500; /* Slightly bold */
    color: #1a202c; /* Dark text for contrast */
    margin-bottom: 12px; /* Spacing below paragraph */
}

/* Severity-Specific Background Colors */
.issue-high {
    background: linear-gradient(135deg, #fee2e2 0%, #fecaca 100%); /* Light red gradient for high severity */
}

.issue-medium {
    background: linear-gradient(135deg, #feebc8 0%, #fed7aa 100%); /* Light orange gradient for medium severity */
}

.issue-low {
    background: linear-gradient(135deg, #d1fae5 0%, #a7f3d0 100%); /* Light green gradient for low severity */
}

/* Issue Details */
.issue-details {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px; /* Consistent spacing */
}

.issue-details .issue-severity {
    font-size: 14px; /* Clear and readable */
    font-weight: 700; /* Bold for emphasis */
    color: #fff; /* White text for contrast */
    padding: 6px 12px; /* Larger badge-like padding */
    border-radius: 6px; /* Rounded corners for professional look */
    text-transform: uppercase; /* Uppercase for clarity */
    letter-spacing: 0.05em; /* Slight letter spacing for professionalism */
}

/* Severity-Specific Severity Badge Colors */
.issue-high .issue-severity {
    background-color: #e53e3e; /* Red for high severity */
}

.issue-medium .issue-severity {
    background-color: #dd6b20; /* Orange for medium severity */
}

.issue-low .issue-severity {
    background-color: #38a169; /* Green for low severity */
}

/* Issue Details Button */
.issue-details button {
    background-color: #fff; /* White background for clean look */
    color: #1a202c; /* Dark text for readability */
    padding: 8px 16px; /* Comfortable click area */
    border-radius: 6px; /* Rounded corners */
    font-size: 14px; /* Readable size */
    font-weight: 600; /* Bold text */
    border: 1px solid #e2e8f0; /* Subtle border for definition */
    transition: all 0.2s ease; /* Smooth transition */
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05); /* Subtle shadow */
}

.issue-details button:hover {
    transform: scale(1.05); /* Subtle scale effect */
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1); /* Stronger shadow on hover */
}

/* Status Rectangles */
.status-rectangles {
    display: flex;
    flex-wrap: wrap; /* Allow wrapping to create two rows */
    justify-content: row-start;
    margin-bottom: 24px;
    gap: 12px; /* Space between rectangles */
    flex: 1;
    margin-left: 24px; /* Unchanged from previous change */
}

.score-rectangles-wrapper {
    display: flex;
    align-items: flex-start; /* Align tops of score and rectangles */
    width: 100%;
    margin-bottom: 24px; /* Space before issues list */
}
.status-box {
    flex: 0 0 calc(50% - 6px); /* Two per row, accounting for gap */
    padding: calc(0.5rem);
    border-radius: 6px;
    text-align: center;
    color: #fff;
    font-weight: 600;
    font-size: calc(1.75rem);
}

.status-fail {
    background-color: #e53e3e;
}

.status-pass {
    background-color: #38a169;
}

.status-warning {
    background-color: #dd6b20;
}

.status-missing {
    background-color: #718096;
}

.status-count {
    display: block;
    font-size: 13px;
    margin-top: 4px;
    opacity: 0.9;
    color: #fff; /* Added to ensure white text */
}

/* Module Score */
.module-score {
    display: flex;
    margin-bottom: 0; /* Remove bottom margin since wrapper handles it */
    flex: 0 0 auto; /* Prevent stretching */
}

.module-issues {
    flex: 1;
    padding: 0 16px;
}

.issues-summary {
    margin-left: 16px;
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Legacy compatibility for lists */
.issues-summary li {
    position: relative;
    margin-bottom: 8px;
    padding-left: 12px;
}

.issues-summary li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: #e53e3e;
}

/* Detailed Table */
.detailed-table {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

th {
    background-color: #f9fafb;
    font-weight: 600;
    font-size: 14px;
}

tr:hover {
    background-color: #f7fafc;
}

.area-name {
    font-weight: 600;
    font-size: 14px;
}

.importance {
    display: block;
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

.importance.critical {
    color: #e53e3e;
}

.importance.high {
    color: #c05621;
}

.importance.medium {
    color: #dd6b20;
}

.importance.low {
    color: #3182ce;
}

.tag-btn {
    display: inline-block;
    margin-top: 4px;
    padding: 4px 8px;
    background-color: #edf2f7;
    border: 1px solid #e2e8f0;
    border-radius: 4px;
    font-size: 12px;
    cursor: pointer;
}

.detail-btn {
    background-color: #edf2f7;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.detail-btn:hover {
    background-color: #e2e8f0;
}

/* Performance Module */
.view-toggles, .metrics-toggles {
    display: flex;
    gap: 8px;
    margin-bottom: 16px;
}

.toggle-btn {
    padding: 8px 16px;
    background-color: #edf2f7;
    border: 1px solid #e2e8f0;
    border-radius: 9999px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
    font-size: 13px;
}

.toggle-btn.active {
    background-color: #3182ce;
    color: #fff;
    border-color: #3182ce;
}

.performance-metrics {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.metric-card {
    position: relative;
    padding: 16px;
    background-color: #f9fafb;
    border-radius: 8px;
}

.metric-card h4 {
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 14px;
}

.info-btn {
    width: 18px;
    height: 18px;
    background-color: #3182ce;
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    font-style: italic;
    font-size: 12px;
}

.metric-fullname {
    font-size: 12px;
    color: #718096;
    margin-bottom: 12px;
}

.metric-chart {
    position: relative;
    height: 8px;
    border-radius: 4px;
    overflow: hidden;
    margin-top: 8px;
}

.range {
    position: absolute;
    height: 100%;
    top: 0;
}

.range-good {
    width: 33.33%;
    left: 0;
    background-color: #38a169;
}

.range-avg {
    width: 33.33%;
    left: 33.33%;
    background-color: #dd6b20;
}

.range-poor {
    width: 33.34%;
    right: 0;
    background-color: #e53e3e;
}

.metric-value {
    position: absolute;
    top: -18px;
    transform: translateX(-50%);
    font-size: 12px;
    font-weight: 600;
}

.additional-metrics {
    margin-top: 12px;
}

/* Modal */

.modal {
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.1); /* Semi-transparent background */
    backdrop-filter: blur(10px); /* Glass blur effect */
    -webkit-backdrop-filter: blur(10px); /* Safari support */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease, backdrop-filter 0.3s ease;
    overflow-y: auto;
}

.modal:not(.hidden) {
    opacity: 1;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}


.modal-content {
    background-color: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 800px;
    max-height: 90vh;
    overflow-y: auto;
    padding: 32px;
    position: relative;
    transform: scale(0.9);
    transition: transform 0.3s ease;
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.modal:not(.hidden) .modal-content {
    transform: scale(1);
}

.close-modal {
    position: absolute;
    top: 16px;
    right: 16px;
    font-size: 24px;
    cursor: pointer;
    color: #4a5568;
    transition: color 0.2s ease;
}

.close-modal:hover {
    color: #1a202c;
}

/* Modal Table (General) */
.modal-table {
    width: 100%;
    margin-top: 16px;
    border-collapse: collapse;
    font-size: 14px;
}

.modal-table th, .modal-table td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
}

.modal-table th {
    background-color: #f9fafb;
    font-weight: 600;
    color: #1a202c;
}

/* Issue Modal Table (Specific for Issue Details) */
.issue-modal-table {
    border: none;
}

.issue-modal-table th, .issue-modal-table td {
    border-left: none;
    border-right: none;
    border-bottom: 1px solid #e2e8f0;
    padding: 12px 16px;
}

.issue-modal-table th {
    background-color: #f7fafc;
    font-weight: 700;
    font-size: 14px;
    color: #2d3748;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.issue-modal-table td {
    font-size: 14px;
    color: #4a5568;
}

.issue-modal-table tr:last-child td {
    border-bottom: none;
}


/* Login Popup Specific Styles */
.login-popup-content {
    text-align: center;
    padding: 24px;
}

.login-popup-content h3 {
    color: #1a202c;
    margin-bottom: 16px;
    font-size: 20px;
    font-weight: 600;
}

.login-popup-content p {
    color: #4a5568;
    margin-bottom: 24px;
    font-size: 15px;
}

.login-popup-actions {
    display: flex;
    justify-content: center;
    gap: 12px;
}

.cancel-login-btn {
    background-color: #e53e3e;
    color: #fff;
}

.cancel-login-btn:hover {
    background-color: #c53030;
}

/* Status styling for table cells */
.status {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-transform: capitalize;
}

.status.pass {
    background-color: #38a169;
}

.status.fail {
    background-color: #e53e3e;
}

.status.warning {
    background-color: #dd6b20;
}

.status.missing {
    background-color: #718096;
}

.status-message {
    font-size: 12px;
    color: #718096;
    margin-top: 4px;
}

.full-details {
    max-height: 400px;
    overflow-y: auto;
    padding-right: 8px;
}

.scanner-line {
    position: absolute;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #3182ce;
    box-shadow: 0 0 10px #3182ce;
    animation: scan 2s ease-in-out infinite;
    z-index: 2;
}

/* Scanning Container */
.scanning-container {
    margin-top: 20px;
    width: 100%;
    max-width: 700px;
    background-color: #f9fafb;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.scanning-content h2 {
    margin-bottom: 16px;
    color: #1a202c;
    font-size: 20px;
}

.scanner-animation {
    height: 200px;
}

.scanning-iframe {
    height: 200px;
}

.result-card {
    width: 100%;
    max-width: 1400px;
    margin: 20px auto;
    padding: 20px;
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-card .website-ranking-container {
    flex: 1;
    text-align: center;
}

.result-card .action-buttons {
    display: flex;
    gap: 12px;
}

.scanner-text {
    position: absolute;
    left: 0;
    width: 100%;
    text-align: center;
    top: 50%;
    transform: translateY(-50%);
    color: #1a202c;
    z-index: 2;
    background-color: rgba(255, 255, 255, 0.8);
    padding: 8px;
}

.scan-progress {
    font-size: 15px;
    margin-bottom: 8px;
    font-weight: 500;
}

@keyframes scan {
    0% {
        top: 0;
    }
    50% {
        top: 100%;
    }
    100% {
        top: 0;
    }
}

/* Responsive design */
@media (max-width: 992px) {
    .info-card {
        flex-direction: column;
        align-items: flex-start;
    }

    .website-ranking-container {
        margin: 16px 0;
    }

    .info-card .subscription-details {
        flex-direction: column;
        align-items: flex-start;
    }

    .overview-summary {
        flex-direction: column;
    }

    .score-circle {
        margin-right: 0;
        margin-bottom: 16px;
    }

    .module-scores-container {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .input-group {
        flex-direction: column;
    }

    .input-group input[type="text"] {
        margin-bottom: 12px;
    }

    .primary-btn {
        margin-left: 0;
    }

    .analysis-content {
        flex-direction: column;
    }

    .module-panel {
        width: 100%;
        margin-right: 0;
        margin-bottom: 16px;
        padding: 12px 0;
        height: auto;
    }

    .module-panel.collapsed {
        width: 100%;
    }

    .module-list {
        display: flex;
        overflow-x: auto;
        padding-bottom: 8px;
    }

    .module-item {
        padding: 8px 12px;
        flex-direction: column;
        text-align: center;
        border-left: none;
        border-bottom: 4px solid transparent;
    }

    .module-icon {
        margin-right: 0;
        margin-bottom: 4px;
    }

    .module-item:hover, .module-item.active {
        border-left-color: transparent;
        border-bottom-color: #38a169;
    }

    .module-label {
        font-size: 12px;
    }
}

@media (max-width: 576px) {
    .subscription-details {
        flex-direction: column;
        align-items: flex-start;
    }

    .url-analysis-row {
        flex-direction: column;
    }

    .url-analysis-row input[type="text"] {
        margin-bottom: 12px;
    }

    .module-score {
        flex-direction: column;
    }

    .score-circle {
        margin-bottom: 16px;
    }
}




/* Real Glass View for Complete Module Section */
.module-section.glass-view {
    aspect-ratio: 16 / 9;
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 16px;


}

.module-section.glass-view::before {
    content: '';
    position: absolute;
    border-radius: 16px;

    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: var(--module-bg-image);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    filter: blur(8px);
    transform: scale(1.1);
    z-index: 1;
}

.module-section.glass-view::after {
    content: '';
    position: absolute;
    border-radius: 16px;

    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    z-index: 2;
}

.module-section.glass-view .glass-overlay-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 3;
    text-align: center;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 600;
    font-size: 18px;
    text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    background: rgba(255, 255, 255, 0.1);
    padding: 30px;
    border-radius: 16px;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255, 255, 255, 0.2);
}
