/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #3b82f6;
    --secondary-color: #60a5fa;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --danger-color: #ef4444;
    --dark-bg: #0f172a;
    --card-bg: #1e293b;
    --text-color: #e2e8f0;
    --text-light: #94a3b8;
    --border-color: #334155;
    --hover-color: #334155;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
    min-height: 100vh;
    animation: gradientShift 15s ease infinite;
    background-size: 200% 200%;
}

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

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: var(--dark-bg);
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.logo:hover {
    color: var(--primary-color);
}

.nav-links {
    display: flex;
    gap: 2rem;
}

.nav-links a {
    color: white;
    text-decoration: none;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: var(--primary-color);
}

/* Main Content */
.main-content {
    padding: 2rem 20px;
}

.page-header {
    text-align: center;
    margin-bottom: 2rem;
    color: white;
}

.page-header h1 {
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
}

/* Card Styles */
.card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 2rem;
    margin-bottom: 2rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

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

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card h2 {
    font-size: 1.5rem;
    margin-bottom: 1.5rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.card h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: var(--text-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Upload Area */
.upload-area {
    border: 3px dashed var(--border-color);
    border-radius: 8px;
    padding: 3rem;
    text-align: center;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    background: rgba(15, 23, 42, 0.3);
}

.upload-area::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.upload-area:hover::before {
    width: 400px;
    height: 400px;
}

.upload-area:hover {
    border-color: var(--primary-color);
    background: rgba(51, 65, 85, 0.5);
    transform: scale(1.02);
}

.upload-area.dragover {
    border-color: var(--primary-color);
    background: rgba(51, 65, 85, 0.5);
    transform: scale(1.02);
}

.upload-icon {
    font-size: 4rem;
    color: var(--primary-color);
    margin-bottom: 1rem;
    animation: float 3s ease-in-out infinite;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-10px);
    }
}

.upload-area p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--secondary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
    background: var(--text-light);
    color: white;
}

.btn-secondary:hover {
    background: var(--text-color);
    transform: translateY(-2px);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

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

/* Image Preview */
.image-container {
    text-align: center;
    margin-bottom: 1rem;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
}

.image-container img {
    max-width: 100%;
    max-height: 500px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    animation: zoomIn 0.5s ease;
}

@keyframes zoomIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}

.image-info {
    background: rgba(51, 65, 85, 0.5);
    padding: 1rem;
    border-radius: 6px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1rem;
}

.info-item {
    display: flex;
    flex-direction: column;
}

.info-label {
    font-weight: 600;
    color: var(--text-light);
    font-size: 0.875rem;
}

.info-value {
    font-size: 1.1rem;
    color: var(--text-color);
}

/* Detection Result */
.detection-result {
    margin-top: 1.5rem;
    animation: slideIn 0.5s ease;
}

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

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.verdict-card {
    padding: 1.5rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    animation: pulse 0.5s ease;
}

@keyframes pulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }

    100% {
        transform: scale(1);
    }
}

.verdict-card.success {
    background: rgba(16, 185, 129, 0.15);
    border-left: 4px solid var(--success-color);
    color: #86efac;
}

.verdict-card.warning {
    background: rgba(245, 158, 11, 0.15);
    border-left: 4px solid var(--warning-color);
    color: #fde047;
}

.verdict-card.danger {
    background: rgba(239, 68, 68, 0.15);
    border-left: 4px solid var(--danger-color);
    color: #fca5a5;
}

.verdict-text {
    font-size: 1.5rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
}

.confidence-score {
    font-size: 1.2rem;
    color: var(--text-light);
}

.breakdown-section {
    margin-top: 1.5rem;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    padding: 0.75rem;
    background: rgba(51, 65, 85, 0.5);
    border-radius: 6px;
    margin-bottom: 0.5rem;
    transition: all 0.3s ease;
}

.breakdown-item:hover {
    background: var(--border-color);
    transform: translateX(5px);
}

/* Tools Section */
.tool-group {
    padding: 1.5rem;
    background: rgba(51, 65, 85, 0.5);
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

.tool-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: center;
}

.form-control {
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    flex: 1;
    min-width: 150px;
    background: rgba(15, 23, 42, 0.5);
    color: var(--text-color);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

/* Status and Result Messages */
.status-message,
.result-message {
    margin-top: 1rem;
    padding: 1rem;
    border-radius: 6px;
    display: none;
}

.status-message.show,
.result-message.show {
    display: block;
}

.status-message.success,
.result-message.success {
    background: rgba(16, 185, 129, 0.15);
    color: #86efac;
    border: 1px solid var(--success-color);
}

.status-message.error,
.result-message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #fca5a5;
    border: 1px solid var(--danger-color);
}

.status-message.info,
.result-message.info {
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid var(--primary-color);
}

/* Downloads Section */
.downloads-list {
    display: grid;
    gap: 1rem;
}

.download-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: rgba(51, 65, 85, 0.5);
    border-radius: 6px;
    animation: slideIn 0.3s ease;
    transition: all 0.3s ease;
}

.download-item:hover {
    background: var(--border-color);
    transform: scale(1.02);
}

.download-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.download-icon {
    font-size: 2rem;
    color: var(--primary-color);
}

/* Loading Spinner */
.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--primary-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 1rem auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Footer */
.footer {
    background: var(--dark-bg);
    color: white;
    text-align: center;
    padding: 2rem 0;
    margin-top: 2rem;
}

/* Stats Section */
.stats-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: linear-gradient(135deg, var(--card-bg) 0%, rgba(51, 65, 85, 0.8) 100%);
    border-radius: 12px;
    padding: 2rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
    transition: all 0.3s ease;
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(59, 130, 246, 0.2), transparent);
    transition: left 0.5s ease;
}

.stat-card:hover::before {
    left: 100%;
}

.stat-card:hover {
    transform: translateY(-5px) scale(1.02);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.3);
    border-color: var(--primary-color);
}

.stat-icon {
    font-size: 3rem;
    color: var(--primary-color);
    background: rgba(59, 130, 246, 0.15);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: pulse-glow 2s ease-in-out infinite;
}

@keyframes pulse-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(59, 130, 246, 0.7);
    }

    50% {
        box-shadow: 0 0 20px 10px rgba(59, 130, 246, 0);
    }
}

.stat-content {
    flex: 1;
}

.stat-value {
    font-size: 2.5rem;
    font-weight: bold;
    color: var(--text-color);
    line-height: 1;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.stat-label {
    font-size: 1rem;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 500;
}

/* Responsive Design */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 1.8rem;
    }

    .tool-controls {
        flex-direction: column;
        align-items: stretch;
    }

    .nav-links {
        gap: 1rem;
    }

    .card {
        padding: 1.5rem;
    }

    .stats-section {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .stat-card {
        padding: 1.5rem;
    }

    .stat-icon {
        width: 60px;
        height: 60px;
        font-size: 2rem;
    }

    .stat-value {
        font-size: 2rem;
    }
}