/* Modern RR Motors Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&display=swap');

:root {
    /* Modern Color Palette */
    --primary-color: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    --secondary-color: #ec4899;
    --accent-color: #f59e0b;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --info-color: #3b82f6;

    /* Neutral Colors */
    --dark-bg: #0f172a;
    --dark-surface: #1e293b;
    --dark-border: #334155;
    --text-primary: #f1f5f9;
    --text-secondary: #cbd5e1;
    --text-muted: #94a3b8;

    /* Light Theme */
    --light-bg: #f8fafc;
    --light-surface: #ffffff;
    --light-border: #e2e8f0;
    --light-text: #1e293b;

    /* Spacing */
    --spacing-xs: 0.25rem;
    --spacing-sm: 0.5rem;
    --spacing-md: 1rem;
    --spacing-lg: 1.5rem;
    --spacing-xl: 2rem;
    --spacing-2xl: 3rem;

    /* Border Radius */
    --radius-sm: 0.375rem;
    --radius-md: 0.5rem;
    --radius-lg: 0.75rem;
    --radius-xl: 1rem;
    --radius-2xl: 1.5rem;

    /* Shadows */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    /* Transitions */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 500ms cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: var(--light-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Modern Login Page Styles */
.login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-lg);
    position: relative;
    overflow: hidden;
}

.login-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 255, 255, 0.1) 1px, transparent 1px);
    background-size: 50px 50px;
    animation: moveBackground 20s linear infinite;
}

@keyframes moveBackground {
    0% {
        transform: translate(0, 0);
    }

    100% {
        transform: translate(50px, 50px);
    }
}

.vin-search-container {
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

#vinInput {
    border: 2px solid var(--primary-light) !important;
    height: 45px;
}

.vin-search-container .btn-action {
    height: 45px;
    white-space: nowrap;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    padding: var(--spacing-2xl);
    width: 100%;
    max-width: 450px;
    position: relative;
    z-index: 1;
    animation: slideUp 0.6s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.login-logo {
    width: 100%;
    max-width: 300px;
    height: auto;
    border-radius: var(--radius-lg);
    margin-bottom: var(--spacing-lg);
    box-shadow: var(--shadow-lg);
}

.login-title {
    font-size: 2rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--spacing-sm);
}

.form-group {
    margin-bottom: var(--spacing-lg);
}

.form-label {
    display: block;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--light-text);
    font-size: 0.875rem;
}

.form-input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--light-border);
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-base);
    background: var(--light-surface);
}

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

.form-input::placeholder {
    color: var(--text-muted);
}

.btn {
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-block;
    text-align: center;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    box-shadow: var(--shadow-md);
    width: 100%;
}

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

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

.alert {
    padding: var(--spacing-md);
    border-radius: var(--radius-md);
    margin-bottom: var(--spacing-lg);
    font-size: 0.875rem;
    animation: slideDown 0.3s ease-out;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger-color);
    color: #991b1b;
}

.contact-info {
    text-align: center;
    margin-top: var(--spacing-xl);
    padding: var(--spacing-lg);
    background: rgba(99, 102, 241, 0.05);
    border-radius: var(--radius-lg);
    font-size: 0.875rem;
    color: var(--light-text);
}

.contact-info strong {
    display: block;
    margin-bottom: var(--spacing-sm);
    font-size: 1rem;
    color: var(--primary-color);
}

.social-links {
    display: flex;
    justify-content: center;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
    flex-wrap: wrap;
}

.social-link {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    padding: var(--spacing-sm) var(--spacing-md);
    background: var(--light-surface);
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--light-text);
    transition: all var(--transition-base);
    box-shadow: var(--shadow-sm);
    font-size: 0.875rem;
}

.social-link:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-md);
}

.social-icon {
    width: 32px;
    height: 32px;
    border-radius: var(--radius-sm);
}

/* Admin Panel Styles */
.admin-container {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: var(--spacing-2xl) var(--spacing-lg);
}

.admin-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
    animation: fadeIn 0.6s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.admin-title {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    margin-bottom: var(--spacing-sm);
}

.admin-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    max-width: 1200px;
    margin: 0 auto;
}

.admin-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    animation: slideUp 0.6s ease-out;
    animation-fill-mode: both;
}

.admin-card:nth-child(1) {
    animation-delay: 0.1s;
}

.admin-card:nth-child(2) {
    animation-delay: 0.2s;
}

.admin-card:nth-child(3) {
    animation-delay: 0.3s;
}

.admin-card:nth-child(4) {
    animation-delay: 0.4s;
}

.admin-card:nth-child(5) {
    animation-delay: 0.5s;
}

.admin-card:nth-child(6) {
    animation-delay: 0.6s;
}

.admin-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.admin-card-icon {
    font-size: 2.5rem;
    margin-bottom: var(--spacing-md);
    display: block;
}

.admin-card-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: var(--spacing-md);
    color: var(--light-text);
}

.admin-card-btn {
    width: 100%;
    padding: var(--spacing-md);
    border: none;
    border-radius: var(--radius-lg);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    display: block;
    text-align: center;
    color: white;
}

.btn-card-primary {
    background: linear-gradient(135deg, #6366f1, #4f46e5);
}

.btn-card-danger {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

.btn-card-success {
    background: linear-gradient(135deg, #10b981, #059669);
}

.btn-card-warning {
    background: linear-gradient(135deg, #f59e0b, #d97706);
}

.btn-card-info {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.admin-card-btn:hover {
    transform: scale(1.05);
    box-shadow: var(--shadow-lg);
}

/* Home Page Styles */
.home-container {
    background: var(--light-bg);
    min-height: 100vh;
}

.home-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
}

.header-content {
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.header-logo {
    max-width: 300px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
}

.header-info {
    color: white;
    text-align: right;
}

.header-info a {
    color: white;
    text-decoration: none;
    transition: all var(--transition-base);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-sm);
}

.header-info a:hover {
    transform: translateX(-5px);
}

.header-info h4 {
    font-weight: 700;
    margin-bottom: var(--spacing-sm);
}

.action-bar {
    background: white;
    padding: var(--spacing-lg);
    box-shadow: var(--shadow-md);
}

.action-buttons {
    display: flex;
    gap: var(--spacing-md);
    flex-wrap: wrap;
    justify-content: center;
}

.btn-action {
    padding: var(--spacing-md) var(--spacing-lg);
    border-radius: var(--radius-lg);
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all var(--transition-base);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: white;
}

.btn-action:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.badge {
    background: rgba(255, 255, 255, 0.3);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 700;
}

/* Modern Table Styles */
.table-container {
    background: white;
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    padding-top: 0px;
    box-shadow: var(--shadow-lg);
    max-width: 1400px;
}

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

.table thead th {
    background: linear-gradient(135deg, #0f172a, #1e293b) !important;
    color: #ffffff !important;
    padding: var(--spacing-md);
    font-weight: 700;
    text-align: center !important;
    position: sticky;
    top: 0;
    z-index: 10;
    border: none !important;
}

.table thead th:first-child {
    border-top-left-radius: var(--radius-lg);
}

.table thead th:last-child {
    border-top-right-radius: var(--radius-lg);
}

.table tbody tr {
    transition: all var(--transition-fast);
}

.table tbody tr:hover {
    background: rgba(99, 102, 241, 0.05);
    transform: scale(1.01);
}

.table tbody td {
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--light-border);
}

/* DataTables Custom Styling */
.dataTables_wrapper {
    padding: var(--spacing-lg);
    padding-top: 0px;
}

/* Hide length menu (entries per page selector) */
.dataTables_wrapper .dataTables_length {
    display: none !important;
}

.dataTables_wrapper .dataTables_filter {
    text-align: center !important;
    float: none !important;
    margin-bottom: var(--spacing-lg);
}

.dataTables_filter label {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: var(--spacing-md);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--light-text);
}

.dataTables_filter input {
    border: 2px solid var(--primary-color) !important;
    border-radius: var(--radius-lg);
    padding: 0.875rem 1.5rem !important;
    margin-left: var(--spacing-sm);
    transition: all var(--transition-base);
    font-size: 1rem !important;
    width: 400px !important;
    max-width: 90vw;
    box-shadow: var(--shadow-md);
}

.dataTables_filter input:focus {
    outline: none;
    border-color: var(--primary-dark) !important;
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.2), var(--shadow-lg);
    transform: translateY(-2px);
}

/* Table Input Fields */
.table input[type="text"],
.table input[type="number"],
.table input[type="hidden"]+input {
    border: 2px solid #cbd5e1 !important;
    border-radius: var(--radius-md);
    padding: 0.5rem;
    min-width: 55px;
    background: white;
    transition: all var(--transition-base);
}

.table input[type="text"]:focus,
.table input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

/* General Input Styling */
input[type="text"],
input[type="number"],
input[type="email"],
input[type="password"],
select,
textarea {
    border: 2px solid #cbd5e1;
    border-radius: var(--radius-md);
    padding: 0.5rem;
    min-width: 55px;
    font-family: inherit;
    transition: all var(--transition-base);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}


/* Responsive Design */
@media (max-width: 768px) {
    .login-card {
        padding: var(--spacing-lg);
    }

    .login-title {
        font-size: 1.5rem;
    }

    .admin-title {
        font-size: 1.75rem;
    }

    .admin-grid {
        grid-template-columns: 1fr;
    }

    .header-content {
        flex-direction: column;
        text-align: center;
    }

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

    .action-buttons {
        flex-direction: column;
    }

    .btn-action {
        width: 100%;
        justify-content: center;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

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

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

.mt-1 {
    margin-top: var(--spacing-sm);
}

.mt-2 {
    margin-top: var(--spacing-md);
}

.mt-3 {
    margin-top: var(--spacing-lg);
}

.mb-1 {
    margin-bottom: var(--spacing-sm);
}

.mb-2 {
    margin-bottom: var(--spacing-md);
}

.mb-3 {
    margin-bottom: var(--spacing-lg);
}

.p-1 {
    padding: var(--spacing-sm);
}

.p-2 {
    padding: var(--spacing-md);
}

.p-3 {
    padding: var(--spacing-lg);
}

/* Product Modal Styles */
.product-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.3s ease-out;
}

.product-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.product-modal-content {
    position: relative;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-2xl);
    box-shadow: var(--shadow-2xl);
    max-width: 90%;
    max-height: 90vh;
    overflow: auto;
    z-index: 10000;
    animation: slideUp 0.4s ease-out;
}

.product-modal-close {
    position: absolute;
    top: 1rem;
    right: 1rem;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--danger-color), #dc2626);
    color: white;
    font-size: 1.5rem;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    z-index: 10001;
}

.product-modal-close:hover {
    transform: rotate(90deg) scale(1.1);
    box-shadow: var(--shadow-lg);
}

.product-modal-body {
    padding: var(--spacing-2xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--spacing-lg);
}

.product-modal-image {
    max-width: 100%;
    max-height: 60vh;
    width: auto;
    height: auto;
    object-fit: contain;
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-xl);
    transition: transform var(--transition-base);
}

.product-modal-image:hover {
    transform: scale(1.02);
}

.product-modal-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--light-text);
    text-align: center;
    margin: var(--spacing-md) 0;
}

.product-modal-search-btn {
    padding: var(--spacing-md) var(--spacing-xl);
    background: linear-gradient(135deg, var(--primary-color), var(--primary-dark));
    color: white;
    border: none;
    border-radius: var(--radius-lg);
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-base);
    box-shadow: var(--shadow-md);
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.product-modal-search-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-xl);
    background: linear-gradient(135deg, var(--primary-dark), #3730a3);
}

.product-modal-search-btn:active {
    transform: translateY(-1px);
}

.product-modal-search-btn i {
    font-size: 1.2rem;
}

/* Responsive Modal */
@media (max-width: 768px) {
    .product-modal-content {
        max-width: 95%;
        max-height: 95vh;
    }

    .product-modal-body {
        padding: var(--spacing-lg);
    }

    .product-modal-image {
        max-height: 50vh;
    }

    .product-modal-title {
        font-size: 1.25rem;
    }

    .product-modal-close {
        width: 35px;
        height: 35px;
        font-size: 1.25rem;
    }
}