/* Global Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background:
        radial-gradient(circle at top left, rgba(118, 75, 162, 0.45), transparent 30%),
        radial-gradient(circle at bottom right, rgba(102, 126, 234, 0.35), transparent 25%),
        linear-gradient(135deg, #071a36 0%, #121a2c 25%, #1d2f45 100%);
    min-height: 100vh;
    padding: 24px;
    color: #eaf2ff;
}

.container {
    max-width: 1480px;
    margin: 0 auto;
}

/* Header */
.header {
    color: white;
    margin-bottom: 30px;
    background: rgba(10, 19, 35, 0.62);
    border: 1px solid rgba(148, 163, 184, 0.2);
    border-radius: 28px;
    padding: 28px 30px;
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    backdrop-filter: blur(8px);
}

.hero-shell {
    display: flex;
    flex-direction: column;
    gap: 22px;
}

.hero-topbar,
.panel-header,
.step-header,
.file-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
}

.logo-icon {
    width: 58px;
    height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    background: linear-gradient(135deg, #4f8cff 0%, #8a5cf6 100%);
    box-shadow: 0 20px 35px rgba(79, 140, 255, 0.45);
    font-size: 32px;
}

.logo h1 {
    margin: 0;
    font-size: 38px;
    font-weight: 800;
    line-height: 1.1;
    letter-spacing: -0.04em;
}

.tagline {
    font-size: 15px;
    opacity: 0.9;
    font-weight: 500;
    color: rgba(226, 232, 240, 0.9);
    margin-top: 6px;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 22px;
    align-items: center;
}

.eyebrow,
.section-kicker {
    letter-spacing: 0.12em;
    font-size: 11px;
    font-weight: 700;
    color: #8ec5ff;
    margin-bottom: 10px;
}

.hero-copy h2 {
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.1;
    margin-bottom: 12px;
    letter-spacing: -0.04em;
}

.hero-copy p:last-child {
    color: rgba(226, 232, 240, 0.84);
    max-width: 680px;
    font-size: 1rem;
}

.hero-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
}

.chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    border-radius: 999px;
    padding: 8px 12px;
    background: rgba(148, 163, 184, 0.1);
    border: 1px solid rgba(148, 163, 184, 0.2);
    color: #edf6ff;
}

.chip.success {
    background: rgba(34, 197, 94, 0.16);
    border-color: rgba(34, 197, 94, 0.4);
    color: #b7f7c7;
}

.hero-stats {
    display: grid;
    grid-template-columns: repeat(3, minmax(120px, 1fr));
    gap: 14px;
}

.stat-box {
    background: rgba(15, 23, 42, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    border-radius: 20px;
    padding: 18px 16px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    min-height: 120px;
}

.stat-label {
    color: #93c5fd;
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.stat-box strong {
    font-size: 1.8rem;
    font-weight: 800;
    color: #f8fbff;
}

.stat-box small {
    color: rgba(226, 232, 240, 0.7);
}

.modern-panel, .workflow-step, .status-log {
    background: rgba(15, 23, 42, 0.78);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: 0 18px 40px rgba(2, 6, 23, 0.18);
}

.modern-panel {
    border-radius: 24px;
    padding: 26px 28px;
    margin-bottom: 26px;
}

.panel-header h3 {
    font-size: 1.5rem;
    color: #f8fbff;
    margin-top: 6px;
}

/* Configuration Panel */
.config-panel {
    background: white;
    border-radius: 12px;
    padding: 25px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.config-panel h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 22px;
}

.config-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.config-item {
    display: flex;
    flex-direction: column;
}

.config-item label {
    color: #555;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
}

.config-item input {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s;
}

.config-item input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.3);
}

.btn-primary:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
    border: 1px solid #ddd;
}

.btn-secondary:hover {
    background: #e0e0e0;
}

.btn-success {
    background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%);
    color: white;
}

.btn-success:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(17, 153, 142, 0.3);
}

.btn-success:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-danger {
    background: #dc3545;
    color: white;
}

.btn-danger:hover {
    background: #c82333;
}

.btn-large {
    padding: 16px 32px;
    font-size: 16px;
}

/* Workflow Container */
.workflow-container {
    display: grid;
    gap: 20px;
    margin-bottom: 25px;
}

/* Workflow Step */
.workflow-step {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s;
}

.workflow-step.active {
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.2);
    border: 2px solid #667eea;
}

.step-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.step-number {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 18px;
}

.step-header h3 {
    color: #333;
    font-size: 20px;
}

.step-content {
    padding-left: 55px;
}

/* Upload Area */
.upload-area {
    border: 3px dashed #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
}

.upload-area:hover {
    border-color: #667eea;
    background: #f8f9ff;
}

.upload-area.dragover {
    border-color: #667eea;
    background: #f0f2ff;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.upload-area p {
    color: #555;
    margin-bottom: 8px;
    font-size: 16px;
}

.upload-hint {
    font-size: 13px;
    color: #888;
    margin-bottom: 20px;
}

.file-info {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: #f0f2ff;
    border-radius: 8px;
    margin-top: 15px;
}

.file-name {
    flex: 1;
    color: #333;
    font-weight: 500;
}

/* Placeholder Content */
.placeholder-content {
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    color: #666;
}

/* Results Container */
.results-container {
    margin-top: 20px;
}

.results-container h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

/* Scenario List */
.scenario-list, .test-case-list, .script-list, .defect-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.scenario-item, .test-case-item, .script-item, .defect-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.scenario-item {
    border-left-color: #667eea;
}

.test-case-item {
    border-left-color: #38ef7d;
}

.script-item {
    border-left-color: #ff6b6b;
}

.defect-item {
    border-left-color: #ffa500;
}

.scenario-header, .test-case-header, .script-header, .defect-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.scenario-title, .test-case-title, .script-title, .defect-title {
    font-weight: 600;
    color: #333;
}

.badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-positive {
    background: #d4edda;
    color: #155724;
    display: inline-block;
    min-width: 78px;
    text-align: center;
    animation: none !important;
    transition: none !important;
}

.badge-negative {
    background: #f8d7da;
    color: #721c24;
}

.badge-edge {
    background: #fff3cd;
    color: #856404;
}

.scenario-description, .test-case-description, .script-description, .defect-description {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

/* Execution Progress */
.execution-progress {
    margin-top: 20px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.progress-bar {
    width: 100%;
    height: 24px;
    background: #e9ecef;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transition: none !important;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #555;
    font-size: 14px;
}

/* Execution Stats */
.execution-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
    margin-bottom: 20px;
}

.stat-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
}

.stat-label {
    color: #666;
    font-size: 14px;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.stat-value.passed {
    color: #38ef7d;
}

.stat-value.failed {
    color: #dc3545;
}

.stat-value.total {
    color: #667eea;
}

/* Test Results List */
.test-results-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.test-result-item {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #ccc;
}

.test-result-item.passed {
    border-left-color: #38ef7d;
}

.test-result-item.failed {
    border-left-color: #dc3545;
}

.test-result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.test-result-title {
    font-weight: 600;
    color: #333;
}

.test-result-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.test-result-status.passed {
    background: #d4edda;
    color: #155724;
}

.test-result-status.failed {
    background: #f8d7da;
    color: #721c24;
}

.test-result-details {
    color: #666;
    font-size: 13px;
}

/* Defect Section */
.defect-section, .report-section {
    margin-bottom: 20px;
}

.defect-section h4, .report-section h4 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

/* Report Summary */
.report-summary {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #38ef7d;
}

.report-summary p {
    color: #555;
    line-height: 1.8;
    margin-bottom: 8px;
}

.report-summary strong {
    color: #333;
}

/* Action Panel */
.action-panel {
    text-align: center;
    margin-bottom: 25px;
}

/* Status Log */
.status-log {
    background: white;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.status-log h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 18px;
}

.log-container {
    max-height: 300px;
    overflow-y: auto;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 15px;
}

.log-entry {
    padding: 8px 0;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 10px;
    font-size: 14px;
}

.log-entry:last-child {
    border-bottom: none;
}

.log-time {
    color: #667eea;
    font-weight: 600;
    white-space: nowrap;
}

.log-message {
    color: #555;
    flex: 1;
}

.log-info {
    color: #333;
}

.log-success {
    color: #155724;
    background: #d4edda;
    padding: 8px;
    border-radius: 4px;
}

.log-error {
    color: #721c24;
    background: #f8d7da;
    padding: 8px;
    border-radius: 4px;
}

.log-warning {
    color: #856404;
    background: #fff3cd;
    padding: 8px;
    border-radius: 4px;
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .logo h1 {
        font-size: 28px;
    }

    .config-grid {
        grid-template-columns: 1fr;
    }

    .step-content {
        padding-left: 0;
        margin-top: 15px;
    }

    .execution-stats {
        grid-template-columns: 1fr;
    }

    .btn-large {
        width: 100%;
        justify-content: center;
    }
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.results-container, .defect-section, .report-section {
    animation: fadeIn 0.5s ease-in;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.7);
    animation: fadeIn 0.3s;
}

.modal-content {
    background-color: #fefefe;
    margin: 2% auto;
    padding: 0;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    animation: slideDown 0.3s;
}

.modal-header {
    padding: 20px 30px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-size: 24px;
}

.modal-header .close {
    color: white;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    line-height: 24px;
}

.modal-header .close:hover {
    color: #ff6b6b;
}

.modal-body {
    padding: 30px;
    max-height: 80vh;
    overflow-y: auto;
}

@keyframes slideDown {
    from { transform: translateY(-50px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* Sauce Labs Viewer Styles */
.sauce-labs-header {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.sauce-info {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    align-items: center;
}

.sauce-info span {
    font-size: 14px;
}

.sauce-labs-viewer {
    display: grid;
    grid-template-columns: 1fr 400px;
    gap: 20px;
}

.browser-frame {
    background: #2d2d2d;
    border-radius: 8px;
    overflow: hidden;
}

.browser-toolbar {
    background: #1e1e1e;
    padding: 10px 15px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.browser-buttons {
    display: flex;
    gap: 6px;
}

.browser-btn {
    width: 12px;
    height: 12px;
    border-radius: 50%;
}

.browser-btn.red { background: #ff5f57; }
.browser-btn.yellow { background: #ffbd2e; }
.browser-btn.green { background: #28c840; }

.browser-url {
    flex: 1;
    background: #0d0d0d;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    color: #fff;
    font-family: monospace;
}

.browser-content {
    background: white;
    height: 600px;
    position: relative;
}

.execution-log {
    background: #1e1e1e;
    padding: 15px;
    border-radius: 8px;
    max-height: 600px;
    overflow-y: auto;
}

.execution-log h3 {
    color: #fff;
    margin-top: 0;
    font-size: 16px;
}

.sauce-log {
    font-family: 'Courier New', monospace;
}

.sauce-log-entry {
    padding: 8px;
    margin-bottom: 8px;
    background: #2d2d2d;
    border-left: 3px solid #667eea;
    border-radius: 4px;
    font-size: 12px;
}

.sauce-time {
    color: #888;
    font-size: 11px;
}

.sauce-step {
    color: #667eea;
    font-weight: bold;
    margin-right: 8px;
}

.sauce-message {
    color: #f8f8f2;
}

/* Email Preview Styles */
.email-preview {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border: 1px solid #ddd;
}

.email-header {
    background: white;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 15px;
    font-size: 14px;
    line-height: 1.8;
}

.email-body {
    background: white;
    padding: 20px;
    border-radius: 6px;
    line-height: 1.6;
}

.email-body h3 {
    color: #667eea;
    margin-top: 20px;
}

.email-body table {
    margin: 15px 0;
}

.email-body td {
    padding: 10px;
    border: 1px solid #ddd;
}

.email-body ul {
    margin: 10px 0;
}

.email-body li {
    margin: 5px 0;
}

/* Scrollbar Styling */
.log-container::-webkit-scrollbar {
    width: 8px;
}

.log-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.log-container::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.log-container::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Loading Spinner */
.spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.6s ease-in-out infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.recent-prd-picker {
    width: min(100%, 420px);
    margin: 18px auto 14px;
    text-align: left;
}

.recent-prd-picker label {
    display: block;
    margin-bottom: 7px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.recent-prd-picker select {
    width: 100%;
    min-height: 42px;
    padding: 9px 12px;
    border: 1px solid #cbd5e1;
    border-radius: 9px;
    background: #fff;
    color: #1e293b;
    font: inherit;
}

.current-test-execution {
    background: #1f2937;
    color: #f8fafc;
    border-left: 4px solid #667eea;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 8px 0;
    font-size: 13px;
    font-weight: 600;
}

/* Professional dashboard refinements */
.btn {
    border-radius: 10px;
    min-height: 42px;
    padding: 10px 18px;
    font-weight: 700;
    letter-spacing: 0.01em;
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.15s ease;
}

.btn:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 9px 20px rgba(15, 23, 42, 0.22);
}

.btn:disabled {
    opacity: 0.58;
    cursor: not-allowed;
    transform: none;
}

.workflow-step,
.config-panel,
.status-log,
.action-panel {
    border-color: rgba(148, 163, 184, 0.28);
    box-shadow: 0 16px 38px rgba(15, 23, 42, 0.18);
}

.step-header h3,
.panel-header h3 {
    letter-spacing: -0.02em;
}

.step-content {
    padding: 24px;
}

.modal-header h2 {
    letter-spacing: -0.02em;
}

.sauce-info {
    gap: 14px;
    color: #334155;
}

.sauce-info > span {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 8px 10px;
}

.execution-log h3,
.execution-log h4 {
    letter-spacing: -0.01em;
}
