/**
 * BacklinkMarket - Custom Styles
 * Dark theme with accent colors
 */

/* ============================================
   Base Styles
   ============================================ */

:root {
    --dark-900: #0a0a0f;
    --dark-800: #12121a;
    --dark-700: #1a1a24;
    --dark-600: #24242f;
    --dark-500: #2e2e3a;
    --accent-primary: #6366f1;
    --accent-secondary: #8b5cf6;
    --accent-glow: #818cf8;
}

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

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

::-webkit-scrollbar-thumb {
    background: var(--dark-500);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--dark-600);
}

/* Selection color */
::selection {
    background: rgba(99, 102, 241, 0.3);
    color: white;
}

/* ============================================
   Text Styles
   ============================================ */

.gradient-text {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.text-gradient {
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ============================================
   Box Effects
   ============================================ */

.glow-box {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.1);
}

.glow-box-hover:hover {
    box-shadow: 0 0 40px rgba(99, 102, 241, 0.2);
}

.card-glow {
    position: relative;
}

.card-glow::before {
    content: '';
    position: absolute;
    inset: -1px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    border-radius: inherit;
    z-index: -1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.card-glow:hover::before {
    opacity: 0.5;
}

/* ============================================
   Background Effects
   ============================================ */

.grid-bg {
    background-image:
        linear-gradient(rgba(99, 102, 241, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(99, 102, 241, 0.03) 1px, transparent 1px);
    background-size: 50px 50px;
}

.dot-bg {
    background-image: radial-gradient(rgba(99, 102, 241, 0.15) 1px, transparent 1px);
    background-size: 20px 20px;
}

/* ============================================
   Button Styles
   ============================================ */

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-secondary));
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    border: none;
    cursor: pointer;
    line-height: 1.25;
}

.btn-primary:hover {
    opacity: 0.9;
    box-shadow: 0 10px 30px rgba(99, 102, 241, 0.25);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: var(--dark-700);
    border: 1px solid var(--dark-500);
    color: #d1d5db;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.25;
}

.btn-secondary:hover {
    border-color: var(--accent-primary);
    color: white;
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.5);
    color: #f87171;
    padding: 0.75rem 1.5rem;
    border-radius: 0.75rem;
    font-weight: 600;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
    line-height: 1.25;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.3);
}

/* Button sizes */
.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

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

/* ============================================
   Form Styles
   ============================================ */

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--dark-700);
    border: 1px solid var(--dark-500);
    border-radius: 0.75rem;
    color: white;
    transition: all 0.3s ease;
}

.form-input::placeholder {
    color: #6b7280;
}

.form-input:focus {
    outline: none;
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #d1d5db;
    margin-bottom: 0.5rem;
}

.form-error {
    font-size: 0.75rem;
    color: #f87171;
    margin-top: 0.25rem;
}

/* ============================================
   Card Styles
   ============================================ */

.card {
    background: var(--dark-800);
    border: 1px solid var(--dark-600);
    border-radius: 1rem;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

.card:hover {
    border-color: rgba(99, 102, 241, 0.5);
}

.card-header {
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--dark-600);
    margin-bottom: 1rem;
}

/* ============================================
   Table Styles
   ============================================ */

.table-wrapper {
    overflow-x: auto;
}

.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    padding: 1rem 1.5rem;
    text-align: left;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #9ca3af;
    background: rgba(26, 26, 36, 0.5);
}

.table td {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid var(--dark-600);
}

.table tr:hover td {
    background: rgba(26, 26, 36, 0.3);
}

/* ============================================
   Badge Styles
   ============================================ */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.75rem;
    font-weight: 500;
}

.badge-success {
    background: rgba(34, 197, 94, 0.2);
    color: #4ade80;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.2);
    color: #fbbf24;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.2);
    color: #f87171;
}

.badge-info {
    background: rgba(59, 130, 246, 0.2);
    color: #60a5fa;
}

.badge-gray {
    background: rgba(107, 114, 128, 0.2);
    color: #9ca3af;
}

/* ============================================
   Animation Classes
   ============================================ */

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

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

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

@keyframes pulse-glow {
    0%, 100% {
        box-shadow: 0 0 20px rgba(99, 102, 241, 0.4);
    }
    50% {
        box-shadow: 0 0 30px rgba(99, 102, 241, 0.6);
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

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

.animate-slide-up {
    animation: slideUp 0.3s ease;
}

.animate-slide-down {
    animation: slideDown 0.3s ease;
}

.animate-pulse-glow {
    animation: pulse-glow 2s infinite;
}

.animate-spin {
    animation: spin 1s linear infinite;
}

.animate-fade-out {
    animation: fadeIn 0.3s ease reverse;
}

/* ============================================
   Modal Styles
   ============================================ */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.modal-content {
    background: var(--dark-800);
    border: 1px solid var(--dark-600);
    border-radius: 1rem;
    width: 100%;
    max-width: 500px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid var(--dark-600);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    padding: 1.5rem;
    border-top: 1px solid var(--dark-600);
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* ============================================
   Loading States
   ============================================ */

.skeleton {
    background: linear-gradient(
        90deg,
        var(--dark-700) 25%,
        var(--dark-600) 50%,
        var(--dark-700) 75%
    );
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s infinite;
    border-radius: 0.5rem;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--dark-600);
    border-top-color: var(--accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* ============================================
   Tooltip Styles
   ============================================ */

.tooltip {
    position: relative;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.5rem 0.75rem;
    background: var(--dark-700);
    border: 1px solid var(--dark-500);
    border-radius: 0.5rem;
    font-size: 0.75rem;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: all 0.2s ease;
    z-index: 50;
}

.tooltip:hover::after {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(-5px);
}

/* ============================================
   Responsive Utilities
   ============================================ */

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

@media (min-width: 769px) {
    .hide-desktop {
        display: none !important;
    }
}

/* ============================================
   Dark Mode Enhancements
   ============================================ */

/* Better text readability */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Focus states */
*:focus {
    outline: none;
}

*:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Link hover effects */
a {
    transition: color 0.2s ease;
}

/* Image handling */
img {
    max-width: 100%;
    height: auto;
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .no-print {
        display: none !important;
    }
}
