/* Reusable Components for Xshiver Platform */

/* Button Components */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-md) var(--spacing-lg);
    border: none;
    border-radius: var(--radius-md);
    font-family: var(--font-primary);
    font-size: 1rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-normal);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left var(--transition-slow);
}

.btn:hover::before {
    left: 100%;
}

.btn-primary {
    background: linear-gradient(135deg, var(--xshiver-blue), var(--xshiver-accent));
    color: white;
    box-shadow: var(--shadow-md);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--xshiver-accent), var(--electric-blue));
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.btn-secondary {
    background: transparent;
    color: var(--xshiver-blue);
    border: 2px solid var(--xshiver-blue);
}

.btn-secondary:hover {
    background: var(--xshiver-blue);
    color: white;
    transform: translateY(-2px);
}

.btn-outline {
    background: transparent;
    color: var(--silver-text);
    border: 1px solid var(--silver-text);
}

.btn-outline:hover {
    background: var(--silver-text);
    color: var(--xshiver-dark);
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger-red), #ff3742);
    color: white;
}

.btn-danger:hover {
    background: linear-gradient(135deg, #ff3742, var(--danger-red));
    transform: translateY(-2px);
}

.btn-success {
    background: linear-gradient(135deg, var(--success-green), #26d65a);
    color: white;
}

.btn-success:hover {
    background: linear-gradient(135deg, #26d65a, var(--success-green));
    transform: translateY(-2px);
}

/* Button Sizes */
.btn-sm {
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
}

.btn-lg {
    padding: var(--spacing-lg) var(--spacing-xl);
    font-size: 1.1rem;
}

.btn-xl {
    padding: var(--spacing-xl) var(--spacing-xxl);
    font-size: 1.2rem;
}

/* Icon Components */
.icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 16px;
}

.icon-sm {
    width: 16px;
    height: 16px;
    font-size: 12px;
}

.icon-lg {
    width: 24px;
    height: 24px;
    font-size: 20px;
}

.icon-xl {
    width: 32px;
    height: 32px;
    font-size: 24px;
}

/* Card Components */
.card {
    background: var(--card-dark);
    border: 1px solid var(--xshiver-secondary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-lg);
    transition: var(--transition-normal);
    box-shadow: var(--shadow-sm);
}

.card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
    border-color: var(--xshiver-blue);
}

.card-header {
    margin-bottom: var(--spacing-md);
    padding-bottom: var(--spacing-md);
    border-bottom: 1px solid var(--xshiver-secondary);
}

.card-title {
    font-size: 1.25rem;
    font-weight: bold;
    color: var(--xshiver-blue);
    margin-bottom: var(--spacing-xs);
}

.card-subtitle {
    color: var(--gray-text);
    font-size: 0.9rem;
}

.card-body {
    margin-bottom: var(--spacing-lg);
}

.card-footer {
    padding-top: var(--spacing-md);
    border-top: 1px solid var(--xshiver-secondary);
}

/* Loading Components */
.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(74, 144, 226, 0.3);
    border-top: 4px solid var(--xshiver-blue);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-dots {
    display: flex;
    gap: 4px;
}

.loading-dot {
    width: 8px;
    height: 8px;
    background: var(--xshiver-blue);
    border-radius: 50%;
    animation: bounce 1.4s ease-in-out infinite both;
}

.loading-dot:nth-child(1) { animation-delay: -0.32s; }
.loading-dot:nth-child(2) { animation-delay: -0.16s; }

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    } 40% {
        transform: scale(1);
    }
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--card-dark);
    color: var(--silver-text);
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    border-left: 4px solid var(--xshiver-blue);
    box-shadow: var(--shadow-lg);
    z-index: 9999;
    transform: translateX(100%);
    transition: var(--transition-normal);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: var(--success-green);
}

.toast-error {
    border-left-color: var(--danger-red);
}

.toast-warning {
    border-left-color: var(--gold-accent);
}

/* Modal Components */
.modal {
    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;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition-normal);
}

.modal.active {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background: var(--card-dark);
    border-radius: var(--radius-lg);
    padding: var(--spacing-xl);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    transition: var(--transition-normal);
}

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

/* Form Components */
.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    color: var(--silver-text);
    font-weight: 600;
    margin-bottom: var(--spacing-xs);
}

.form-input {
    width: 100%;
    padding: var(--spacing-md);
    background: var(--xshiver-secondary);
    border: 1px solid var(--gray-text);
    border-radius: var(--radius-md);
    color: var(--silver-text);
    font-size: 1rem;
    transition: var(--transition-fast);
}

.form-input:focus {
    outline: none;
    border-color: var(--xshiver-blue);
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.2);
}

.form-textarea {
    min-height: 100px;
    resize: vertical;
}

.form-select {
    appearance: none;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="%23e1e1e1"><polyline points="6,9 12,15 18,9"></polyline></svg>');
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 40px;
}

/* Badge Components */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: bold;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.badge-primary {
    background: var(--xshiver-blue);
    color: white;
}

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

.badge-warning {
    background: var(--gold-accent);
    color: var(--midnight-black);
}

.badge-danger {
    background: var(--danger-red);
    color: white;
}

/* Progress Components */
.progress {
    width: 100%;
    height: 8px;
    background: var(--xshiver-secondary);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.progress-bar {
    height: 100%;
    background: var(--gradient-primary);
    transition: width var(--transition-normal);
}

/* Tooltip Components */
.tooltip {
    position: absolute;
    background: rgba(0, 0, 0, 0.9);
    color: white;
    padding: var(--spacing-xs) var(--spacing-sm);
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    white-space: nowrap;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    transform: translateY(5px);
    transition: var(--transition-fast);
}

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

/* Animation Classes */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.animate-fade-in {
    animation: fadeIn 0.5s ease-in-out;
}

.animate-slide-up {
    animation: slideInUp 0.6s ease-out;
}

.animate-slide-down {
    animation: slideInDown 0.6s ease-out;
}

.animate-slide-left {
    animation: slideInLeft 0.6s ease-out;
}

.animate-slide-right {
    animation: slideInRight 0.6s ease-out;
}

/* Responsive Utilities */
.show-mobile {
    display: none;
}

.hide-mobile {
    display: block;
}

@media (max-width: 768px) {
    .show-mobile {
        display: block;
    }
    
    .hide-mobile {
        display: none;
    }
}

/* Accessibility Components */
.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: var(--xshiver-blue);
    color: white;
    padding: 8px;
    text-decoration: none;
    border-radius: var(--radius-sm);
    z-index: 10000;
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 6px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Focus styles for keyboard navigation */
.keyboard-navigation *:focus {
    outline: 2px solid var(--xshiver-blue);
    outline-offset: 2px;
}

/* Scrollbar Styling */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: var(--xshiver-dark);
}

::-webkit-scrollbar-thumb {
    background: var(--xshiver-blue);
    border-radius: var(--radius-sm);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--xshiver-accent);
}

