/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    color: #fff;
}

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

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

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

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

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

.btn-edit {
    background-color: #5865f2;
}

.btn-edit:hover {
    background-color: #4752c4;
}

.btn-warning {
    background-color: #fee75c;
    color: #000;
}

.btn-warning:hover {
    background-color: #fede3a;
}

.btn-success {
    background-color: #57f287;
    color: #000;
}

.btn-success:hover {
    background-color: #43d974;
}

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

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

.btn-full {
    width: 100%;
}

/* Inputs */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
}

.input-group label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    color: var(--text-secondary);
    letter-spacing: 0.5px;
}

.input-group input {
    padding: 10px 12px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background-color: var(--bg-input);
    color: var(--text-primary);
    font-size: 16px;
    outline: none;
    transition: border-color 0.2s;
}

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

.input-error {
    font-size: 12px;
    color: var(--danger);
    min-height: 16px;
}

/* Password strength indicator */
.password-strength {
    margin-top: -4px;
    margin-bottom: 4px;
}

.strength-bar {
    height: 4px;
    background: var(--bg-tertiary);
    border-radius: 2px;
    overflow: hidden;
}

.strength-fill {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width 0.3s, background-color 0.3s;
}

.strength-label {
    font-size: 12px;
    font-weight: 600;
    margin-top: 4px;
}

.strength-tips {
    font-size: 11px;
    color: var(--text-muted);
    margin-top: 2px;
}

/* Auth page layout */
.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: var(--bg-primary);
}

.auth-card {
    background-color: var(--bg-secondary);
    padding: 32px;
    border-radius: 8px;
    width: 100%;
    max-width: 420px;
    box-shadow: 0 4px 12px var(--shadow);
}

.auth-logo {
    display: block;
    width: 80px;
    height: auto;
    margin: 0 auto 12px;
}

.auth-card h1 {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
    text-align: center;
}

.auth-card p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 24px;
    text-align: center;
}

.auth-card .auth-link {
    text-align: center;
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-secondary);
}

.auth-card .auth-link a {
    color: var(--accent);
    cursor: pointer;
}

/* Toast notifications */
#toast-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    padding: 12px 20px;
    border-radius: 6px;
    color: #fff;
    font-size: 14px;
    max-width: 360px;
    animation: toast-in 0.3s ease-out;
    box-shadow: 0 4px 12px var(--shadow);
}

.toast-error {
    background-color: var(--danger);
}

.toast-success {
    background-color: #43b581;
}

.toast-info {
    background-color: var(--accent);
}

.toast-exit {
    animation: toast-out 0.3s ease-in forwards;
}

@keyframes toast-in {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes toast-out {
    from { transform: translateX(0); opacity: 1; }
    to { transform: translateX(100%); opacity: 0; }
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal {
    background-color: var(--bg-secondary);
    border-radius: 8px;
    padding: 24px;
    max-width: 480px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 8px 24px var(--shadow);
}

.modal h2 {
    font-size: 20px;
    margin-bottom: 16px;
}

/* Image cropper */
.cropper-overlay {
    position: fixed;
    inset: 0;
    z-index: 3000;
    background: rgba(0,0,0,0.8);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.cropper-container {
    position: relative;
    max-width: 90vw;
    max-height: 70vh;
}

.cropper-canvas {
    display: block;
    max-width: 90vw;
    max-height: 70vh;
    cursor: move;
}

.cropper-actions {
    display: flex;
    gap: 12px;
    margin-top: 16px;
}

.cropper-hint {
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    margin-top: 8px;
}

/* Universal file preview modal */
.file-preview-overlay {
    position: fixed;
    inset: 0;
    z-index: 4000;
    background: rgba(0,0,0,0.85);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.fp-close {
    position: absolute;
    top: 16px;
    right: 24px;
    background: none;
    border: none;
    color: #fff;
    font-size: 32px;
    cursor: pointer;
    z-index: 10;
    opacity: 0.7;
}

.fp-close:hover {
    opacity: 1;
}

.fp-content {
    max-width: 90vw;
    max-height: 75vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fp-image {
    max-width: 90vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 4px;
}

.fp-video {
    max-width: 90vw;
    max-height: 75vh;
    border-radius: 4px;
    background: #000;
}

.fp-pdf {
    width: 80vw;
    height: 75vh;
    border-radius: 4px;
    background: #fff;
}

.fp-audio-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 16px;
    padding: 32px;
}

.fp-audio-icon {
    font-size: 64px;
}

.fp-audio {
    width: 400px;
    max-width: 90vw;
}

.fp-unknown {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: #fff;
    padding: 32px;
}

.fp-unknown-icon {
    font-size: 64px;
    margin-bottom: 12px;
}

.fp-footer {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 12px;
    color: rgba(255,255,255,0.7);
    font-size: 13px;
}

.fp-download {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
}

.fp-download:hover {
    text-decoration: underline;
}
