/* SEO Test Form Styles */

.seo-test-form-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: 'Poppins', sans-serif;
    background: #fff;
}

/* Header */
.form-header {
    margin-bottom: 30px;
}

.header-back {
    margin-bottom: 15px;
}

.btn-back {
    color: #7B7DFE;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s ease;
}

.btn-back:hover {
    color: #6B6DEE;
    text-decoration: none;
    transform: translateX(-3px);
}

/* Input with Validation Icon */
.input-with-validation {
    position: relative;
}

.validation-icon {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    z-index: 10;
    pointer-events: none;
}

.input-with-validation .form-control {
    padding-right: 40px;
}

/* Form Validation Error */
.form-validation-error {
    background: #fff5f5;
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 12px 16px;
    margin-bottom: 20px;
    color: #FC554F;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.form-validation-error::before {
    content: "⚠️";
    margin-right: 8px;
    font-size: 16px;
}

/* Disabled Button Styles */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background-color: #9ca3af;
    border-color: #9ca3af;
}

.btn:disabled:hover {
    background-color: #9ca3af;
    border-color: #9ca3af;
    transform: none;
}

.seo-test-header {
    text-align: center;
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

.seo-test-header h2 {
    color: #000;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.seo-test-header p {
    color: #666;
    font-size: 16px;
    margin: 0;
}

.seo-test-form {
    border-radius: 12px;
    padding: 5px;
}

/* Form Sections */
.form-section {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid rgba(102, 126, 234, 0.05);
}

.form-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.form-section h3 {
    color: #000;
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 25px;
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(102, 126, 234, 0.1);
}

/* Form Layout */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 25px;
}

/* 3-column layout for GSC, Device, Country */
.form-row.three-columns {
    grid-template-columns: 1fr 1fr 1fr;
    gap: 20px;
}

.form-row:last-child {
    margin-bottom: 0;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    color: #000;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-control {
    width: 100%;
    padding: 16px !important;
    border: 2px solid #e9ecef !important;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f8f9fa;
    color: #676d8a !important;
    outline: none;
}

#start_date {
    padding-right: 40px !important;
}
.form-control:focus {
    border-color: #7B7DFE;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(123, 125, 254, 0.1);
    transform: translateY(-1px);
}

.form-control::placeholder {
    color: #adb5bd;
}

/* Select styling */
.form-control select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='m6 8 4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 12px center;
    background-repeat: no-repeat;
    background-size: 16px;
    padding-right: 40px;
}

/* Textarea styling */
.form-control textarea {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

/* Form Help */
.form-help {
    display: block;
    margin-top: 8px;
    font-size: 13px;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 10px;
}

/* GSC Connection */
.gsc-not-connected {
    padding: 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    text-align: center;
}

.gsc-not-connected p {
    color: #6c757d;
    margin-bottom: 15px;
    font-weight: 500;
}

.btn-connect-gsc {
    display: inline-block;
    background: linear-gradient(90deg, #7B7DFE 0%, #B16CFE 100%);
    color: #fff;
    text-decoration: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-connect-gsc:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(123, 125, 254, 0.3);
    color: #fff;
    text-decoration: none;
}

/* URL Preview */
.url-preview {
    margin-top: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    justify-content: flex-end;
}

.url-preview a {
    color: #7B7DFE;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
}

.url-preview a:hover {
    text-decoration: underline;
}

.urls-count {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.urls-count.loading {
    background: #e3f2fd;
    color: #7B7DFE;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Queries Input Container */
.queries-input-container {
    margin-top: 25px;
    padding: 20px;
    background: #f8f9ff;
    border: 2px solid #e3f2fd;
    border-radius: 8px;
    animation: slideDown 0.3s ease;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* URLs Summary */
.urls-summary {
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 25px;
    margin: 30px 0;
    animation: slideDown 0.3s ease;
}

.urls-summary h3 {
    color: #495057;
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.urls-summary h3::before {
    content: '📊';
    font-size: 20px;
}

.summary-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.stat-item {
    background: white;
    padding: 15px;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.stat-label {
    color: #6c757d;
    font-weight: 500;
}

.stat-value {
    color: #495057;
    font-weight: 700;
    font-size: 16px;
}

.stat-gsc {
    margin-left: 8px;
    font-size: 12px;
    font-weight: normal;
    color: #7B7DFE;
}

.summary-details {
    margin-top: 25px;
    padding-top: 25px;
    border-top: 1px solid #dee2e6;
}

.details-section {
    margin-bottom: 25px;
}

.details-section h4 {
    color: #495057;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.urls-list {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    padding: 15px;
    max-height: 200px;
    overflow-y: auto;
}

.urls-list-items {
    list-style: none;
    padding: 0;
    margin: 0;
}

.url-item {
    padding: 8px 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    margin-bottom: 8px;
    font-family: 'Courier New', monospace;
    font-size: 13px;
    color: #495057;
    word-break: break-all;
}

.url-item:last-child {
    margin-bottom: 0;
}

.no-urls {
    color: #FC554F;
    text-align: center;
    padding: 20px;
    margin: 0;
}

.more-urls {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    margin: 10px 0 0 0;
    font-size: 13px;
}

.summary-actions {
    text-align: center;
    margin: 20px 0;
}

.validation-messages {
    margin-top: 20px;
}

.validation-errors,
.validation-warnings,
.validation-success {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 10px;
}

.validation-errors {
    background: #fff5f5;
    border: 1px solid #fecaca;
    color: #FC554F;
}

.validation-warnings {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.validation-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.validation-error,
.validation-warning {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.validation-error:last-child,
.validation-warning:last-child {
    margin-bottom: 0;
}

/* URLs Tables */
.urls-table-container {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    overflow: hidden;
    max-height: 300px;
    overflow-y: auto;
}

.urls-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.urls-table thead {
    background: #f8f9fa;
    position: sticky;
    top: 0;
    z-index: 10;
}

.urls-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #495057;
    border-bottom: 2px solid #dee2e6;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.urls-table td {
    padding: 10px 15px;
    border-bottom: 1px solid #f1f3f4;
    vertical-align: top;
}

.url-cell {
    font-family: 'Courier New', monospace;
    word-break: break-all;
    color: #495057;
    max-width: 400px;
}

.status-cell {
    text-align: center;
    width: 120px;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.status-individual {
    background: #e3f2fd;
    color: #1976d2;
    border: 1px solid #bbdefb;
}

.status-gsc {
    background: #f3e5f5;
    color: #7b1fa2;
    border: 1px solid #e1bee7;
}

.status-duplicate {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ffcdd2;
}

.row-duplicate {
    background-color: #fff5f5 !important;
}

.row-duplicate .url-cell {
    color: #c62828;
    font-weight: 500;
}

.no-urls {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 20px;
}

.more-urls {
    text-align: center;
    color: #6c757d;
    font-style: italic;
    padding: 10px;
    font-size: 12px;
}

/* Metrics Grid */
.metric-question {
    color: #495057;
    font-size: 15px;
    margin-bottom: 20px;
    font-weight: 500;
}

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.metric-option {
    position: relative;
    cursor: pointer;
}

.metric-option input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.metric-button {
    display: block;
    padding: 16px 20px;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-align: center;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
    cursor: pointer;
}

.metric-option:hover .metric-button {
    border-color: #7B7DFE;
    background: #f8f9ff;
    transform: translateY(-1px);
}

.metric-option input[type="radio"]:checked + .metric-button {
    border-color: #7B7DFE;
    background: #7B7DFE;
    color: #fff;
    box-shadow: 0 4px 15px rgba(123, 125, 254, 0.3);
}

.metric-button {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.metric-option {
    position: relative;
    z-index: 1;
}

.metric-option:hover {
    z-index: 1000;
}

.metric-recommended-icon {
    color: #F6A228;
    font-size: 14px;
    margin-left: 4px;
}

.metric-tooltip-icon {
    position: relative;
    display: inline-flex;
    align-items: center;
    cursor: help;
    color: #6c757d;
    font-size: 12px;
    margin-left: 4px;
    transition: color 0.2s ease;
}

.metric-option input[type="radio"]:checked + .metric-button .metric-tooltip-icon {
    color: rgba(255, 255, 255, 0.9);
}

.metric-tooltip-icon:hover {
    color: #7B7DFE;
}

.metric-option input[type="radio"]:checked + .metric-button .metric-tooltip-icon:hover {
    color: rgba(255, 255, 255, 1);
}

.metric-tooltip-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 8px;
    padding: 10px 12px;
    background: #1f2937;
    color: #fff;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.5;
    white-space: pre-line;
    width: max-content;
    max-width: 300px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10002;
    word-wrap: break-word;
    text-transform: none;
}

.metric-tooltip-icon::before {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    margin-top: 2px;
    border: 6px solid transparent;
    border-bottom-color: #1f2937;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 10003;
}

.metric-tooltip-icon:hover::after,
.metric-tooltip-icon:hover::before {
    opacity: 1;
}

/* Form Actions */
.form-actions {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin-top: 40px;
    padding-top: 30px;
    border-top: 2px solid rgba(102, 126, 234, 0.1);
}

/* Confidence Score */
.confidence-score-container {
    margin-top: 30px;
    padding: 20px;
    background: #f8f9ff;
    border: 2px solid #e3f2fd;
    border-radius: 8px;
}

.confidence-score-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.confidence-label {
    font-weight: 600;
    color: #495057;
    font-size: 15px;
}

.confidence-score-value {
    font-size: 32px;
    font-weight: 700;
    color: #7B7DFE;
    line-height: 1;
}

.confidence-max {
    font-size: 18px;
    color: #6c757d;
    font-weight: 500;
}

.confidence-score-details {
    margin-top: 15px;
}

.confidence-breakdown {
    font-size: 13px;
    color: #495057;
}

.confidence-base {
    margin-bottom: 8px;
    font-weight: 600;
    color: #495057;
}

.confidence-bonus {
    margin-bottom: 6px;
    padding-left: 15px;
    color: #24C789;
    font-weight: 500;
}

.confidence-note {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e3f2fd;
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
}

.btn {
    padding: 16px 32px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 180px;
}

.btn-primary {
    background: #7B7DFE;
    color: #fff;
    box-shadow: 0 4px 15px rgba(123, 125, 254, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(123, 125, 254, 0.4);
}

.btn-secondary {
    background: #fff;
    color: #000;
    border: 2px solid #000;
}

.btn-secondary:hover {
    background: #e9ecef;
    border-color: #000;
}

/* Messages */
.form-messages {
    margin-top: 20px;
    display: none;
}

.message {
    padding: 15px 20px;
    border-radius: 8px;
    font-weight: 500;
    margin-bottom: 10px;
}

.message-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.message-info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

/* Error States */
.seo-test-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .seo-test-form-container {
        padding: 15px;
    }
    
    .seo-test-form {
        padding: 25px;
    }
    
    .form-row {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .metrics-grid {
        grid-template-columns: 1fr;
    }
    
    .form-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 100%;
        max-width: 300px;
    }
}

@media (max-width: 480px) {
    .seo-test-header h2 {
        font-size: 24px;
    }
    
    .form-section h3 {
        font-size: 18px;
    }
    
    .seo-test-form {
        padding: 20px;
    }
}
