/* ===========================
   ZURI ADMIN CSS
   Beautiful Admin Dashboard
   =========================== */

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
    background: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

/* Admin Header */
.admin-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    backdrop-filter: blur(10px);
}

.admin-nav {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 40px;
    height: 70px;
}

/* Logo */
.admin-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 22px;
    font-weight: 700;
    color: white;
    text-decoration: none;
}

.logo-icon {
    font-size: 28px;
    animation: pulse 2s ease-in-out infinite;
}

.logo-text {
    letter-spacing: -0.5px;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* Navigation Menu */
.admin-menu {
    display: flex;
    list-style: none;
    gap: 8px;
    margin: 0;
    padding: 0;
}

.admin-menu li a {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-weight: 500;
    font-size: 15px;
    transition: all 0.3s ease;
    border-radius: 8px;
    position: relative;
}

.admin-menu li a:hover {
    background: rgba(255, 255, 255, 0.15);
    color: white;
    transform: translateY(-1px);
}

.admin-menu li a.active {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.menu-icon {
    font-size: 18px;
}

/* User Section */
.admin-user {
    display: flex;
    align-items: center;
    gap: 15px;
}

.user-badge {
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

.admin-logout {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    background: rgba(255, 255, 255, 0.95);
    color: #667eea;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.admin-logout:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.logout-icon {
    font-size: 16px;
    transition: transform 0.3s ease;
}

.admin-logout:hover .logout-icon {
    transform: translateX(3px);
}

/* Page Container */
.page-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 100px 20px 40px;
}

.page-header {
    margin-bottom: 40px;
    text-align: center;
}

.page-header h1 {
    font-size: 36px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 10px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* Container Cards */
.container {
    background: white;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 40px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    color: #4a5568;
    margin-bottom: 8px;
    font-weight: 600;
    font-size: 14px;
}

input[type="text"],
input[type="password"],
input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #f7fafc;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Buttons */
button,
.btn {
    padding: 14px 28px;
    font-size: 15px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.btn-danger {
    background: linear-gradient(135deg, #f56565 0%, #c53030 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.3);
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(245, 101, 101, 0.4);
}

.btn-warning {
    background: linear-gradient(135deg, #ed8936 0%, #dd6b20 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(237, 137, 54, 0.3);
}

.btn-warning:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(237, 137, 54, 0.4);
}

.btn-info {
    background: linear-gradient(135deg, #4299e1 0%, #3182ce 100%);
    color: white;
    box-shadow: 0 4px 15px rgba(66, 153, 225, 0.3);
}

.btn-info:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 25px rgba(66, 153, 225, 0.4);
}

button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

/* Alerts */
.alert {
    padding: 14px 18px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.alert-success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.alert-warning {
    background: #feebc8;
    color: #744210;
    border-left: 4px solid #ed8936;
}

/* Reset Grid */
.reset-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 24px;
    margin-top: 30px;
}

.reset-card {
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    padding: 28px;
    border-radius: 14px;
    border: 2px solid #e2e8f0;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.reset-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.reset-card:hover {
    border-color: #667eea;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

.reset-card:hover::before {
    transform: scaleX(1);
}

.reset-card h3 {
    color: #2d3748;
    margin-bottom: 12px;
    font-size: 20px;
    font-weight: 700;
}

.reset-card p {
    color: #718096;
    font-size: 14px;
    margin-bottom: 20px;
    line-height: 1.6;
}

.reset-card button {
    width: 100%;
}

/* Status Messages */
.status-message {
    padding: 12px 16px;
    border-radius: 10px;
    margin-top: 15px;
    font-size: 13px;
    font-weight: 500;
    display: none;
    animation: slideIn 0.3s ease;
}

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

.status-message.success {
    background: #c6f6d5;
    color: #22543d;
    border-left: 4px solid #48bb78;
}

.status-message.error {
    background: #fed7d7;
    color: #742a2a;
    border-left: 4px solid #f56565;
}

.status-message.loading {
    background: #bee3f8;
    color: #2c5282;
    border-left: 4px solid #4299e1;
}

/* Responsive Design */
@media (max-width: 768px) {
    .admin-nav {
        padding: 0 20px;
        height: auto;
        flex-direction: column;
        gap: 15px;
        padding-top: 15px;
        padding-bottom: 15px;
    }
    
    .admin-menu {
        flex-direction: column;
        width: 100%;
    }
    
    .admin-menu li a {
        justify-content: center;
    }
    
    .admin-user {
        width: 100%;
        justify-content: center;
    }
    
    .page-container {
        padding-top: 200px;
    }
    
    .reset-grid {
        grid-template-columns: 1fr;
    }
    
    .page-header h1 {
        font-size: 28px;
    }
}

/* Utility Classes */
.subtitle {
    color: #718096;
    font-size: 15px;
    margin: 8px 0;
}

.text-center {
    text-align: center;
}

.mt-4 {
    margin-top: 1.5rem;
}

.mb-4 {
    margin-bottom: 1.5rem;
}

.category-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.category-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.category-card:hover {
    border-color: #667eea;
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.15);
    transform: translateY(-4px);
}

.category-card h3 {
    font-size: 18px;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 8px;
}

.category-card .url {
    font-size: 13px;
    color: #718096;
    margin-bottom: 12px;
    word-break: break-all;
}

.category-card .product-count {
    display: inline-block;
    padding: 6px 12px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.search-box {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
}

.search-box input {
    width: 100%;
    padding: 14px 20px 14px 50px;
    border: 2px solid #e2e8f0;
    border-radius: 50px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.search-box input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.search-box::before {
    content: '🔍';
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 18px;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

/* Laravel/Tailwind Default Utility Classes */
.relative {
    position: relative;
}

.inline-flex {
    display: inline-flex;
}

.flex {
    display: flex;
}

.flex-1 {
    flex: 1 1 0%;
}

.items-center {
    align-items: center;
}

.justify-between {
    justify-content: space-between;
}

.hidden {
    display: none;
}

.rounded-md {
    border-radius: 0.375rem;
}

.rounded-l-md {
    border-top-left-radius: 0.375rem;
    border-bottom-left-radius: 0.375rem;
}

.rounded-r-md {
    border-top-right-radius: 0.375rem;
    border-bottom-right-radius: 0.375rem;
}

.border {
    border-width: 1px;
}

.border-gray-300 {
    border-color: #d1d5db;
}

.border-gray-600 {
    border-color: #4b5563;
}

.bg-white {
    background-color: #ffffff;
}

.bg-gray-800 {
    background-color: #1f2937;
}

.px-2 {
    padding-left: 0.5rem;
    padding-right: 0.5rem;
}

.px-4 {
    padding-left: 1rem;
    padding-right: 1rem;
}

.py-2 {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.text-sm {
    font-size: 0.875rem;
    line-height: 1.25rem;
}

.font-medium {
    font-weight: 500;
}

.text-gray-500 {
    color: #6b7280;
}

.text-gray-600 {
    color: #4b5563;
}

.text-gray-700 {
    color: #374151;
}

.text-gray-400 {
    color: #9ca3af;
}

.text-gray-300 {
    color: #d1d5db;
}

.leading-5 {
    line-height: 1.25rem;
}

.cursor-default {
    cursor: default;
}

.shadow-sm {
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
}

.-ml-px {
    margin-left: -1px;
}

.ml-3 {
    margin-left: 0.75rem;
}

.z-0 {
    z-index: 0;
}

.rtl\:flex-row-reverse:dir(rtl) {
    flex-direction: row-reverse;
}

.w-5 {
    width: 1.25rem;
}

.h-5 {
    height: 1.25rem;
}

@media (min-width: 640px) {
    .sm\:hidden {
        display: none;
    }
    
    .sm\:flex {
        display: flex;
    }
    
    .sm\:flex-1 {
        flex: 1 1 0%;
    }
    
    .sm\:items-center {
        align-items: center;
    }
    
    .sm\:justify-between {
        justify-content: space-between;
    }
}

/* Override Laravel Default Pagination Styles */
.pagination-wrapper nav {
    max-width: max-content;
    margin: 0 auto;
}

.pagination-wrapper .hidden {
    display: none !important;
}

.pagination-wrapper .sm\:flex {
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    gap: 20px;
    flex-direction: column !important;
}

.pagination-wrapper .text-sm {
    font-size: 14px;
    color: #718096;
    font-weight: 500;
}

.pagination-wrapper .font-medium {
    font-weight: 700;
    color: #667eea;
}

/* Pagination Button Container */
.pagination-wrapper span.relative.z-0 {
    display: flex;
    gap: 6px;
    box-shadow: none !important;
    margin-top: 5px;
}

.pagination-wrapper span[aria-current] {
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    color: #4a5568 !important;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

/* All Pagination Links and Buttons */
.pagination-wrapper a,
.pagination-wrapper span[aria-disabled] span {
    border: 2px solid #e2e8f0 !important;
    border-radius: 8px !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    color: #4a5568 !important;
    background: white !important;
    transition: all 0.3s ease !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 44px !important;
    min-height: 44px !important;
    margin: 0 !important;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05) !important;
}

/* Arrow SVG Icons */
.pagination-wrapper svg {
    width: 18px !important;
    height: 18px !important;
    color: #4a5568 !important;
}

/* Hover State */
.pagination-wrapper a:hover {
    border-color: #667eea !important;
    background: rgba(102, 126, 234, 0.1) !important;
    color: #667eea !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2) !important;
}

.pagination-wrapper a:hover svg {
    color: #667eea !important;
}

/* Active/Current Page */
.pagination-wrapper span[aria-current] span {
    background: none;
    color: white !important;
    border-color: transparent !important;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3) !important;
}

/* Disabled State */
.pagination-wrapper span[aria-disabled] span {
    opacity: 0.4 !important;
    cursor: not-allowed !important;
    background: #f7fafc !important;
    color: #a0aec0 !important;
}

.pagination-wrapper span[aria-disabled] svg {
    color: #a0aec0 !important;
}

/* Remove negative margins from Laravel default */
.pagination-wrapper .-ml-px {
    margin-left: 0 !important;
}

/* Rounded corners fix */
.pagination-wrapper .rounded-l-md,
.pagination-wrapper .rounded-r-md {
    border-radius: 8px !important;
}

/* Focus states */
.pagination-wrapper a:focus,
.pagination-wrapper span:focus {
    outline: none !important;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.2) !important;
}

/* Mobile pagination (if shown) */
.pagination-wrapper .sm\:hidden a,
.pagination-wrapper .sm\:hidden span {
    padding: 12px 20px !important;
    font-size: 15px !important;
}

@media (min-width: 640px) {
    .pagination-wrapper .sm\:hidden {
        display: none !important;
    }
    
    .pagination-wrapper .hidden.sm\:flex-1 {
        display: block !important;
    }
}

.no-results {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 18px;
}

/* Product Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    z-index: 2000;
    overflow-y: auto;
    padding: 20px;
}

.modal.active {
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

.modal-content {
    background: white;
    border-radius: 16px;
    max-width: 1200px;
    width: 100%;
    margin: 40px auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    position: relative;
}

.modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 24px 30px;
    border-radius: 16px 16px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 24px;
    font-weight: 700;
    margin: 0;
}

.modal-search {
    padding: 20px 30px;
    border-bottom: 1px solid #e2e8f0;
}

.product-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.product-search-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.product-search-input::placeholder {
    color: #94a3b8;
}

.modal-close {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    font-size: 23px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    padding: 0px;
    line-height: 12px;
}

.modal-body {
    padding: 30px;
    max-height: calc(100vh - 300px);
    overflow-y: auto;
}

.modal-actions {
    padding: 20px 30px;
    border-top: 2px solid #e2e8f0;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.product-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    cursor: move;
    transition: all 0.3s ease;
}

.product-item:hover {
    background: white;
    border-color: #667eea;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.15);
}

.product-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.product-item.search-match {
    background: #fef3c7;
    border-color: #f59e0b;
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.25);
}

.product-item.search-match:hover {
    background: #fde68a;
    border-color: #d97706;
}

.drag-handle {
    font-size: 24px;
    color: #a0aec0;
    cursor: grab;
}

.drag-handle:active {
    cursor: grabbing;
}

.product-image {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
    border: 2px solid #e2e8f0;
}

.product-details {
    flex: 1;
}

.product-name {
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 4px;
    font-size: 16px;
}

.product-meta {
    font-size: 13px;
    color: #718096;
}

.product-positions {
    display: flex;
    gap: 12px;
    font-size: 13px;
}

.position-badge {
    padding: 4px 10px;
    background: #edf2f7;
    border-radius: 6px;
    font-weight: 600;
}

.position-badge.custom {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Position Controls */
.position-controls {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-left: auto;
    padding-left: 15px;
    border-left: 2px solid #dee2e6;
}

.control-buttons {
    display: flex;
    gap: 4px;
}

.control-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.control-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
    transform: translateY(-1px);
}

.control-btn:active:not(:disabled) {
    transform: translateY(0);
}

.control-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.position-input-group {
    display: flex;
    gap: 4px;
}

.position-input {
    width: 60px;
    height: 32px;
    padding: 4px 8px;
    border: 2px solid #e2e8f0;
    border-radius: 6px;
    font-size: 13px;
    text-align: center;
    transition: all 0.2s ease;
}

.position-input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.control-btn-go {
    width: 42px;
    height: 32px;
    padding: 0;
    border: none;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.control-btn-go:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(72, 187, 120, 0.3);
}

.control-btn-go:active {
    transform: translateY(0);
}

.loading {
    text-align: center;
    padding: 60px 20px;
    color: #718096;
    font-size: 18px;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}