/* ===== LAYOUT ===== */
.scanning-layout {
    display: grid;
    grid-template-columns: minmax(320px, 480px) 1fr;
    gap: 24px;
    width: 100%;
    padding: 0 24px;
    box-sizing: border-box;
    max-width: 1600px;
    margin: 0 auto;
}

.scanning-left,
.scanning-right {
    padding: 0;
}

/* ===== SCAN PANEL ===== */
.scan-panel {
    background: rgba(14, 52, 30, 0.15);
    border: 1px solid rgba(144, 255, 108, 0.2);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

.scan-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(144, 255, 108, 0.15);
}

.scan-panel-icon {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(144, 255, 108, 0.1);
    border-radius: 8px;
    color: #90ff6c;
}

.scan-panel-header h3 {
    margin: 0;
    font-size: 18px;
}

/* ===== FORM ELEMENTS ===== */
.scan-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

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

.form-label {
    font-size: 13px;
    font-weight: 500;
    opacity: 0.9;
}

.form-input,
.form-select,
.form-textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(144, 255, 108, 0.3);
    border-radius: 8px;
    color: #90ff6c;
    font-size: 14px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
    outline: none;
    border-color: #90ff6c;
    box-shadow: 0 0 0 3px rgba(144, 255, 108, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder {
    color: rgba(144, 255, 108, 0.4);
}

.form-textarea {
    min-height: 180px;
    resize: vertical;
    font-family: monospace;
    line-height: 1.6;
}

.select-wrapper {
    position: relative;
}

.select-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #90ff6c;
    pointer-events: none;
}

.form-select {
    appearance: none;
    padding-right: 40px;
    cursor: pointer;
}

/* ===== MODE TOGGLE ===== */
.mode-toggle {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 4px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 8px;
}

.mode-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    color: rgba(144, 255, 108, 0.6);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.mode-btn:hover {
    background: rgba(144, 255, 108, 0.05);
    color: #90ff6c;
}

.mode-btn.active {
    background: rgba(14, 52, 30, 0.5);
    border-color: rgba(144, 255, 108, 0.4);
    color: #90ff6c;
}

.mode-btn svg {
    width: 16px;
    height: 16px;
}

/* ===== BUTTONS ===== */
.btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #2cff2c 0%, #90ff6c 100%);
    border: none;
    border-radius: 8px;
    color: #0e341e;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(44, 255, 44, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(44, 255, 44, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary.btn-full {
    width: 100%;
    margin-top: 8px;
}

.input-with-button {
    display: flex;
    gap: 8px;
}

.input-with-button .form-input {
    flex: 1;
}

.input-with-button .btn-primary {
    flex-shrink: 0;
}

/* ===== STATS GRID ===== */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.stat-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: rgba(14, 52, 30, 0.3);
    border: 1px solid rgba(144, 255, 108, 0.2);
    border-radius: 8px;
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    font-size: 24px;
    line-height: 1;
}

.stat-content {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 6px;
}

.stat-label {
    font-size: 11px;
    opacity: 0.9;
    color: #90ff6c;
    line-height: 1.2;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    line-height: 1;
    color: #90ff6c;
    margin-top: 2px;
}

.stat-total .stat-value { color: #90ff6c; }
.stat-progress .stat-value { color: #90ff6c; }
.stat-finished .stat-value { color: #90ff6c; }

/* ===== PROGRESS BAR ===== */
.progress-wrapper {
    margin-bottom: 16px;
}

.progress-bar {
    position: relative;
    height: 32px;
    background: rgba(14, 52, 30, 0.5);
    border: 2px solid rgba(144, 255, 108, 0.3);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
}

.progress-fill {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, #0e341e 0%, #2cff2c 50%, #90ff6c 100%);
    transition: width 0.5s ease;
    box-shadow: 0 0 10px rgba(44, 255, 44, 0.5);
}

.progress-label {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-weight: 700;
    font-size: 14px;
    text-shadow: 0 0 4px rgba(0, 0, 0, 0.8);
}

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(44, 255, 44, 0.8), inset 0 0 10px rgba(144, 255, 108, 0.5);
    }
    50% {
        box-shadow: 0 0 30px rgba(44, 255, 44, 1), inset 0 0 15px rgba(144, 255, 108, 0.7);
    }
}

/* ===== RESULTS PANEL ===== */
.results-panel {
    background: rgba(14, 52, 30, 0.15);
    border: 1px solid rgba(144, 255, 108, 0.2);
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
    display: flex;
    flex-direction: column;
    height: calc(100vh - 200px);
    min-height: 500px;
}

.results-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(144, 255, 108, 0.15);
    flex-shrink: 0;
}

.results-tabs {
    display: flex;
    gap: 8px;
    flex: 1;
}

.tab-btn {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid rgba(144, 255, 108, 0.2);
    border-radius: 8px;
    color: rgba(144, 255, 108, 0.7);
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab-btn:hover {
    background: rgba(144, 255, 108, 0.05);
    color: #90ff6c;
}

.tab-btn.active {
    background: rgba(14, 52, 30, 0.5);
    border-color: #90ff6c;
    color: #90ff6c;
}

.btn-clear {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(255, 108, 108, 0.1);
    border: 1px solid rgba(255, 108, 108, 0.3);
    border-radius: 8px;
    color: #ff6c6c;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.btn-clear:hover {
    background: rgba(255, 108, 108, 0.2);
    border-color: #ff6c6c;
}

.btn-clear svg {
    width: 16px;
    height: 16px;
}

/* ===== URL SELECTOR ===== */
.url-selector {
    margin-bottom: 16px;
    flex-shrink: 0;
}

.url-selector .form-select {
    width: 100%;
}

/* ===== SCAN OUTPUT ===== */
.scan-output {
    flex: 1;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(144, 255, 108, 0.3);
    border-radius: 8px;
    padding: 16px;
    overflow-y: auto;
    overflow-x: hidden;
    font-family: monospace;
    font-size: 13px;
    line-height: 1.6;
    color: #2cff2c;
    word-wrap: break-word;
    word-break: break-all;
    white-space: pre-wrap;
}

.scan-output #output {
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
}

.scan-output .response {
    width: 100%;
    max-width: 100%;
    overflow-wrap: break-word;
    word-break: break-all;
}

.scan-output::-webkit-scrollbar {
    width: 8px;
}

.scan-output::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 4px;
}

.scan-output::-webkit-scrollbar-thumb {
    background: rgba(144, 255, 108, 0.3);
    border-radius: 4px;
}

.scan-output::-webkit-scrollbar-thumb:hover {
    background: rgba(144, 255, 108, 0.5);
}

/* ===== ACTION BUTTON GROUP ===== */
.action-button-group {
    display: inline-flex;
    gap: 6px;
    justify-content: center;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    padding: 0;
    background: rgba(14, 52, 30, 0.5);
    border: 1px solid rgba(144, 255, 108, 0.3);
    border-radius: 6px;
    color: #90ff6c;
    cursor: pointer;
    transition: all 0.2s ease;
}

.action-btn:hover {
    background: rgba(144, 255, 108, 0.2);
    border-color: #90ff6c;
    transform: translateY(-2px);
    box-shadow: 0 2px 8px rgba(144, 255, 108, 0.2);
}

.action-btn svg {
    width: 14px;
    height: 14px;
}

.action-btn-view:hover {
    background: rgba(144, 255, 108, 0.15);
}

.action-btn-download:hover {
    background: rgba(144, 255, 108, 0.15);
}

/* ===== DOWNLOAD BUTTON ===== */
.btn-download-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(144, 255, 108, 0.1);
    border: 1px solid rgba(144, 255, 108, 0.3);
    border-radius: 8px;
    color: #90ff6c;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 13px;
}

.btn-download-all:hover {
    background: rgba(144, 255, 108, 0.2);
    border-color: #90ff6c;
    transform: translateY(-1px);
}

.btn-download-all svg {
    width: 16px;
    height: 16px;
}

/* ===== RESULTS TABLE ===== */
.results-table-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    margin-bottom: 16px;
}

.scan-results-table {
    width: 100%;
    border-collapse: collapse;
    background: rgba(14, 52, 30, 0.2);
    border: 1px solid rgba(144, 255, 108, 0.2);
    border-radius: 8px;
    overflow: hidden;
    table-layout: fixed;
}

.scan-results-table thead tr {
    background: rgba(14, 52, 30, 0.5);
    border-bottom: 2px solid rgba(144, 255, 108, 0.3);
}

.scan-results-table th {
    padding: 14px 16px;
    text-align: left;
    border: 1px solid rgba(144, 255, 108, 0.15);
    font-weight: 600;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.scan-results-table tbody tr {
    border-bottom: 1px solid rgba(144, 255, 108, 0.1);
    transition: background 0.2s ease;
}

.scan-results-table tbody tr:hover {
    background: rgba(144, 255, 108, 0.05);
}

.scan-results-table td {
    padding: 12px 16px;
    border: 1px solid rgba(144, 255, 108, 0.1);
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-all;
    max-width: 0;
}

/* Expanded row content styling */
.scan-results-table td[colspan] > div {
    max-width: 100%;
    overflow-x: auto;
    word-wrap: break-word;
    white-space: pre-wrap;
}

.scan-results-table td[colspan] > div::-webkit-scrollbar {
    height: 6px;
}

.scan-results-table td[colspan] > div::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.2);
    border-radius: 3px;
}

.scan-results-table td[colspan] > div::-webkit-scrollbar-thumb {
    background: rgba(144, 255, 108, 0.3);
    border-radius: 3px;
}

.scan-results-table td[colspan] > div::-webkit-scrollbar-thumb:hover {
    background: rgba(144, 255, 108, 0.5);
}

/* ===== LEGACY COMPATIBILITY ===== */
#multiple-scan { display: none; }
#select-urls { display: none; }
#log-scan-progress { display: none; }
#response-scan { display: flex; }
.content-select-urls { margin: 20px; }

/* ===== RESPONSIVE DESIGN ===== */
@media (max-width: 1024px) {
    .scanning-layout {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 0 16px;
    }

    .results-panel {
        height: auto;
        min-height: 400px;
    }
}

@media (max-width: 768px) {
    .scanning-layout {
        padding: 0 12px;
        gap: 16px;
    }

    .scan-panel,
    .results-panel {
        padding: 20px;
        border-radius: 10px;
    }

    .scan-panel-header h3 {
        font-size: 16px;
    }

    .scan-panel-icon {
        width: 36px;
        height: 36px;
    }

    .results-header {
        flex-wrap: wrap;
    }

    .results-tabs {
        width: 100%;
        order: 1;
    }

    .btn-clear {
        order: 2;
        width: 100%;
        justify-content: center;
        margin-top: 12px;
    }

    .stats-grid {
        gap: 10px;
    }

    .stat-card {
        padding: 12px;
        gap: 10px;
    }

    .stat-icon {
        font-size: 20px;
    }

    .stat-value {
        font-size: 20px;
    }

    .stat-label {
        font-size: 10px;
    }
}

@media (max-width: 600px) {
    .scanning-layout {
        padding: 0 8px;
        gap: 12px;
    }

    .scan-panel,
    .results-panel {
        padding: 16px;
        border-radius: 8px;
    }

    .scan-panel-header {
        margin-bottom: 20px;
        padding-bottom: 12px;
    }

    .scan-panel-header h3 {
        font-size: 15px;
    }

    .scan-panel-icon {
        width: 32px;
        height: 32px;
    }

    .scan-panel-icon svg {
        width: 18px;
        height: 18px;
    }

    .scan-form {
        gap: 16px;
    }

    .form-group {
        gap: 6px;
    }

    .form-label {
        font-size: 12px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        padding: 10px 12px;
        font-size: 14px;
    }

    .form-textarea {
        min-height: 140px;
    }

    .mode-toggle {
        gap: 6px;
    }

    .mode-btn {
        padding: 8px 12px;
        font-size: 13px;
        gap: 6px;
    }

    .mode-btn svg {
        width: 14px;
        height: 14px;
    }

    .input-with-button {
        flex-direction: column;
        gap: 8px;
    }

    .input-with-button .btn-primary {
        width: 100%;
    }

    .btn-primary {
        padding: 12px 20px;
        font-size: 14px;
    }

    .btn-primary svg {
        width: 16px;
        height: 16px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 10px 12px;
    }

    .stat-icon {
        font-size: 18px;
    }

    .stat-value {
        font-size: 18px;
    }

    .stat-label {
        font-size: 10px;
    }

    .progress-bar {
        height: 28px;
    }

    .progress-label {
        font-size: 12px;
    }

    .results-panel {
        padding: 16px;
        height: auto;
        min-height: 350px;
    }

    .results-header {
        margin-bottom: 16px;
        padding-bottom: 12px;
        gap: 12px;
    }

    .results-tabs {
        gap: 6px;
        flex-wrap: wrap;
    }

    .tab-btn {
        padding: 8px 14px;
        font-size: 13px;
        flex: 1;
        min-width: calc(33.333% - 4px);
    }

    .btn-clear {
        padding: 8px 14px;
        font-size: 13px;
    }

    .btn-clear svg {
        width: 14px;
        height: 14px;
    }

    .url-selector {
        margin-bottom: 12px;
    }

    .scan-output {
        padding: 12px;
        font-size: 12px;
        line-height: 1.5;
    }

    .scan-results-table th,
    .scan-results-table td {
        padding: 10px 12px;
        font-size: 12px;
    }

    .scan-results-table th:first-child,
    .scan-results-table td:first-child {
        width: 40px;
    }

    .scan-results-table th:nth-child(3),
    .scan-results-table td:nth-child(3) {
        width: 80px;
    }

    .scan-results-table th:nth-child(4),
    .scan-results-table td:nth-child(4) {
        width: 70px;
    }
}

@media (max-width: 400px) {
    .scanning-layout {
        padding: 0 6px;
    }

    .scan-panel,
    .results-panel {
        padding: 12px;
    }

    .scan-panel-header h3 {
        font-size: 14px;
    }

    .form-input,
    .form-select,
    .form-textarea {
        font-size: 13px;
        padding: 9px 10px;
    }

    .mode-btn {
        padding: 7px 10px;
        font-size: 12px;
    }

    .btn-primary {
        padding: 10px 16px;
        font-size: 13px;
    }

    .tab-btn {
        padding: 7px 10px;
        font-size: 12px;
        min-width: calc(33.333% - 4px);
    }

    .btn-clear {
        padding: 7px 12px;
        font-size: 12px;
    }

    .scan-output {
        font-size: 11px;
        padding: 10px;
    }

    .stat-value {
        font-size: 16px;
    }

    .stat-label {
        font-size: 9px;
    }
}
