:root {
    --primary-color: #6366f1;
    --primary-hover: #4f46e5;
    --bg-color: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-color: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --error-color: #ef4444;
    --success-color: #10b981;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Dynamic Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: -1;
    background: radial-gradient(circle at 15% 50%, rgba(99, 102, 241, 0.15), transparent 25%),
                radial-gradient(circle at 85% 30%, rgba(168, 85, 247, 0.15), transparent 25%);
    animation: pulse 15s ease-in-out infinite alternate;
}

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

.container {
    width: 100%;
    max-width: 500px;
    padding: 20px;
    z-index: 1;
}

/* Glassmorphism Card */
.card {
    background: var(--card-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.3s ease;
    opacity: 0;
    transform: translateY(20px);
    display: none;
}

.card.active {
    display: block;
    animation: slideUp 0.5s forwards ease-out;
}

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

.hidden {
    display: none !important;
}

/* Typography & Icons */
h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 10px;
    text-align: center;
}

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

p {
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 30px;
    font-weight: 300;
}

.icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 20px;
    color: var(--primary-color);
}

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

.subtitle {
    text-align: left;
    margin-bottom: 20px;
}

/* Form Elements */
.input-group {
    margin-bottom: 20px;
}

input[type="password"] {
    width: 100%;
    padding: 15px 20px;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    background: rgba(15, 23, 42, 0.6);
    color: var(--text-color);
    font-size: 1rem;
    transition: all 0.3s;
}

input[type="password"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
    width: 100%;
    padding: 15px;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(99, 102, 241, 0.4);
}

.secondary-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.text-btn {
    width: auto;
    padding: 5px 10px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.9rem;
}

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

.error-message {
    color: var(--error-color);
    font-size: 0.9rem;
    margin-top: 10px;
    margin-bottom: 0;
    min-height: 20px;
}

/* Dropzone */
.dropzone {
    border: 2px dashed var(--border-color);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: rgba(15, 23, 42, 0.3);
    position: relative;
    overflow: hidden;
}

.dropzone:hover, .dropzone.dragover {
    border-color: var(--primary-color);
    background: rgba(99, 102, 241, 0.05);
}

.dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    pointer-events: none;
}

.dropzone svg {
    color: var(--primary-color);
    margin-bottom: 10px;
}

.dropzone h3 {
    font-size: 1.1rem;
    font-weight: 400;
}

.dropzone p {
    margin-bottom: 0;
    font-size: 0.85rem;
}

.hidden-input {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Selected Files List */
.selected-files {
    margin-top: 20px;
}

.selected-files h4 {
    margin-bottom: 10px;
    font-weight: 400;
    color: var(--text-muted);
}

#file-list {
    list-style: none;
    max-height: 150px;
    overflow-y: auto;
    margin-bottom: 20px;
    background: rgba(0,0,0,0.2);
    border-radius: 8px;
    padding: 10px;
}

#file-list::-webkit-scrollbar {
    width: 6px;
}

#file-list::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

#file-list li {
    font-size: 0.9rem;
    padding: 5px 0;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

#file-list li:last-child {
    border-bottom: none;
}

.actions {
    display: flex;
    gap: 10px;
}

/* Progress Bar */
.progress-container {
    margin-top: 20px;
}

.progress-info {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.9rem;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--primary-color);
    width: 0%;
    transition: width 0.3s ease;
}

/* Success Message */
.success-message {
    text-align: center;
    margin-top: 20px;
    animation: fadeIn 0.5s;
}

.success-message svg {
    color: var(--success-color);
    margin-bottom: 15px;
}

.success-message p {
    color: var(--success-color);
    font-weight: 600;
    margin-bottom: 20px;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Responsive */
@media (max-width: 600px) {
    .card {
        padding: 30px 20px;
    }
}

/* Gallery & Modal */
.card.card-large {
    max-width: 800px;
}

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

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 15px;
    margin-top: 20px;
    max-height: 400px;
    overflow-y: auto;
    padding-right: 5px;
}

.gallery-grid::-webkit-scrollbar {
    width: 6px;
}

.gallery-grid::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.gallery-item {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 8px;
    background: rgba(0,0,0,0.2);
    cursor: pointer;
    transition: transform 0.2s;
}

.gallery-item:hover {
    transform: scale(1.05);
}

.modal {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0,0,0,0.9);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
}

.modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-content {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 20px; right: 30px;
    color: white;
    font-size: 3rem;
    cursor: pointer;
    transition: color 0.2s;
}

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