/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --uxui-pink: #E91E8C;
    --uxui-pink-hover: #c41a78;
    --uxui-black: #1a1a1a;
}

body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    color: var(--uxui-black);
    line-height: 1.6;
}

.container {
    max-width: 720px;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* Header */
header {
    margin-bottom: 2.5rem;
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
}

.header-row > div {
    flex: 1;
    min-width: 0;
    text-align: left;
}

header h1 {
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.logout-btn {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: var(--uxui-black);
    border-color: #999;
    background: #f5f5f5;
}

header h1 .comunidad {
    color: var(--uxui-black);
    text-transform: lowercase;
}

header h1 .uxui {
    font-weight: 700;
    color: var(--uxui-pink);
    text-transform: uppercase;
}

header p {
    font-size: 0.9rem;
    color: #666;
}

/* Upload section */
.upload-section {
    margin-bottom: 2.5rem;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 2.5rem;
    text-align: center;
    transition: all 0.2s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.upload-area:hover,
.upload-area.dragover {
    border-color: var(--uxui-pink);
    background: #fef5fb;
}

.upload-icon {
    width: 3rem;
    height: 3rem;
    color: #999;
    margin-bottom: 0.75rem;
}

.upload-content h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: var(--uxui-black);
}

.upload-content p {
    font-size: 0.875rem;
    color: #666;
}

#fileInput {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* Files section */
.files-section h2 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--uxui-black);
}

.files-list {
    display: grid;
    gap: 0.75rem;
}

.file-item {
    background: #fafafa;
    border-radius: 8px;
    padding: 1rem 1.25rem;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-info h4 {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--uxui-black);
    margin-bottom: 0.25rem;
}

.file-info p {
    font-size: 0.8125rem;
    color: #666;
}

.file-info a {
    color: var(--uxui-pink);
    text-decoration: none;
    word-break: break-all;
}

.file-info a:hover {
    text-decoration: underline;
}

.copy-btn {
    background: var(--uxui-pink);
    color: white;
    border: none;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.copy-btn:hover {
    background: var(--uxui-pink-hover);
}

.delete-btn {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.delete-btn:hover {
    color: #dc2626;
    border-color: #fca5a5;
    background: #fef2f2;
}

/* Confirm delete modal */
.confirm-modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1rem;
}

.confirm-modal {
    background: #fff;
    border-radius: 12px;
    padding: 1.5rem 1.75rem;
    max-width: 400px;
    width: 100%;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}

.confirm-modal-message {
    font-size: 0.9375rem;
    color: var(--uxui-black);
    margin-bottom: 1.25rem;
    line-height: 1.5;
}

.confirm-modal-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
}

.confirm-modal-cancel {
    background: transparent;
    color: #666;
    border: 1px solid #ddd;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.2s;
}

.confirm-modal-cancel:hover {
    border-color: #999;
    color: var(--uxui-black);
    background: #f5f5f5;
}

.confirm-modal-confirm {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
}

.confirm-modal-confirm:hover {
    background: #b91c1c;
}

/* Processing indicator */
.processing {
    background: #fef3c7;
    border: 1px solid #f59e0b;
    color: #92400e;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.processing::before {
    content: '⏳';
}

/* Error messages */
.error {
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #dc2626;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.success {
    background: #f0fdf4;
    border: 1px solid #22c55e;
    color: #16a34a;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

/* Configuration button */
.config-button {
    transition: all 0.2s;
    font-weight: 500;
    border: none;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.config-button:hover {
    background: #2563eb !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

/* Authentication Modal */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    padding: 1rem;
}

.auth-modal-content {
    background: #fff;
    border-radius: 12px;
    padding: 2.25rem;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.12);
    max-width: 360px;
    width: 100%;
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 1.75rem;
}

.auth-modal-header h2 {
    font-size: 1.75rem;
    font-weight: 400;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.auth-modal-header h2 .comunidad {
    color: var(--uxui-black);
    text-transform: lowercase;
}

.auth-modal-header h2 .uxui {
    font-weight: 700;
    color: var(--uxui-pink);
    text-transform: uppercase;
}

.auth-modal-header p {
    font-size: 0.9rem;
    color: #666;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--uxui-black);
}

.form-group input {
    padding: 0.75rem 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-group input::placeholder {
    color: #999;
}

.form-group input:focus {
    outline: none;
    border-color: var(--uxui-pink);
    box-shadow: 0 0 0 2px rgba(233, 30, 140, 0.12);
}

.password-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.password-wrap input {
    padding-right: 2.75rem;
    flex: 1;
}

.password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2rem;
    height: 2rem;
    padding: 0;
    border: none;
    background: none;
    color: #666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: var(--uxui-pink);
}

.password-toggle:focus {
    outline: none;
    color: var(--uxui-pink);
}

.auth-button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 0.25rem;
}

.auth-button.primary {
    background: var(--uxui-pink);
    color: white;
}

.auth-button.primary:hover {
    background: var(--uxui-pink-hover);
}

.auth-info {
    background: #f8fafc;
    padding: 1rem;
    border-radius: 6px;
    border: 1px solid #e2e8f0;
}

.auth-info small {
    color: #64748b;
    line-height: 1.5;
}

.auth-error {
    background: #fef2f2;
    color: #dc2626;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #fecaca;
    margin-bottom: 1rem;
}

/* User Management */
.user-management {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.user-list {
    display: grid;
    gap: 1rem;
    margin-bottom: 1rem;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.user-info h4 {
    margin: 0;
    color: #1e293b;
}

.user-info p {
    margin: 0.25rem 0 0 0;
    color: #64748b;
    font-size: 0.875rem;
}

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

/* Delete Button */
.delete-button {
    background: #dc2626;
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 6px;
    font-size: 0.875rem;
    cursor: pointer;
    transition: background 0.2s;
}

.delete-button:hover {
    background: #b91c1c;
}

/* Current User Info */
.current-user {
    position: fixed;
    top: 1rem;
    left: 1rem;
    background: white;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    font-size: 0.875rem;
    color: #374151;
    z-index: 100;
}

/* Management Sections */
.management-section {
    margin-bottom: 2rem;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
}

.management-section h4 {
    margin: 0 0 1rem 0;
    color: #1e293b;
    font-size: 1.1rem;
}

/* Allowed Emails */
.allowed-emails-list {
    display: grid;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.email-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: white;
    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.email-info strong {
    color: #1e293b;
}

.email-info small {
    display: block;
    color: #6b7280;
    margin-top: 0.25rem;
}

.logout-button {
    background: #6b7280;
    color: white;
    border: none;
    padding: 0.25rem 0.75rem;
    border-radius: 4px;
    font-size: 0.75rem;
    cursor: pointer;
    margin-left: 0.5rem;
}

.logout-button:hover {
    background: #4b5563;
}

/* Notifications */
.notification {
    position: fixed;
    top: 1rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 8px;
    color: white;
    font-weight: 600;
    z-index: 1500;
    animation: slideDown 0.3s ease;
}

.notification.success {
    background: #10b981;
}

.notification.error {
    background: #ef4444;
}

.notification.info {
    background: #3b82f6;
}

@keyframes slideDown {
    from {
        transform: translateX(-50%) translateY(-100%);
        opacity: 0;
    }
    to {
        transform: translateX(-50%) translateY(0);
        opacity: 1;
    }
}

/* Responsive */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }

    .upload-section {
        padding: 2rem 1.5rem;
    }

    .upload-options {
        flex-direction: column;
        gap: 1rem;
    }

    .file-item {
        flex-direction: column;
        text-align: center;
    }

    .auth-modal-content {
        padding: 1.5rem;
        margin: 1rem;
    }

    .current-user {
        position: static;
        margin-bottom: 1rem;
    }

    .config-container {
        position: static !important;
        margin-bottom: 1rem;
    }
}