/* style.css */
/* Base Styles */
:root {
    --primary-color: #5e72e4;
    --success-color: #2dce89;
    --warning-color: #fb6340;
    --danger-color: #f5365c;
    --info-color: #11cdef;
    --dark-color: #172b4d;
    --light-color: #f8f9fe;
    --background-gradient: linear-gradient(87deg, #5e72e4 0, #825ee4 100%);

    /* New Variables for CTAs and Meta Section */
    --cta-primary-bg: #FF6B00;
    --cta-primary-hover-bg: #E05A00;
    --cta-secondary-bg: var(--success-color); /* Use existing success color */
    --cta-secondary-hover-bg: #26af74;
    --meta-section-bg: var(--light-color); /* Use existing light color */
    --meta-section-border: #e9ecef;
    --meta-section-accent-border: var(--primary-color); /* Use existing primary color */
    --button-border-radius: 5px;
    --box-shadow-button: 0 4px 6px rgba(0, 0, 0, 0.1);
    --box-shadow-button-hover: 0 6px 8px rgba(0, 0, 0, 0.15);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Helvetica Neue', Arial, sans-serif;
}

body {
    background-color: #f8f9fe;
    color: #525f7f;
    font-size: 16px;
    line-height: 1.6;
}

.container {
    max-width: 1140px;
    margin: 0 auto;
    padding: 30px 15px;
}

/* Header Styles */
.report-header {
    position: relative;
    padding: 30px;
    margin-bottom: 30px;
    border-radius: 8px;
    background: var(--background-gradient);
    color: white;
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.report-header h1 {
    font-size: 1.8rem;
    font-weight: 600;
    margin: 20px 0 10px;
}

.report-date {
    font-size: 0.9rem;
    opacity: 0.8;
}

.back-button {
    display: inline-block;
    color: white;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.back-button:hover {
    opacity: 1;
}

/* Metrics Grid */
.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.metric-card {
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    box-shadow: 0 0 2rem 0 rgba(136, 152, 170, 0.15);
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.metric-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 7px 14px rgba(50, 50, 93, 0.1), 0 3px 6px rgba(0, 0, 0, 0.08);
}

.metric-card h3 {
    font-size: 0.9rem;
    color: #8898aa;
    text-transform: uppercase;
    letter-spacing: 0.025em;
    margin-bottom: 10px;
    font-weight: 600;
}

.metric-value {
    font-size: 2.5rem;
    font-weight: 700;
    position: relative;
    display: inline-block;
}

/* Different colors for different metrics */
.metric-card:nth-child(1) .metric-value {
    color: var(--primary-color);
}

.metric-card:nth-child(2) .metric-value {
    color: var(--success-color);
}

.metric-card:nth-child(3) .metric-value {
    color: var(--warning-color);
}

/* Section Styles */
.optimization-section,
.notes-section,
.issues-section,
.recommendations-section,
.screenshots-section,
.s3-images-section
{
    background-color: white;
    border-radius: 8px;
    padding: 25px;
    margin-bottom: 30px;
    box-shadow: 0 0 2rem 0 rgba(136, 152, 170, 0.15);
}

.optimization-section h2,
.notes-section h2,
.issues-section h2,
.recommendations-section h2,
.screenshots-section h2,
.s3-images-section h2
{
    color: var(--dark-color);
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
    padding-bottom: 15px;
}

/* Status Grid and Items */
.status-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
}

.status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    background-color: #f8f9fe;
    border-radius: 6px;
    border-left: 4px solid var(--primary-color);
    flex-wrap: wrap; /* Allow wrapping within the item if needed */
    gap: 10px; /* Add gap between label/value div and button */
}

/* Optional: Style for the status item containing only the button */
.status-item-button-only {
    justify-content: center; /* Center the button horizontally */
    background-color: transparent; /* Make container invisible */
    border: none; /* Remove container border */
    padding: 0; /* Remove container padding */
}

/* Ensure button doesn't get unwanted padding/margin from container */
.status-item-button-only .meta-fix-button {
     margin: 0; /* Reset any margins if needed */
}

.status-label {
    font-weight: 600;
    color: #525f7f;
    white-space: nowrap; /* Keep label on one line */
    margin-right: 10px; /* Space between label and value */
}

.status-value {
    font-weight: 700;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    text-transform: uppercase;
}

/* Specific Status Value Styling (Examples) */
/* Style "No" status with red for SEO Friendly */
.optimization-section .status-grid .status-item:nth-child(1) .status-value { /* More specific selector */
    background-color: #fcd3d3;
    color: var(--danger-color);
}
/* Style "Yes" status with red for CSS Issues */
.optimization-section .status-grid .status-item:nth-child(2) .status-value { /* More specific selector */
    background-color: #fcd3d3;
    color: var(--danger-color);
}
/* Style "No" status with red for Meta Title Keyword in Issues section */
.issues-section .status-grid .status-item .status-value { /* Specific to issues section */
    background-color: #fcd3d3;
    color: var(--danger-color);
}
/* Style "Yes" status with green for Meta Title Keyword in Issues section */
.issues-section .status-grid .status-item .status-value:not(:contains('No')) { /* If value is not 'No' */
     background-color: #cdf5e1; /* Light green */
     color: var(--success-color);
}


/* Notes Section */
.notes-section p {
    padding: 15px;
    background-color: #f8f9fe;
    border-radius: 6px;
    border-left: 4px solid var(--info-color);
    font-style: italic;
}

/* Original Issues List (if used) */
.issues-list {
    list-style: none;
    padding: 0;
}
.issue-item {
    display: flex;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.issue-item:last-child {
    border-bottom: none;
}
.issue-severity {
    padding: 3px 8px;
    border-radius: 4px;
    margin-right: 15px;
    font-size: 0.8em;
    font-weight: bold;
    color: white;
    text-transform: capitalize;
}
.issue-severity.high { background-color: var(--danger-color); }
.issue-severity.medium { background-color: var(--warning-color); }
.issue-severity.low { background-color: var(--info-color); }
.issue-description {
    flex: 1;
}

/* Recommendations Section */
.recommendations-list {
    list-style: disc;
    padding-left: 20px;
}
.recommendation-item {
    margin-bottom: 10px;
}

/* Screenshots & S3 Images Section */
.screenshots-grid, .s3-images-grid {
    display: grid;
    /* Adjust the minmax value here */
    grid-template-columns: repeat(auto-fill, minmax(768px, 1fr)); /* Increased from 250px */
    gap: 20px;
}

.screenshot-container img, .s3-image-container img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Loading Page Styles */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    padding: 30px;
}

.spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid var(--primary-color);
    border-radius: 50%;
    width: 60px;
    height: 60px;
    animation: spin 1.5s linear infinite;
    margin-bottom: 30px;
}

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

.loading-message {
    margin-bottom: 20px;
    font-size: 1.2rem;
    color: var(--dark-color);
}

.loading-details {
    color: #8898aa;
    font-style: italic;
    margin-bottom: 30px;
}

.progress-bar {
    width: 300px;
    max-width: 90%;
    height: 8px;
    background-color: #f3f3f3;
    border-radius: 4px;
    margin-bottom: 10px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: var(--background-gradient);
    border-radius: 4px;
    transition: width 0.5s ease;
}

.error-message {
    color: var(--danger-color);
    display: none;
    margin-top: 20px;
    padding: 15px;
    border-left: 4px solid var(--danger-color);
    background-color: #fcd3d3;
    width: 100%;
    max-width: 500px;
    text-align: left;
}

/* Specific Loader Animation (.load-1) */
.load-wrapp {
    width: 100px;
    height: 60px;
    margin: 20px auto;
    text-align: center;
}

.line {
    display: inline-block;
    width: 15px;
    height: 15px;
    border-radius: 15px;
    background-color: var(--primary-color);
    margin: 0 2px;
}

.load-1 .line:nth-last-child(1) { animation: loadingA 1.5s 1s infinite; }
.load-1 .line:nth-last-child(2) { animation: loadingA 1.5s 0.5s infinite; }
.load-1 .line:nth-last-child(3) { animation: loadingA 1.5s 0s infinite; }

@keyframes loadingA {
    0% { height: 15px; background-color: var(--primary-color); }
    50% { height: 35px; background-color: var(--info-color); }
    100% { height: 15px; background-color: var(--primary-color); }
}

.error-message a.back-button {
    color: var(--danger-color);
    text-decoration: underline;
    font-weight: bold;
    opacity: 1;
}
.error-message a.back-button:hover { color: var(--dark-color); }

/* Loading Overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 1;
    transition: opacity 0.3s ease-out;
}


/* --- START: CTA and Meta Title Section Styles --- */

/* Main CTA Button Container */
.cta-container {
    text-align: center;
    margin: 30px 0;
    padding: 15px;
}

/* Main CTA Button */
.cta-button {
    display: inline-block;
    background-color: var(--cta-primary-bg);
    color: white;
    font-size: 18px;
    font-weight: 600;
    text-align: center;
    padding: 15px 30px;
    border-radius: var(--button-border-radius);
    text-decoration: none;
    transition: background-color 0.3s ease, box-shadow 0.3s ease; /* Keep only non-transform transitions */
    box-shadow: var(--box-shadow-button);
    border: none;
    cursor: pointer;
    transform-origin: center center; /* Ensure scaling originates from the middle */
}

.cta-button:hover {
    background-color: var(--cta-primary-hover-bg);
    box-shadow: var(--box-shadow-button-hover);
    /* Change the animation for a single zoom */
    animation-name: pulse; /* Use the same keyframes */
    animation-duration: 0.6s; /* Make it quicker */
    animation-timing-function: ease-out; /* Smooth out */
    animation-iteration-count: 1; /* Run only once */
    animation-fill-mode: forwards; /* Stay zoomed while hovered */
}

/* Secondary CTA Button (Meta Fix) */
.meta-fix-button {
    display: inline-block;
    background-color: var(--cta-secondary-bg);
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    padding: 12px 20px;
    border-radius: var(--button-border-radius);
    text-decoration: none;
    transition: all 0.3s ease;
    box-shadow: var(--box-shadow-button);
    border: none;
    cursor: pointer;
    flex-shrink: 0;
    /* margin-left: 20px; /* Spacing from label/value */
    transform-origin: center center;
}

.meta-fix-button:hover {
    background-color: var(--cta-secondary-hover-bg);
    /* transform: translateY(-2px); */ /* Remove or comment out translateY */
    box-shadow: var(--box-shadow-button-hover);
    /* Add the infinite pulse animation */
    animation: pulse 1s infinite;
    animation-timing-function: linear; /* Or ease-in-out if you prefer */
    transform-origin: center center; /* Ensure scaling is centered */
}

/* --- END: CTA and Meta Title Section Styles --- */


/* --- START: Animation Keyframes --- */

@keyframes pulse {
  0% { transform: scale(1); }
  50% { transform: scale(1.1); }
  100% { transform: scale(1); }
}

/* --- END: Animation Keyframes --- */


/* --- START: Responsive Adjustments --- */
@media (max-width: 768px) {
    .metrics-grid,
    .status-grid {
        grid-template-columns: 1fr;
    }

    .report-header h1 {
        font-size: 1.5rem;
    }

    .screenshots-grid, .s3-images-grid {
        grid-template-columns: 1fr; /* Stack images */
    }

    /* Adjust buttons for mobile */
    .cta-button, .meta-fix-button {
        width: 100%;
        font-size: 16px;
        padding: 12px 20px;
        margin-top: 10px; /* Add margin when stacked */
        margin-left: 0; /* Reset left margin for meta-fix-button */
    }

    /* Remove the extra margin-bottom for the removed div */
    /* .issues-section .status-item > div {
        margin-bottom: 10px;
    } */

    .meta-fix-button {
         margin-top: 10px; /* Ensure margin-top applies on mobile */
    }

    .cta-container {
        margin-top: 20px;
        padding: 0; /* Remove padding if button is full width */
    }

    /* Optional: Disable pulse on mobile hover */
    /* .cta-button:hover {
        animation: none;
    } */
}
/* --- END: Responsive Adjustments --- */
