/* --- Components --- */

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1.2rem;
    border-radius: var(--radius-sm);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s ease;
    border: 1px solid transparent;
    gap: 0.5rem;
    font-size: 0.95rem;
}

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

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: var(--shadow-lg);
}

.btn-primary-sm,
.btn-primary-lg {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* User profile button (navbar) */
.user-profile-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: transparent;
    border: none;
    color: var(--text-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 600;
    font-size: 0.85rem;
    box-shadow: none;
    outline: none;
}

.user-profile-btn img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.user-profile-btn:hover {
    transform: scale(1.05);
    box-shadow: none;
}

/* Dropdown menus (shared across pages) */
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 0.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 0.5rem;
    box-shadow: var(--shadow-lg);
    min-width: 200px;
    z-index: 200;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    transition: all 0.2s ease;
}

.dropdown-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s ease;
    color: var(--text-color);
    font-size: 0.9rem;
}

.dropdown-menu a.dropdown-item {
    color: var(--text-color);
}

.dropdown-menu a.dropdown-item:hover {
    color: var(--text-color);
}

.dropdown-item:hover {
    background: var(--surface-hover);
}

.dropdown-item svg {
    color: var(--text-muted);
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

/* Remix count styling: turns blue when > 0 */
.remix-stat.remixed,
.shortcut-stat.remix-stat.remixed,
.stat-item.remixed .stat-value {
    color: var(--primary-color);
}

.btn-primary-sm {
    padding: 0.6rem 1.2rem;
    font-size: 0.9rem;
}

.btn-primary-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-primary-sm:hover,
.btn-primary-lg:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.5);
}

.btn-secondary {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
}

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

.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.15s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Cards */
.ss-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    padding: 2rem;
    border-radius: 16px;
    transition: all 0.3s;
}

.ss-card:hover {
    transform: translateY(-5px);
    border-color: var(--text-muted);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.12);
    color: var(--primary-color);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.card-icon svg {
    width: 24px;
    height: 24px;
}

/* Inputs */
.input-glass {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 0.6rem 1rem;
    border-radius: var(--radius-sm);
    width: 100%;
    outline: none;
    transition: border-color 0.2s;
}

.input-glass:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.1);
}

.input-glass.full-width {
    width: 100%;
    padding: 1rem;
    border-radius: 8px;
    font-size: 1rem;
}

.input-glass.full-width:focus {
    background: var(--surface-hover);
}

/* Pills & Badges */
.pill {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.pill:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.1);
}

.pro-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary-color);
    color: white;
    font-size: 0.7rem;
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 700;
}

/* Modals */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

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

.modal-card {
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    width: 100%;
    max-width: 500px;
    padding: 2rem;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
    transform: scale(0.95);
    transition: transform 0.2s ease;
}

.modal-overlay.active .modal-card {
    transform: scale(1);
}

.auth-modal-card {
    border: 1px solid rgba(59, 130, 246, 0.25);
    box-shadow: 0 24px 60px rgba(15, 23, 42, 0.35);
    background: linear-gradient(180deg, rgba(59, 130, 246, 0.08), var(--surface-color));
}

.auth-modal-card .modal-header {
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    margin-bottom: 1.5rem;
}

.auth-modal-card .modal-body p {
    line-height: 1.6;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.modal-header h3 {
    font-size: 1.5rem;
    margin: 0;
}

.modal-header-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.modal-header-actions .btn-sm {
    padding: 0.4rem 0.9rem;
    font-size: 0.85rem;
}

.close-btn {
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 2rem;
    cursor: pointer;
    line-height: 1;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
}

.confirm-content {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
}

.confirm-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    background: rgba(148, 163, 184, 0.12);
    border: 1px solid rgba(148, 163, 184, 0.25);
    flex: 0 0 auto;
}

.confirm-icon svg {
    width: 20px;
    height: 20px;
}

.confirm-icon.danger {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.35);
}

.confirm-text p {
    margin: 0;
    line-height: 1.6;
}

.confirm-details {
    margin: 0.75rem 0 0 1.1rem;
    padding: 0;
    color: var(--text-muted);
    line-height: 1.5;
}
/* Rate Limit Indicator */
.rate-limit-indicator {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.35rem 0.6rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.limit-badge {
    display: flex;
    align-items: center;
    gap: 0.3rem;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    background: var(--surface-hover);
    transition: all 0.2s ease;
}

.limit-badge svg {
    opacity: 0.7;
}

.limit-badge.messages {
    color: var(--primary-color);
}

.limit-badge.downloads {
    color: var(--success-color, #22c55e);
}

.limit-badge.warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
}

.limit-badge.danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}
/* Loading Skeleton Cards */
.skeleton-card {
    pointer-events: none;
    cursor: default !important;
}

.skeleton-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.skeleton-icon {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-sm);
    background: var(--surface-hover);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

.skeleton-title {
    flex: 1;
    height: 20px;
    border-radius: 4px;
    background: var(--surface-hover);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    animation-delay: 0.1s;
}

.skeleton-description {
    height: 40px;
    border-radius: 4px;
    background: var(--surface-hover);
    margin-bottom: 1rem;
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    animation-delay: 0.2s;
}

.skeleton-meta {
    display: flex;
    gap: 1rem;
}

.skeleton-text {
    flex: 1;
    height: 14px;
    border-radius: 4px;
    background: var(--surface-hover);
    animation: skeleton-pulse 1.5s ease-in-out infinite;
    animation-delay: 0.3s;
}

@keyframes skeleton-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    padding: 1rem 1.5rem;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    z-index: 10000;
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    border-left: 3px solid #22c55e;
}

.toast-error {
    border-left: 3px solid #ef4444;
}

.toast-info {
    border-left: 3px solid var(--primary-color);
}

/* Reusable skeleton pulse animation */
.skeleton-pulse {
    animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* Info tooltip styling */
.info-tooltip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: help;
    position: relative;
}

.info-tooltip svg {
    transition: opacity 0.2s;
}

.info-tooltip:hover svg {
    opacity: 1 !important;
}

.info-tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background: var(--surface-color);
    color: var(--text-color);
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8rem;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-color);
    z-index: 1000;
}

.info-tooltip::before {
    content: '';
    position: absolute;
    bottom: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 6px solid transparent;
    border-top-color: var(--surface-color);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
    z-index: 1000;
}

.info-tooltip:hover::after,
.info-tooltip:hover::before {
    opacity: 1;
}
