/*--------------------------------------------------------------
>>> TABLE OF CONTENTS:
----------------------------------------------------------------
# General Container & Typography
# Header & Form
# Loader / Spinner
# Results Display
  ## Score Card & Chart
  ## Results Grid & Info Cards
  ## Keywords Section (Blurred)
# Call-to-Action (CTA) Section
# Lead Capture Modal
# Utility & Helper Classes
# Responsive Design
--------------------------------------------------------------*/

/*--------------------------------------------------------------
# General Container & Typography
--------------------------------------------------------------*/
.aisa-container {
    max-width: 800px;
    margin: 40px auto;
    padding: 40px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    text-align: center;
    font-family: 'Inter', sans-serif;
    color: #333;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

/*--------------------------------------------------------------
# Header & Form
--------------------------------------------------------------*/
.aisa-header h2 {
    font-family: 'Bruno Ace', sans-serif;
    font-size: 2.5rem;
    color: #1e1e1e;
    margin-top: 0;
    margin-bottom: 10px;
    line-height: 1.2;
}

.aisa-header .aisa-highlight {
    background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.aisa-header p {
    font-size: 1.1rem;
    color: #666;
    max-width: 600px;
    margin: 0 auto 30px auto;
    line-height: 1.6;
}

#aisa-form {
    display: flex;
    flex-direction: column; /* Stack rows and button */
    gap: 15px;
}

/* --- NEW ---: Container for input and select */
.aisa-form-row {
    display: flex;
    gap: 10px;
}

#aisa-form input[type="url"] {
    flex-grow: 1;
    padding: 15px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s, box-shadow 0.2s;
    min-width: 0; /* Fix for flexbox overflow */
}

/* --- NEW ---: Styling for the category dropdown */
.aisa-category-select {
    padding: 15px 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    width: 200px; /* Set a default width */
    flex-shrink: 0; /* Prevent the select from shrinking */
}

#aisa-form input[type="url"]:focus,
.aisa-category-select:focus {
    border-color: #6a11cb;
    box-shadow: 0 0 0 3px rgba(106, 17, 203, 0.15);
    outline: none;
}

#aisa-form button {
    padding: 15px 30px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    font-size: 1rem;
    font-weight: bold;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    font-family: 'Anta', sans-serif;
}

#aisa-form button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.aisa-form-footer {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-top: 15px;
    font-size: 0.9rem;
    color: #888;
}

.aisa-form-footer span::before {
    content: '✓';
    color: #28a745;
    margin-right: 6px;
    font-weight: bold;
}

/*--------------------------------------------------------------
# Loader / Spinner
--------------------------------------------------------------*/
#aisa-loader {
    margin-top: 40px;
    padding: 20px;
}

.aisa-spinner {
    border: 6px solid #f3f3f3;
    border-top: 6px solid #6a11cb;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: aisa-spin 1s linear infinite;
    margin: 0 auto 15px auto;
}

#aisa-loader-text {
    font-size: 1.1rem;
    color: #555;
    font-family: 'Anta', sans-serif;
}

@keyframes aisa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/*--------------------------------------------------------------
# Results Display
--------------------------------------------------------------*/
#aisa-results {
    margin-top: 40px;
    text-align: left;
}

.aisa-card-section-title {
    font-family: 'Anta', sans-serif;
    text-align: center;
    font-size: 1.8rem;
    margin-bottom: 20px;
    color: #1e1e1e;
    word-break: break-word;
}

/* ## Score Card & Chart */
#aisa-score-card {
    text-align: center;
    padding: 30px;
    margin-bottom: 40px;
}

#aisa-score-chart-container {
    max-width: 200px;
    margin: 0 auto;
}

.aisa-score-summary {
    max-width: 600px;
    margin: 20px auto 0 auto;
    color: #555;
    line-height: 1.6;
}

/* ## Results Grid & Info Cards */
.aisa-results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
}

.aisa-card {
    background: #f9f9f9;
    padding: 20px;
    border-radius: 8px;
    border-left: 5px solid #6a11cb;
}

.aisa-card.good { border-color: #28a745; }
.aisa-card.warning { border-color: #ffc107; }
.aisa-card.bad { border-color: #dc3545; }

.aisa-card h4 {
    margin: 0 0 10px 0;
    font-family: 'Anta', sans-serif;
    color: #333;
}

.aisa-card p {
    margin: 0;
    font-size: 1.5rem;
    font-weight: bold;
    color: #1e1e1e;
    word-wrap: break-word;
    word-break: break-word;
}

.aisa-card .aisa-card-meta {
    font-size: 0.85rem;
    color: #777;
    font-weight: normal;
    margin-top: 5px;
    display: block;
}

/* ## Keywords Section (Blurred) */
/* --- NEW --- */
.aisa-keywords-section {
    margin-top: 40px;
    padding: 30px;
    background-color: #fffaf1;
    border: 1px solid #ffecb3;
    border-radius: 12px;
    text-align: center;
}
.aisa-keywords-section p {
    color: #555;
    margin-bottom: 20px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}
.aisa-keywords-list {
    list-style: none;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    user-select: none; /* Prevent text selection */
}
.aisa-keyword-item {
    background: #fff;
    border: 1px solid #ddd;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 500;
    filter: blur(4px); /* The blur effect */
    opacity: 0.8;
}

/*--------------------------------------------------------------
# Call-to-Action (CTA) Section
--------------------------------------------------------------*/
.aisa-cta-section {
    margin-top: 40px;
    padding: 40px;
    background-color: #f4f7ff;
    border: 1px solid #e0e7ff;
    border-radius: 12px;
    text-align: center;
}

.aisa-cta-section h3 {
    font-family: 'Konkhmer Sleokchher', cursive;
    font-size: 2rem;
    color: #1e1e1e;
    margin-top: 0;
    margin-bottom: 10px;
}

.aisa-cta-section p {
    color: #555;
    margin-bottom: 20px;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

.aisa-cta-section .aisa-features-list {
    list-style: none;
    padding: 0;
    margin: 25px 0;
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 15px;
}

.aisa-cta-section .aisa-features-list li {
    background: #fff;
    padding: 8px 15px;
    border-radius: 20px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    font-size: 0.9rem;
    border: 1px solid #eee;
}

.aisa-cta-section button,
.aisa-cta-section a {
    padding: 15px 40px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, #ff6b6b 0%, #feca57 100%);
    color: white;
    font-size: 1.2rem;
    font-weight: bold;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: transform 0.2s, box-shadow 0.2s;
}

.aisa-cta-section button:hover,
.aisa-cta-section a:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

/*--------------------------------------------------------------
# Lead Capture Modal
--------------------------------------------------------------*/
.aisa-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0,0,0,0.6);
    animation: fadeIn 0.3s ease-out;
}

.aisa-modal-content {
    background-color: #fefefe;
    margin: 10% auto;
    padding: 30px 40px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    text-align: center;
    position: relative;
    animation: slideIn 0.4s ease-out;
}

.aisa-modal-content h3 {
    font-family: 'Bruno Ace', sans-serif;
    margin-top: 0;
    margin-bottom: 10px;
}

.aisa-modal-content p {
    margin-top: 0;
    margin-bottom: 25px;
    color: #666;
}

.aisa-modal-close {
    color: #aaa;
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.aisa-modal-close:hover { color: #333; }

#aisa-lead-form input,
#aisa-lead-form select {
    box-sizing: border-box;
    width: 100%;
    padding: 12px 15px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    font-size: 1rem;
}

#aisa-lead-form button {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(45deg, #6a11cb 0%, #2575fc 100%);
    color: white;
    font-size: 1rem;
    cursor: pointer;
    transition: opacity 0.2s;
}

#aisa-lead-form button:hover { opacity: 0.9; }
#aisa-lead-form button:disabled { opacity: 0.6; cursor: not-allowed; }

#aisa-lead-response {
    margin-top: 15px;
    font-weight: bold;
    min-height: 1.2em;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideIn { from { transform: translateY(-30px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/*--------------------------------------------------------------
# Utility & Helper Classes
--------------------------------------------------------------*/
.aisa-hidden {
    display: none !important;
}

/*--------------------------------------------------------------
# Responsive Design
--------------------------------------------------------------*/
@media (max-width: 768px) {
    .aisa-container {
        padding: 20px;
    }

    .aisa-header h2 {
        font-size: 1.8rem;
    }

    /* --- UPDATED ---: Stack form row on mobile */
    .aisa-form-row {
        flex-direction: column;
        gap: 15px;
    }

    .aisa-category-select {
        width: 100%; /* Make dropdown full width on mobile */
    }

    #aisa-form button,
    .aisa-cta-section button,
    .aisa-cta-section a {
        white-space: normal;
        line-height: 1.4;
        padding: 12px 20px;
        font-size: 1rem;
    }
    
    .aisa-cta-section {
        padding: 30px 20px;
    }

    .aisa-modal-content {
        margin: 20% auto;
        padding: 25px 20px;
    }

    .aisa-card-section-title {
        font-size: 1.5rem;
    }

    .aisa-card p {
        font-size: 1.3rem;
    }
}