/**
 * Custom Styles
 * Eklins Electrical Engineering
 */

/* Custom Colors */
:root {
    --color-navy: #001532;
    --color-cyan: #5CE1E6;
    --color-amber: #FFB06;
    --color-green: #00CE53;
    --color-gray: #ECEFF1;
}

/* Global Styles */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

/* Utility Classes */
.line-clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.line-clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Animations */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.animate-slide-in {
    animation: slideIn 0.3s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    opacity: 0;
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Card Hover Effects */
.card-hover {
    transition: all 0.3s ease;
}

.card-hover:hover {
    transform: translateY(-5px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

/* Button Styles */
.btn-primary {
    background-color: var(--color-cyan);
    color: var(--color-navy);
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: var(--color-navy);
    color: white;
    padding: 12px 32px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

/* Tooltip */
.tooltip {
    position: absolute;
    background-color: var(--color-navy);
    color: white;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 14px;
    z-index: 9999;
    pointer-events: none;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

.tooltip::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-top-color: var(--color-navy);
}

/* Loading Spinner */
.spinner {
    border: 3px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--color-cyan);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Image Lazy Loading */
img.lazy {
    opacity: 0;
    transition: opacity 0.3s;
}

img.lazy.loaded {
    opacity: 1;
}

/* Product Card */
.product-card {
    position: relative;
    overflow: hidden;
}

.product-card::before {
    content: '';
    position: absolute;
    top: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(92, 225, 230, 0.1), transparent);
    transition: top 0.3s ease;
    z-index: 1;
}

.product-card:hover::before {
    top: 0;
}

/* Badge */
.badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.badge-primary {
    background-color: var(--color-cyan);
    color: var(--color-navy);
}

.badge-success {
    background-color: var(--color-green);
    color: white;
}

.badge-warning {
    background-color: var(--color-amber);
    color: var(--color-navy);
}

/* Form Styles */
.form-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #E5E7EB;
    border-radius: 8px;
    transition: border-color 0.2s;
}

.form-input:focus {
    outline: none;
    border-color: var(--color-cyan);
    box-shadow: 0 0 0 3px rgba(92, 225, 230, 0.1);
}

.form-input.error {
    border-color: #EF4444;
}

/* Table Styles */
.table {
    width: 100%;
    border-collapse: collapse;
}

.table th {
    background-color: var(--color-navy);
    color: white;
    padding: 12px;
    text-align: left;
    font-weight: 600;
}

.table td {
    padding: 12px;
    border-bottom: 1px solid #E5E7EB;
}

.table tr:hover {
    background-color: #F9FAFB;
}

/* Pagination */
.pagination {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-top: 32px;
}

.pagination a,
.pagination span {
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    transition: all 0.2s;
}

.pagination a {
    background-color: #F3F4F6;
    color: #374151;
}

.pagination a:hover {
    background-color: var(--color-cyan);
    color: var(--color-navy);
}

.pagination .active {
    background-color: var(--color-cyan);
    color: var(--color-navy);
}

/* Modal */
.modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    animation: fadeIn 0.2s forwards;
}

.modal-content {
    background-color: white;
    border-radius: 12px;
    padding: 24px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    transform: scale(0.9);
    animation: modalIn 0.3s forwards;
}

@keyframes modalIn {
    to {
        transform: scale(1);
    }
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.breadcrumb a {
    color: var(--color-cyan);
    transition: opacity 0.2s;
}

.breadcrumb a:hover {
    opacity: 0.8;
}

/* Alert */
.alert {
    padding: 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-success {
    background-color: #D1FAE5;
    border: 1px solid var(--color-green);
    color: #065F46;
}

.alert-error {
    background-color: #FEE2E2;
    border: 1px solid #EF4444;
    color: #991B1B;
}

.alert-info {
    background-color: #DBEAFE;
    border: 1px solid #3B82F6;
    color: #1E40AF;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .mobile-menu {
        display: block;
    }
    
    .desktop-menu {
        display: none;
    }
}

@media (min-width: 769px) {
    .mobile-menu {
        display: none;
    }
    
    .desktop-menu {
        display: flex;
    }
}

/* Print Styles */
@media print {
    .no-print {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
    }
}

/* Scrollbar Customization */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #F3F4F6;
}

::-webkit-scrollbar-thumb {
    background: var(--color-cyan);
    border-radius: 5px;
}

::-webkit-scrollbar-thumb:hover {
    background: #4AC7CC;
}

/* Selection Highlight */
::selection {
    background-color: var(--color-cyan);
    color: var(--color-navy);
}

::-moz-selection {
    background-color: var(--color-cyan);
    color: var(--color-navy);
}

/* Focus Visible for Accessibility */
*:focus-visible {
    outline: 2px solid var(--color-cyan);
    outline-offset: 2px;
}