/* Dark Theme with Black/Grey/Red Color Scheme */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg-primary: #0a0a0a;
    --bg-secondary: #1a1a1a;
    --bg-tertiary: #252525;
    --bg-card: #1e1e1e;
    --text-primary: #e0e0e0;
    --text-secondary: #a0a0a0;
    --accent-red: #dc3545;
    --accent-red-dark: #c82333;
    --accent-red-light: #ff4757;
    --accent-grey: #404040;
    --accent-grey-light: #505050;
    --border-color: #333333;
    --shadow: rgba(220, 53, 69, 0.2);
    --shadow-dark: rgba(0, 0, 0, 0.5);
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    padding: 20px;
    color: var(--text-primary);
    position: relative;
    overflow-x: hidden;
}

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 50%, #0a0a0a 100%);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
    100% { background-position: 0% 50%; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* Animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

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

@keyframes shimmer {
    0% {
        background-position: -1000px 0;
    }
    100% {
        background-position: 1000px 0;
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

.slide-in {
    animation: slideIn 0.5s ease-out;
}

/* Header */
header {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 25px 30px;
    margin-bottom: 25px;
    box-shadow: 0 8px 32px var(--shadow-dark);
    border: 1px solid var(--border-color);
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

header:hover {
    box-shadow: 0 12px 40px rgba(220, 53, 69, 0.3);
    transform: translateY(-2px);
}

.header-content h1 {
    margin-bottom: 20px;
    color: var(--accent-red-light);
    font-size: 32px;
    font-weight: 700;
    text-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-content h1 i {
    animation: pulse 2s ease-in-out infinite;
}

.tabs {
    display: flex;
    gap: 12px;
}

.tab-button {
    padding: 12px 24px;
    border: 2px solid var(--border-color);
    background: var(--bg-secondary);
    border-radius: 8px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    color: var(--text-secondary);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.tab-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(220, 53, 69, 0.2), transparent);
    transition: left 0.5s;
}

.tab-button:hover::before {
    left: 100%;
}

.tab-button:hover {
    background: var(--bg-tertiary);
    border-color: var(--accent-red);
    color: var(--text-primary);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px var(--shadow);
}

.tab-button.active {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-dark) 100%);
    border-color: var(--accent-red);
    color: white;
    box-shadow: 0 4px 20px var(--shadow);
    transform: translateY(-2px);
}

.tab-button.active i {
    animation: pulse 1.5s ease-in-out infinite;
}

/* Tab Content */
.tab-content {
    display: none;
    animation: fadeIn 0.4s ease-out;
}

.tab-content.active {
    display: block;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 15px;
    padding: 35px;
    box-shadow: 0 8px 32px var(--shadow-dark);
    margin-bottom: 25px;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, var(--accent-red), var(--accent-red-light), var(--accent-red));
    background-size: 200% 100%;
    animation: shimmer 3s linear infinite;
}

.card:hover {
    box-shadow: 0 12px 40px rgba(220, 53, 69, 0.25);
    transform: translateY(-3px);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.card h2 {
    color: var(--accent-red-light);
    margin-bottom: 25px;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Forms */
.form-group {
    margin-bottom: 25px;
    position: relative;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

input[type="text"],
input[type="url"],
input[type="number"],
select {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 15px;
    background: var(--bg-secondary);
    color: var(--text-primary);
    transition: all 0.3s ease;
}

input:focus,
select:focus {
    outline: none;
    border-color: var(--accent-red);
    background: var(--bg-tertiary);
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2);
    transform: translateY(-1px);
}

input::placeholder {
    color: var(--text-secondary);
}

small {
    display: block;
    margin-top: 6px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-dark) 100%);
    color: white;
    box-shadow: 0 4px 15px var(--shadow);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--accent-red-light) 0%, var(--accent-red) 100%);
    box-shadow: 0 6px 25px var(--shadow);
    transform: translateY(-2px);
}

.btn-secondary {
    background: var(--bg-tertiary);
    color: var(--text-primary);
    border: 2px solid var(--border-color);
}

.btn-secondary:hover {
    background: var(--accent-grey);
    border-color: var(--accent-grey-light);
    transform: translateY(-2px);
}

.btn-danger {
    background: linear-gradient(135deg, #c82333 0%, #a02030 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(200, 35, 51, 0.3);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    box-shadow: 0 6px 25px rgba(200, 35, 51, 0.4);
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #34ce57 0%, #28a745 100%);
    box-shadow: 0 6px 25px rgba(40, 167, 69, 0.4);
    transform: translateY(-2px);
}

/* Filter Bar */
.filter-bar {
    margin-bottom: 25px;
}

.filter-bar select {
    max-width: 220px;
    cursor: pointer;
}

/* Scans List */
.scans-list {
    display: grid;
    gap: 20px;
}

.scan-item {
    background: var(--bg-secondary);
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 25px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.scan-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: var(--accent-red);
    transform: scaleY(0);
    transition: transform 0.3s ease;
}

.scan-item:hover {
    border-color: var(--accent-red);
    box-shadow: 0 8px 30px var(--shadow);
    transform: translateX(5px);
}

.scan-item:hover::before {
    transform: scaleY(1);
}

.scan-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 15px;
}

.scan-item-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.scan-item-url {
    color: var(--accent-red-light);
    font-size: 14px;
    word-break: break-all;
    opacity: 0.9;
}

/* Status Badges */
.scan-status {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    animation: pulse 2s ease-in-out infinite;
}

.status-pending {
    background: linear-gradient(135deg, #ffc107 0%, #ff9800 100%);
    color: #000;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.4);
}

.status-running {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(23, 162, 184, 0.4);
    animation: pulse 1.5s ease-in-out infinite;
}

.status-completed {
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: white;
    box-shadow: 0 2px 10px rgba(40, 167, 69, 0.4);
}

.status-stopped {
    background: var(--accent-grey);
    color: white;
    box-shadow: 0 2px 10px rgba(64, 64, 64, 0.4);
}

.status-error {
    background: linear-gradient(135deg, var(--accent-red) 0%, var(--accent-red-dark) 100%);
    color: white;
    box-shadow: 0 2px 10px var(--shadow);
}

.scan-item-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin: 20px 0;
    font-size: 14px;
    color: var(--text-secondary);
}

.scan-item-actions {
    display: flex;
    gap: 12px;
    margin-top: 20px;
    flex-wrap: wrap;
}

.scan-item-actions .btn {
    padding: 10px 20px;
    font-size: 13px;
}

/* Loading & Empty States */
.loading {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
    font-size: 16px;
}

.loading::after {
    content: '...';
    animation: pulse 1.5s ease-in-out infinite;
}

.empty-state {
    text-align: center;
    padding: 60px 40px;
    color: var(--text-secondary);
    font-size: 16px;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(5px);
    overflow: auto;
    animation: fadeIn 0.3s ease;
}

.modal-content {
    background: var(--bg-card);
    margin: 5% auto;
    padding: 40px;
    border-radius: 15px;
    width: 90%;
    max-width: 850px;
    max-height: 85vh;
    overflow-y: auto;
    position: relative;
    border: 1px solid var(--border-color);
    box-shadow: 0 20px 60px var(--shadow-dark);
    animation: slideIn 0.4s ease;
}

.close {
    color: var(--text-secondary);
    float: right;
    font-size: 32px;
    font-weight: bold;
    cursor: pointer;
    position: absolute;
    right: 25px;
    top: 25px;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.close:hover {
    color: var(--accent-red-light);
    background: var(--bg-tertiary);
    transform: rotate(90deg);
}

.modal h3 {
    color: var(--accent-red-light);
    margin-bottom: 25px;
    font-size: 26px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-section {
    margin-bottom: 30px;
}

.modal-section h4 {
    color: var(--text-primary);
    margin-bottom: 12px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 8px;
    font-size: 18px;
}

.modal-section pre {
    background: var(--bg-secondary);
    padding: 20px;
    border-radius: 8px;
    overflow-x: auto;
    font-size: 13px;
    line-height: 1.8;
    color: var(--text-primary);
    border: 1px solid var(--border-color);
}

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

.stat-card {
    background: var(--bg-secondary);
    padding: 25px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    transition: all 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px var(--shadow);
    border-color: var(--accent-red);
}

.stat-value {
    font-size: 42px;
    font-weight: 700;
    color: var(--accent-red-light);
    text-shadow: 0 0 20px rgba(220, 53, 69, 0.5);
    margin-bottom: 8px;
}

.stat-label {
    font-size: 13px;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

::-webkit-scrollbar-thumb {
    background: var(--accent-red);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-red-light);
}

/* Responsive */
@media (max-width: 768px) {
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .scan-item-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .card-header {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .tabs {
        flex-direction: column;
    }
    
    .tab-button {
        width: 100%;
        justify-content: center;
    }
    
    header {
        padding: 20px;
    }
    
    .card {
        padding: 25px;
    }
}

/* Additional Animations */
@keyframes glow {
    0%, 100% {
        box-shadow: 0 0 20px var(--shadow);
    }
    50% {
        box-shadow: 0 0 30px var(--shadow), 0 0 40px var(--shadow);
    }
}

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

/* External Domains Styles */
.external-domains-list {
    display: grid;
    gap: 12px;
    max-height: 500px;
    overflow-y: auto;
    padding: 10px;
}

.external-domain-item {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: all 0.3s ease;
}

.external-domain-item:hover {
    border-color: var(--accent-red);
    background: var(--bg-tertiary);
    transform: translateX(5px);
}

.external-domain-info {
    flex: 1;
}

.external-domain-info strong {
    color: var(--text-primary);
    font-size: 15px;
    display: block;
    margin-bottom: 5px;
}

.external-domain-actions {
    display: flex;
    gap: 10px;
}

/* Smooth transitions for all interactive elements */
a, button, input, select {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Make scan items clickable in external domains tab */
#external-domains-tab .scan-item {
    cursor: pointer;
}

/* Logs container styles */
.logs-container {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--bg-secondary);
    overflow: hidden;
    margin-top: 10px;
}

.logs-header {
    background: var(--bg-tertiary);
    padding: 12px 15px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background 0.3s ease;
}

.logs-header:hover {
    background: var(--bg-primary);
}

.logs-header h4 {
    margin: 0;
    color: var(--text-primary);
    font-size: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.logs-header i {
    color: var(--text-secondary);
    transition: transform 0.3s ease;
}

.logs-content {
    padding: 15px;
    max-height: 400px;
    overflow-y: auto;
}

.logs-pre {
    background: #1e1e1e;
    color: #d4d4d4;
    padding: 15px;
    border-radius: 6px;
    font-family: 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.6;
    margin: 0;
    white-space: pre-wrap;
    word-wrap: break-word;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid #333;
}

.logs-pre::-webkit-scrollbar {
    width: 8px;
}

.logs-pre::-webkit-scrollbar-track {
    background: #1e1e1e;
}

.logs-pre::-webkit-scrollbar-thumb {
    background: #555;
    border-radius: 4px;
}

.logs-pre::-webkit-scrollbar-thumb:hover {
    background: #666;
}
