/* ============================================================
   Common Styles — Buttons, Notifications, Icons, Overlays
   AUDC Brand Colours
   ============================================================ */

/* Base button */
.button {
    position: relative;
    overflow: hidden;
    background-color: #0069B4;
    color: white;
    padding: 12px 24px;
    margin: 2px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 16px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: background-color 0.2s ease, box-shadow 0.2s ease;
}

.button:hover {
    filter: brightness(112%);
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
}

.button:active {
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

.button:focus-visible {
    outline: 3px solid #35D2D0;
    outline-offset: 2px;
}

/* Ripple effect */
.ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.6);
    transform: scale(0);
    animation: ripple-animation 0.6s linear;
    pointer-events: none;
}

@keyframes ripple-animation {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* Loading spinner */
.loading {
    position: absolute;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.6);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    left: calc(50% - 10px);
    top: calc(50% - 10px);
    display: none;
}

@keyframes spin {
    0%   { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Snackbar / toast notification */
.snackbar {
    visibility: hidden;
    min-width: 280px;
    max-width: 480px;
    color: #fff;
    text-align: left;
    border-radius: 6px;
    padding: 14px 18px;
    position: fixed;
    z-index: 9999;
    right: 24px;
    top: 24px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
    transition: visibility 0s, opacity 0.3s ease;
    opacity: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.snackbar.success { background-color: #74E5C3; color: #222222; }
.snackbar.error   { background-color: #c62828; }

.snackbar.show {
    visibility: visible;
    opacity: 1;
}

.snackbar-close {
    cursor: pointer;
    margin-left: auto;
    flex-shrink: 0;
    font-size: 18px;
    line-height: 1;
}

/* Utility */
.dim-text {
    opacity: 0.4;
    pointer-events: none;
}

/* Icon buttons */
.download-icon-btn,
.delete-icon-btn {
    border: none;
    background: transparent;
    font-size: 22px;
    color: #757575;
    cursor: pointer;
    padding: 6px;
    border-radius: 50%;
    transition: color 0.2s ease, background-color 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.download-icon-btn:hover { color: #0069B4; background-color: rgba(0, 105, 180, 0.08); }
.delete-icon-btn:hover   { color: #c62828; background-color: rgba(198, 40, 40, 0.08); }

.download-icon-btn:focus-visible,
.delete-icon-btn:focus-visible {
    outline: 2px solid currentColor;
    outline-offset: 2px;
}

/* Confirmation popup */
.popup-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    animation: fade-in-overlay 0.15s ease;
}

@keyframes fade-in-overlay {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.popup-content {
    background: #fff;
    padding: 28px 24px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    width: 320px;
    animation: slide-up 0.2s ease;
}

@keyframes slide-up {
    from { transform: translateY(12px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.popup-content h3 {
    margin: 0 0 10px;
    font-size: 18px;
    color: #222222;
}

.popup-content p {
    margin: 0 0 20px;
    color: #666666;
    font-size: 14px;
}

.popup-btn {
    padding: 9px 20px;
    margin: 4px;
    border: none;
    cursor: pointer;
    border-radius: 5px;
    font-size: 14px;
    font-weight: 600;
    transition: filter 0.2s ease;
}

.popup-btn:focus-visible {
    outline: 2px solid #0069B4;
    outline-offset: 2px;
}

.popup-btn:hover { filter: brightness(90%); }

.confirm { background-color: #74E5C3; color: #222222; }
.cancel  { background-color: #c62828; color: white; }

/* Change Password modal */
.cp-modal {
    width: 360px;
    text-align: left;
}

.cp-modal h3 {
    text-align: center;
    margin-bottom: 16px;
}

.cp-input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 16px;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input {
    flex: 1;
    padding: 9px 40px 9px 12px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}

.password-input-wrapper input:focus {
    border-color: #0069B4;
    box-shadow: 0 0 0 3px rgba(0, 105, 180, 0.12);
}

.toggle-pwd-btn {
    position: absolute;
    right: 8px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    color: #757575;
    padding: 0;
    line-height: 1;
}

.toggle-pwd-btn:hover { color: #0069B4; }

.cp-policy-hint {
    margin: 0;
    font-size: 12px;
    color: #888;
}

.popup-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}
