/**
 * Medal of Honor Statistics - Additional Custom Styles
 */

/* Responsive navigation adjustments */
@media (max-width: 1024px) {
    .header-content {
        flex-wrap: wrap;
    }

    .nav {
        order: 3;
        width: 100%;
        justify-content: center;
        padding-top: 0.75rem;
        border-top: 1px solid var(--border-color);
        margin-top: 0.75rem;
    }

    .search-container {
        order: 2;
        max-width: 100%;
        flex: 1;
    }

    .header-controls {
        order: 1;
    }
}

@media (max-width: 640px) {
    .header-brand {
        width: 100%;
        justify-content: center;
    }

    .header-controls {
        width: 100%;
        justify-content: center;
    }

    .search-container {
        max-width: 100%;
    }

    .nav-link {
        padding: 0.375rem 0.625rem;
        font-size: 0.875rem;
    }
}

/* Mobile table improvements */
@media (max-width: 768px) {
    .table-container {
        border-radius: var(--radius-md);
    }

    table th,
    table td {
        padding: 0.625rem 0.5rem;
        font-size: 0.875rem;
    }

    .pagination-btn {
        min-width: 2rem;
        height: 2rem;
        padding: 0 0.5rem;
        font-size: 0.75rem;
    }

    .pagination-info {
        display: none;
    }
}

/* Loading state */
.loading {
    position: relative;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Pulse animation for loading */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.animate-pulse {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* Theme transition */
.theme-transitioning * {
    transition: none !important;
}

/* Improved focus states */
a:focus-visible,
button:focus-visible,
input:focus-visible,
.control-btn:focus-visible,
.pagination-btn:focus-visible {
    outline: 2px solid var(--accent-primary);
    outline-offset: 2px;
}

/* Player name with ellipsis for long names */
.player-name-truncate {
    max-width: 200px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: inline-block;
}

/* Stats highlighting */
.stat-highlight {
    position: relative;
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(245, 158, 11, 0.05) 100%);
}

/* Military theme special elements */
.theme-military .card {
    border-width: 2px;
    border-style: solid;
}

.theme-military .page-title::before {
    content: '★ ';
    color: var(--accent-primary);
}

.theme-military .page-title::after {
    content: ' ★';
    color: var(--accent-primary);
}

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

::-webkit-scrollbar-track {
    background: var(--bg-secondary);
}

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

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

/* Print styles */
@media print {
    .header,
    .footer,
    .pagination,
    .search-container,
    .header-controls,
    .control-btn {
        display: none !important;
    }

    body {
        background: white;
        color: black;
    }

    .card,
    .table-container {
        box-shadow: none;
        border: 1px solid #ccc;
    }
}

/* Tooltip styles */
[title] {
    position: relative;
}

/* Selection styling */
::selection {
    background: var(--accent-primary);
    color: var(--bg-primary);
}

/* Image error fallback */
img[src=""] {
    visibility: hidden;
}

img:not([src]) {
    visibility: hidden;
}

/* Space utilities for Tailwind-like classes */
.space-y-2 > * + * {
    margin-top: 0.5rem;
}

.space-y-4 > * + * {
    margin-top: 1rem;
}

/* Grid responsive adjustments */
@media (min-width: 768px) {
    .md\:grid-cols-2 {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .md\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .md\:grid-cols-4 {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .md\:col-span-2 {
        grid-column: span 2 / span 2;
    }
}

@media (min-width: 1024px) {
    .lg\:grid-cols-3 {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .lg\:col-span-2 {
        grid-column: span 2 / span 2;
    }
}

/* Width utilities */
.w-full { width: 100%; }
.w-16 { width: 4rem; }
.w-4 { width: 1rem; }
.h-12 { height: 3rem; }
.h-10 { height: 2.5rem; }
.h-4 { height: 1rem; }

/* Margin utilities */
.mx-auto { margin-left: auto; margin-right: auto; }
.mb-6 { margin-bottom: 1.5rem; }
.mt-4 { margin-top: 1rem; }

/* Padding utilities */
.p-0 { padding: 0; }
.p-8 { padding: 2rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }

/* Border utilities */
.border-b { border-bottom-width: 1px; }
.border-l-4 { border-left-width: 4px; }
.border-gray-600 { border-color: #4b5563; }
.border-gray-700 { border-color: #374151; }
.border-accent { border-color: var(--accent-primary); }

/* Background utilities */
.bg-gray-700 { background-color: #374151; }
.bg-gray-800 { background-color: #1f2937; }

/* Text utilities */
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-sm { font-size: 0.875rem; }
.uppercase { text-transform: uppercase; }
.last\:border-0:last-child { border: none; }

/* Object fit */
.object-cover { object-fit: cover; }

/* Rounded */
.rounded { border-radius: var(--radius-sm); }

/* Transition */
.transition-colors {
    transition-property: color, background-color, border-color;
    transition-timing-function: ease;
    transition-duration: 150ms;
}
