/* Premium Glassmorphism Dark Theme - Monochrome */
:root {
    --bg-color: #000000;
    --surface-color: rgba(20, 20, 20, 0.7);
    --surface-border: rgba(255, 255, 255, 0.15);
    --primary: #ffffff;
    --primary-hover: #e0e0e0;
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --success: #10b981;
    --danger: #ef4444;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'DM Sans', sans-serif;
}

body {
    background: linear-gradient(-45deg, #000000, #1a1a1a, #0a0a0a, #222222);
    background-size: 400% 400%;
    animation: gradientBG 15s ease infinite;
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    padding: 2rem;
}

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

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

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

.app-container {
    width: 100%;
    max-width: 80%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
}

.header {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 1.5rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

.logo {
    display: flex;
    align-items: center;
    gap: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary);
}

.icon-brand {
    color: var(--primary);
    width: 28px;
    height: 28px;
}

.settings {
    display: flex;
    gap: 2rem;
}

.setting-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--text-muted);
}

input[type=range] {
    accent-color: var(--primary);
    cursor: poDM Sans;
    width: 100px;
}

select {
    background: rgb(255 94 0 / 38%);
    color: var(--text-main);
    border: 1px solid rgb(255 141 0 / 67%);
    padding: 0.5rem 0.8rem;
    border-radius: 8px;
    outline: none;
    cursor: poDM Sans;
    font-size: 0.9rem;
}

select option {
    background-color: #a13d00;
    color: #ffffff;
}

.drop-zone {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 2px dashed var(--primary);
    border-radius: 16px;
    padding: 4rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    cursor: poDM Sans;
    position: relative;
    overflow: hidden;
}

.drop-zone::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at center, rgba(255, 255, 255, 0.1) 0%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.drop-zone.dragover::before {
    opacity: 1;
}

.drop-zone.dragover {
    border-color: #ffffff;
    transform: scale(1.02);
}

.drop-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    position: relative;
    z-index: 1;
}

.icon-large {
    width: 64px;
    height: 64px;
    color: var(--primary);
    opacity: 0.9;
    margin-bottom: 0.5rem;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
}

p {
    color: var(--text-muted);
}

button {
    cursor: poDM Sans;
    font-weight: 500;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: none;
    outline: none;
}

.btn-primary {
    background: var(--primary);
    color: #000000;
    padding: 0.75rem 2rem;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 14px rgba(255, 255, 255, 0.2);
    margin-top: 1rem;
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 255, 255, 0.3);
}

.btn-secondary {
    background: rgba(16, 185, 129, 0.1);
    color: var(--success);
    border: 1px solid rgba(16, 185, 129, 0.2);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.btn-secondary:hover {
    background: rgba(16, 185, 129, 0.2);
}

.btn-outline {
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--surface-border);
    padding: 0.5rem 1rem;
    border-radius: 8px;
}

.btn-outline:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.results-area {
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 1.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.4s ease-out;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--surface-border);
}

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

.total-saved {
    color: var(--text-main);
    font-size: 0.95rem;
}

.total-saved strong {
    color: var(--success);
    font-size: 1.1rem;
    margin-left: 0.25rem;
}

.image-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.image-item {
    display: flex;
    align-items: center;
    background: rgb(48 48 48 / 50%);
    border: 1px solid var(--surface-border);
    border-radius: 12px;
    padding: 1rem;
    gap: 1.5rem;
    animation: slideUp 0.3s ease-out;
    transition: transform 0.2s ease;
}

.image-item:hover {
    transform: translateX(4px);
    background: rgba(30, 41, 59, 0.8);
}

.item-thumb {
    width: 60px;
    height: 60px;
    border-radius: 8px;
    object-fit: cover;
    background: rgba(0, 0, 0, 0.3);
}

.item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.item-name {
    font-weight: 500;
    font-size: 1rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 250px;
}

.item-meta {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.item-progress {
    width: 200px;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.progress-bar-wrap {
    flex: 1;
    height: 6px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 3px;
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--success);
    width: 0%;
    transition: width 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}

.item-stats {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    width: 100px;
    font-size: 0.85rem;
}

.stat-saved {
    color: var(--success);
    font-weight: 600;
}

.item-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(59, 130, 246, 0.1);
    color: var(--primary);
    border: 1px solid transparent;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-icon:hover {
    background: var(--primary);
    color: white;
    transform: translateY(-2px);
}

.spin {
    animation: spin 1s linear infinite;
}

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

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

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

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-10px);
    }

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

/* Extracted from index.php */
.login-container {
    max-width: 400px;
    width: 100%;
    margin: auto;
    background: var(--surface-color);
    backdrop-filter: blur(16px);
    border: 1px solid var(--surface-border);
    border-radius: 16px;
    padding: 2.5rem;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    text-align: center;
    margin-top: 15vh;
}

.login-container h2 {
    margin-bottom: 1.5rem;
    color: var(--primary);
}

.form-group {
    margin-bottom: 1.2rem;
    text-align: left;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    border: 1px solid var(--surface-border);
    background: rgba(15, 23, 42, 0.8);
    color: white;
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
}

.login-btn {
    width: 100%;
    margin-top: 1rem;
}

.error-msg {
    color: var(--danger);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.success-msg {
    color: var(--success);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

.login-logo {
    width: 64px;
    height: 64px;
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px rgba(255, 255, 255, 0.3));
}

.auth-link-text {
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.auth-link {
    color: var(--primary);
    text-decoration: none;
}

.icon-brand-img {
    width: 32px;
    height: 32px;
    object-fit: contain;
}

.setting-group-usage {
    background: rgba(255, 255, 255, 0.1);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.usage-icon {
    width: 16px;
    height: 16px;
    color: var(--primary);
}

.usage-text {
    color: white;
    font-weight: 500;
    font-size: 12px;
}

.usage-count {
    color: var(--success);
}

.btn-logout {
    padding: 0.4rem 0.8rem;
    margin-left: 1rem;
    text-decoration: none;
}

.btn-logout-icon {
    width: 16px;
    height: 16px;
    vertical-align: middle;
}

.secure-text {
    margin-top: 20px;
    font-size: 0.85rem;
    color: #64748b;
}

.secure-icon {
    width: 14px;
    height: 14px;
    vertical-align: middle;
    margin-right: 4px;
}

#resultsArea {
    display: none;
}

.quality-label,
.format-label {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.quality-label {
    border-left: 3px solid #3b82f6;
    /* Blue accent */
}

.format-label {
    border-left: 3px solid #8b5cf6;
    /* Purple accent */
}