/* Test Results Styles */

/* Results Header */
.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
}

.results-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Tabs Navigation */
.results-tabs {
    display: flex;
    flex-wrap: wrap;
    background-color: var(--light-gray);
    border-radius: var(--border-radius);
    padding: 0.25rem;
    gap: 0.25rem;
}

.tab-button {
    padding: 0.5rem 1rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.875rem;
    cursor: pointer;
    transition: var(--transition);
    border: none;
    background: transparent;
    min-width: 100px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

.tab-button:hover:not(.active-tab) {
    background-color: rgba(0, 0, 0, 0.05);
    color: var(--primary-color);
}

.tab-button.active-tab {
    background-color: white;
    box-shadow: var(--box-shadow-sm);
    color: var(--primary-color);
    font-weight: 500;
    border-bottom: 2px solid var(--primary-color);
}

.tab-button i {
    margin-right: 0.5rem;
    font-size: 1rem;
}

/* Status Messages */
.result-status {
    padding: 1rem;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.result-status.success {
    background-color: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.result-status.error {
    background-color: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.status-header {
    display: flex;
    align-items: center;
}

.status-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.status-icon.success {
    color: var(--success-color);
}

.status-icon.error {
    color: var(--error-color);
}

.status-title {
    font-weight: 600;
}

.status-title.success {
    color: var(--success-color);
}

.status-title.error {
    color: var(--error-color);
}

.suggestion {
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    font-size: 0.875rem;
    color: var(--text-color);
}

/* Log Window */
.log-window {
    background-color: #f8fafc;
    border: 1px solid var(--medium-gray);
    border-radius: var(--border-radius);
    height: 24rem;
    overflow-y: auto;
    padding: 1rem;
}

.log-entry {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    margin-bottom: 0.25rem;
    padding: 0.25rem 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
}

.log-error {
    color: var(--error-color);
    font-weight: 500;
}

.log-success {
    color: var(--success-color);
    font-weight: 600;
}

/* HTML/Code Viewer */
.html-viewer {
    height: 24rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

.html-header {
    background-color: #1e293b;
    color: #f8fafc;
    padding: 0.75rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.html-title {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.target-url-display {
    margin-left: 0.5rem;
    font-family: var(--font-mono);
    font-size: 0.75rem;
    opacity: 0.8;
    max-width: 300px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.header-buttons {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.copy-button {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    font-size: 0.75rem;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.expand-button {
    background-color: rgba(255, 255, 255, 0.1);
    color: #e5e7eb;
    font-size: 0.75rem;
    padding: 0.25rem;
    width: 30px;
    height: 30px;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    transition: var(--transition);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.copy-button:hover, .expand-button:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.expanded-viewer, .expanded-container {
    height: 48rem !important; /* Double the default height */
    transition: height 0.3s ease;
}

.html-content {
    background-color: #0f172a;
    color: #e2e8f0;
    padding: 1rem;
    height: calc(100% - 3rem);
    overflow-y: auto;
}

.rendered-html-content {
    padding: 0;
    background-color: white;
}

.rendered-iframe {
    width: 100%;
    height: 100%;
    border: none;
    background-color: white;
}

.html-code {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    line-height: 1.5;
    white-space: pre-wrap;
    margin: 0;
}

/* Code highlighting */
.code-content {
    background-color: #1e1e1e;
    color: #d4d4d4;
}

.code-content .html-code {
    color: #d4d4d4;
}

/* JSON styling */
.json-content {
    background-color: #002b36;
    color: #839496;
}

.json-code {
    color: #839496;
}

.json-key {
    color: #268bd2;
}

.json-string {
    color: #2aa198;
}

.json-number {
    color: #d33682;
}

.json-boolean {
    color: #cb4b16;
}

.json-null {
    color: #dc322f;
}

.json-item {
    margin-bottom: 1.5rem;
    background-color: rgba(7, 54, 66, 0.3);
    border-radius: 6px;
    overflow: hidden;
}

.json-title {
    font-size: 1rem;
    color: #93a1a1;
    margin: 0;
    font-family: var(--font-mono);
    background-color: #073642;
    padding: 0.6rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.json-name {
    font-weight: 600;
    color: #2aa198;
}

.json-size {
    font-size: 0.8rem;
    color: #839496;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.5rem;
    border-radius: 4px;
}

.json-message {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: rgba(42, 161, 152, 0.1);
    border-left: 3px solid #2aa198;
    padding: 0.8rem 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
    color: #93a1a1;
}

.json-message i {
    color: #2aa198;
    font-size: 1.25rem;
}

.json-message p {
    margin: 0;
    font-size: 0.9rem;
}

.json-not-found {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    color: #586e75;
    gap: 1rem;
}

/* Media tab */
.media-container {
    margin-bottom: 2rem;
}

.media-container h3 {
    font-size: 1.1rem;
    color: #93a1a1;
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.media-urls li {
    padding: 0.5rem 0;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
}

.media-preview-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.media-preview-container:hover {
    background-color: rgba(255, 255, 255, 0.05);
}

.preview-icon {
    margin-left: 0.5rem;
    color: #2aa198;
    opacity: 0.7;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.media-preview-container:hover .preview-icon {
    opacity: 1;
    transform: scale(1.2);
}

.media-url {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: #2aa198;
    overflow-wrap: break-word;
    word-break: break-all;
    flex: 1;
}

.media-alt, .media-type {
    font-size: 0.75rem;
    color: #839496;
    background-color: rgba(0, 0, 0, 0.2);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    margin-left: 0.5rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 150px;
}

.no-media {
    color: #586e75;
    font-style: italic;
}

/* Media preview overlay */
.media-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.85);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.media-preview-content {
    background-color: #0a1929;
    border-radius: 8px;
    width: 90%;
    max-width: 1200px;
    height: 90%;
    max-height: 800px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: scaleIn 0.3s ease;
}

@keyframes scaleIn {
    from { transform: scale(0.9); }
    to { transform: scale(1); }
}

.media-preview-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #162b3d;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.media-preview-title {
    margin: 0;
    color: #e5e7eb;
    font-size: 1.1rem;
    font-weight: 600;
}

.media-preview-close {
    background: none;
    border: none;
    color: #e5e7eb;
    font-size: 1.2rem;
    cursor: pointer;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.media-preview-close:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.media-preview-body {
    flex: 1;
    padding: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: auto;
}

.media-preview-info {
    padding: 1rem;
    background-color: #162b3d;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    word-break: break-all;
}

.media-preview-url {
    color: #2aa198;
    text-decoration: none;
}

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

.media-preview-image-container,
.media-preview-video-container,
.media-preview-iframe-container,
.media-preview-audio-container {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.media-preview-image {
    max-width: 100%;
    max-height: 70vh;
    object-fit: contain;
    border-radius: 4px;
}

.media-preview-video,
.media-preview-iframe {
    width: 100%;
    height: 70vh;
    max-height: 70vh;
    border-radius: 4px;
    background-color: #000;
}

.media-preview-audio {
    width: 100%;
    max-width: 500px;
}

.media-preview-caption {
    margin-top: 1rem;
    color: #93a1a1;
    font-style: italic;
    text-align: center;
}

.media-preview-provider {
    margin-top: 0.5rem;
    color: #586e75;
    font-size: 0.8rem;
}

/* Log container */
.log-container {
    height: 24rem;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
}

/* Media queries */
@media (max-width: 768px) {
    .results-tabs {
        width: 100%;
    }
    
    .tab-button {
        flex-grow: 1;
        min-width: auto;
    }
    
    .results-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .results-tabs {
        margin-top: 1rem;
        width: 100%;
    }
}