/* components.css */

/* =============== BUTTONS =============== */
.btn {
    padding: 12px 20px;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 14px;
    font-weight: 600;
    font-family: var(--font-family);
    cursor: pointer;
    transition: var(--transition-fast);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
}

.btn:active {
    transform: scale(0.98);
}

/* Ripple pseudo-element */
.btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(circle, var(--primary-very-light) 10%, transparent 10.01%);
    transform: scale(10);
    opacity: 0;
    transition: transform 0.5s, opacity 0.5s;
}

.btn:active::after {
    transform: scale(0);
    opacity: 0.3;
    transition: 0s;
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 2px 8px rgba(var(--primary-rgb), 0.25);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-primary:active {
    background: var(--primary-dark);
    box-shadow: 0 1px 2px rgba(var(--primary-rgb), 0.15);
    transform: scale(0.98);
}

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

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

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

.btn-success:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

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

.btn-danger:hover {
    filter: brightness(0.95);
    transform: translateY(-1px);
}

.btn-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

.btn-group .btn {
    flex: 1;
}

/* =============== LOADING & TOASTS =============== */

/* Overlay для затемнения — light theme */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(254, 251, 243, 0.85);
    backdrop-filter: blur(20px);
    z-index: 999;
    display: none;
}

/* Overlay — dark theme */
[data-theme="dark"] .loading-overlay {
    background: rgba(30, 27, 20, 0.85);
}

.loading-overlay.active {
    display: block;
}

.loading {
    display: none;
    text-align: center;
    padding: 48px 32px;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 1000;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius-large);
    box-shadow: var(--shadow-lg);
    min-width: 320px;
    max-width: 400px;
}

.loading.active {
    display: block;
}

.spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--border);
    border-top: 4px solid var(--primary);
    border-right: 4px solid var(--primary);
    border-radius: 50%;
    animation: spin 1.2s linear infinite;
    margin: 0 auto 24px;
}

.loading .section-title {
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    display: block;
}

.loading .text-gray {
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.5;
    max-width: 280px;
    margin: 0 auto;
    text-align: center;
}

.toast {
    position: fixed;
    top: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-dark);
    color: white;
    padding: 12px 20px;
    border-radius: var(--border-radius-pill);
    font-weight: 600;
    z-index: 1001;
    animation: slideDown 0.3s ease-out;
    max-width: 90%;
    text-align: center;
    line-height: 1.3;
}

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

/* =============== MODALS =============== */

/* Success Modal */
.success-modal {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    z-index: 99999 !important;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(254, 251, 243, 0.85);
    backdrop-filter: blur(20px);
}

[data-theme="dark"] .modal-overlay {
    background: rgba(30, 27, 20, 0.85);
}

.modal-content {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 32px 24px;
    box-shadow: var(--shadow-lg);
    position: relative;
    z-index: 1;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

.modal-icon {
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-title {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: var(--text-primary);
}

.modal-message {
    font-size: 16px;
    line-height: 1.5;
    margin: 0 0 24px 0;
    color: var(--text-secondary);
}

.modal-btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 500;
}

/* =============== VIDEO MODAL =============== */
.video-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
}

.video-modal {
    background: var(--surface);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.video-header {
    background: var(--primary);
    color: white;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.video-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.close-video-btn {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--border-radius-small);
    transition: var(--transition-fast);
}

.close-video-btn:hover {
    background: rgba(255, 255, 255, 0.2);
}

.video-content {
    padding: 20px;
}

