/* ABC Watermarker - Dark Theme with Glow */

:root {
    --bg-primary: #121212;
    --bg-card: #1e1e1e;
    --bg-hover: #2a2a2a;
    --accent: #00ff88;
    --accent-dim: rgba(0, 255, 136, 0.3);
    --text-primary: #e0e0e0;
    --text-secondary: #888888;
    --error: #ff4444;
    --border: #333333;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    line-height: 1.6;
}

/* Glow Effect */
.glow {
    text-shadow: 0 0 10px var(--accent-dim), 0 0 20px var(--accent-dim), 0 0 30px var(--accent-dim);
}

/* Typography */
.title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent);
    letter-spacing: 2px;
}

.subtitle {
    font-size: 0.75rem;
    color: var(--text-secondary);
    letter-spacing: 4px;
    text-transform: uppercase;
}

/* Header */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 2rem;
    border-bottom: 1px solid var(--border);
}

.header-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.logo-small {
    width: 40px;
    height: 40px;
    object-fit: contain;
}

/* Main Content */
main {
    max-width: 900px;
    margin: 0 auto;
    padding: 2rem;
}

/* Cards */
.card {
    background: var(--bg-card);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
}

.card h2 {
    font-size: 1rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Buttons */
.btn {
    background: transparent;
    border: 1px solid var(--accent);
    color: var(--accent);
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    background: var(--accent);
    color: var(--bg-primary);
    box-shadow: 0 0 15px var(--accent-dim);
}

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

.btn-primary:hover {
    box-shadow: 0 0 20px var(--accent-dim);
}

.btn-secondary {
    border-color: var(--text-secondary);
    color: var(--text-secondary);
}

.btn-secondary:hover {
    background: var(--text-secondary);
    color: var(--bg-primary);
}

.btn-small {
    padding: 0.5rem 1rem;
    font-size: 0.75rem;
}

.btn-large {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    margin-top: 1rem;
}

/* Login Page */
.login-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.logo-wrapper {
    margin-bottom: 1.5rem;
}

.logo {
    width: 80px;
    height: 80px;
    object-fit: contain;
}

.login-form {
    width: 100%;
    max-width: 320px;
    margin-top: 2rem;
}

.login-form input {
    width: 100%;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-primary);
    font-size: 1rem;
    margin-bottom: 1rem;
    text-align: center;
}

.login-form input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px var(--accent-dim);
}

.error-message {
    background: rgba(255, 68, 68, 0.1);
    border: 1px solid var(--error);
    color: var(--error);
    padding: 0.75rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    text-align: center;
    font-size: 0.875rem;
}

/* Drop Zone */
.drop-zone {
    border: 2px dashed var(--border);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.drop-zone:hover,
.drop-zone.dragover {
    border-color: var(--accent);
    background: rgba(0, 255, 136, 0.05);
}

.drop-zone p {
    color: var(--text-secondary);
}

.drop-zone .hint {
    font-size: 0.75rem;
    margin-top: 0.5rem;
}

/* File List */
.file-list {
    margin-top: 1rem;
}

.file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: var(--bg-hover);
    border-radius: 6px;
    margin-bottom: 0.5rem;
}

.file-item .name {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.file-item .type {
    font-size: 0.75rem;
    color: var(--accent);
    margin-left: 1rem;
}

.file-item .remove {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 0.25rem 0.5rem;
    font-size: 1.25rem;
}

.file-item .remove:hover {
    color: var(--error);
}

/* Preview */
.preview-container {
    display: flex;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.preview-wrapper {
    position: relative;
    max-width: 100%;
    max-height: 300px;
    background: var(--bg-hover);
    border-radius: 8px;
    overflow: hidden;
}

.preview-wrapper img {
    max-width: 100%;
    max-height: 300px;
    display: block;
}

#watermark-overlay {
    position: absolute;
    bottom: 40px;
    right: 40px;
    width: 60px;
    pointer-events: none;
}

/* Controls */
.controls {
    display: grid;
    gap: 1.5rem;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.control-group label {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

input[type="range"] {
    width: 100%;
    height: 6px;
    background: var(--bg-hover);
    border-radius: 3px;
    appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    width: 18px;
    height: 18px;
    background: var(--accent);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 0 10px var(--accent-dim);
}

/* Progress */
.progress-bar {
    height: 8px;
    background: var(--bg-hover);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.progress-fill {
    height: 100%;
    background: var(--accent);
    width: 0%;
    transition: width 0.3s ease;
    box-shadow: 0 0 10px var(--accent);
}

#progress-text {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Results Grid */
.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.result-item {
    background: var(--bg-hover);
    border-radius: 8px;
    overflow: hidden;
}

.result-item .thumbnail {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.result-item video {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}

.result-item .info {
    padding: 0.75rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.result-item .name {
    font-size: 0.75rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.result-item .download-btn {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.75rem;
}

.result-item .download-btn:hover {
    text-shadow: 0 0 10px var(--accent);
}

.results-actions {
    display: flex;
    gap: 1rem;
}

.results-actions .btn {
    flex: 1;
}

/* Admin Settings */
.settings-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.preview-box {
    position: relative;
    background: var(--bg-hover);
    border-radius: 8px;
    aspect-ratio: 16/9;
    overflow: hidden;
}

.preview-box .preview-asset {
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #333 25%, #2a2a2a 25%, #2a2a2a 50%, #333 50%, #333 75%, #2a2a2a 75%);
    background-size: 20px 20px;
}

.preview-box #watermark-preview {
    position: absolute;
    pointer-events: none;
}

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.settings-form .btn {
    margin-top: 0.5rem;
}

@media (max-width: 700px) {
    .settings-layout {
        grid-template-columns: 1fr;
    }
}

/* Stats */
.stats-row {
    display: flex;
    justify-content: space-around;
    text-align: center;
}

.stat {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
}

/* Logs Table */
.logs-table {
    overflow-x: auto;
}

.logs-header,
.logs-row {
    display: grid;
    grid-template-columns: 140px 1fr 80px 80px 100px;
    gap: 1rem;
    padding: 0.75rem;
    align-items: center;
}

.logs-header {
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    border-bottom: 1px solid var(--border);
}

.logs-row {
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}

.logs-row:last-child {
    border-bottom: none;
}

.log-time {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

.log-file {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-type {
    text-transform: uppercase;
    font-size: 0.7rem;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    text-align: center;
}

.log-type.image {
    background: rgba(0, 255, 136, 0.1);
    color: var(--accent);
}

.log-type.video {
    background: rgba(136, 136, 255, 0.1);
    color: #8888ff;
}

.no-logs {
    text-align: center;
    color: var(--text-secondary);
    padding: 2rem;
}

/* Footer */
footer {
    text-align: center;
    padding: 2rem;
}

.link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.875rem;
}

.link:hover {
    color: var(--accent);
}

/* Lightbox */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    cursor: zoom-out;
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 2.5rem;
    cursor: pointer;
    z-index: 1001;
    transition: color 0.2s;
}

.lightbox-close:hover {
    color: var(--accent);
}

.lightbox-content {
    max-width: 90vw;
    max-height: 90vh;
    cursor: default;
}

.lightbox-content img,
.lightbox-content video {
    max-width: 90vw;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 4px;
}

.lightbox-content img {
    display: block;
}

.lightbox-content video {
    display: none;
}

.lightbox.show-video .lightbox-content img {
    display: none;
}

.lightbox.show-video .lightbox-content video {
    display: block;
}

.result-item .thumbnail {
    cursor: zoom-in;
}

/* Utility */
.hidden {
    display: none !important;
}

/* Responsive */
@media (max-width: 600px) {
    header {
        padding: 1rem;
    }

    main {
        padding: 1rem;
    }

    .title {
        font-size: 1.25rem;
    }

    .stats-row {
        flex-direction: column;
        gap: 1.5rem;
    }

    .logs-header,
    .logs-row {
        grid-template-columns: 1fr 1fr;
        font-size: 0.75rem;
    }

    .logs-header span:nth-child(n+3),
    .logs-row span:nth-child(n+3) {
        display: none;
    }

    .results-actions {
        flex-direction: column;
    }
}
