/* Innovation Products - Main Styles */

/* IRANYekanX Font for Persian Text */
@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/IRANYekanX/IRANYekanX.woff2') format('woff2'),
         url('../fonts/IRANYekanX/IRANYekanX.woff') format('woff'),
         url('../fonts/IRANYekanX/IRANYekanX.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB1D-FB4F;
}

/* Preload font for better performance */
@font-face {
    font-family: 'IRANYekanX';
    src: url('../fonts/IRANYekanX/IRANYekanX.woff2') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0600-06FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB1D-FB4F;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --success-color: #28a745;
    --info-color: #17a2b8;
    --warning-color: #ffc107;
    --danger-color: #dc3545;
    --light-color: #f8f9fa;
    --dark-color: #343a40;
    --border-radius: 8px;
    --box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

/* Global Styles */
body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
}

/* Gradient Backgrounds */
.bg-gradient-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.bg-gradient-secondary {
    background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
}

/* Navigation */
.navbar-brand {
    font-weight: 700;
    font-size: 1.5rem;
}

.navbar-nav .nav-link {
    font-weight: 500;
    transition: var(--transition);
    border-radius: var(--border-radius);
    margin: 0 2px;
}

.navbar-nav .nav-link:hover {
    background-color: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

/* Hero Section */
.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="50" cy="50" r="1" fill="rgba(255,255,255,0.1)"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

.hero-section .container {
    position: relative;
    z-index: 2;
}

/* Search Form */
.search-form {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: var(--box-shadow);
    margin-top: 0; /* prevent overlapping hero heading */
    position: relative;
    z-index: 3;
}

.search-form .form-control,
.search-form .form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
}

.search-form .form-control:focus,
.search-form .form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

/* Product Cards */
.product-card {
    border: none;
    border-radius: 15px;
    transition: box-shadow 0.3s ease, transform 0.2s ease; /* avoid 3D flip-like effect */
    overflow: hidden;
    position: relative;
    backface-visibility: hidden; /* prevent visual flip on first paint */
    transform: translateZ(0); /* create own layer without perspective */
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.product-card .card-body {
    padding: 1.5rem;
}

.product-card .card-footer {
    border-top: none;
    background: transparent;
    padding: 1rem 1.5rem;
}

/* Featured Badge */
.featured-badge {
    position: absolute;
    top: 0.5rem; /* reduce to avoid overlapping titles */
    right: 1rem;
    background: linear-gradient(45deg, #ffc107, #ff8c00);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 10px rgba(255, 193, 7, 0.3);
}

/* Ensure content clears the featured badge when present */
.product-card .featured-badge ~ .card-body {
    padding-top: 3rem; /* extra space to avoid overlap with badge */
}

/* Product Meta */
.product-meta .badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
}

/* Info Items */
.info-item {
    padding: 1rem;
    background: #f8f9fa;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.info-item label {
    color: var(--dark-color);
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    display: block;
}

.info-item p {
    margin-bottom: 0;
    font-size: 1.1rem;
}

/* Buttons */
.btn {
    border-radius: var(--border-radius);
    font-weight: 500;
    transition: var(--transition);
    border: none;
    padding: 0.75rem 1.5rem;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-primary {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
}

.btn-primary:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
}

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

/* Cards */
.card {
    border: none;
    border-radius: 15px;
    box-shadow: var(--box-shadow);
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.card-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-bottom: 1px solid #dee2e6;
    border-radius: 15px 15px 0 0 !important;
    font-weight: 600;
}

/* Tables */
.table {
    border-radius: var(--border-radius);
    overflow: hidden;
}

.table thead th {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

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

.table tbody tr:hover {
    background-color: rgba(102, 126, 234, 0.05);
    transform: scale(1.01);
}

/* Pagination */
.pagination .page-link {
    border: none;
    color: var(--primary-color);
    border-radius: var(--border-radius);
    margin: 0 2px;
    transition: var(--transition);
}

.pagination .page-link:hover {
    background-color: var(--primary-color);
    color: white;
    transform: translateY(-2px);
}

.pagination .page-item.active .page-link {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border: none;
}

/* Alerts */
.alert {
    border: none;
    border-radius: var(--border-radius);
    border-left: 4px solid;
}

.alert-success {
    border-left-color: var(--success-color);
    background: linear-gradient(135deg, rgba(40, 167, 69, 0.1) 0%, rgba(40, 167, 69, 0.05) 100%);
}

.alert-danger {
    border-left-color: var(--danger-color);
    background: linear-gradient(135deg, rgba(220, 53, 69, 0.1) 0%, rgba(220, 53, 69, 0.05) 100%);
}

.alert-info {
    border-left-color: var(--info-color);
    background: linear-gradient(135deg, rgba(23, 162, 184, 0.1) 0%, rgba(23, 162, 184, 0.05) 100%);
}

/* Forms */
.form-control,
.form-select {
    border-radius: var(--border-radius);
    border: 2px solid #e9ecef;
    transition: var(--transition);
    padding: 0.75rem 1rem;
}

.form-control:focus,
.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.25);
}

.form-label {
    font-weight: 600;
    color: var(--dark-color);
    margin-bottom: 0.5rem;
}

/* Badges */
.badge {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-weight: 500;
}

/* Footer */
footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, #495057 100%);
    color: white;
}

footer h5 {
    color: white;
    font-weight: 600;
}

footer a {
    color: rgba(255, 255, 255, 0.8);
    transition: var(--transition);
}

footer a:hover {
    color: white;
    text-decoration: none;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in-up {
    animation: fadeInUp 0.6s ease-out;
}

/* Responsive Design */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0;
    }
    
    .search-form {
        margin-top: 0; /* prevent overlapping hero heading */
        padding: 1.5rem;
    }
    
    .product-card {
        margin-bottom: 2rem;
    }
    
    .btn-lg {
        padding: 0.75rem 1.5rem;
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 2rem;
    }
    
    .search-form {
        padding: 1rem;
    }
    
    .product-meta .badge {
        font-size: 0.7rem;
        padding: 0.3rem 0.6rem;
    }
}

/* Utility Classes */
.text-gradient {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.shadow-soft {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
}

.border-gradient {
    border: 2px solid;
    border-image: linear-gradient(45deg, var(--primary-color), var(--secondary-color)) 1;
}

/* Footer Styles */
footer {
    background: linear-gradient(135deg, var(--dark-color), #2c3e50);
    color: white;
    padding: 2rem 0 1rem;
    margin-top: 3rem;
}

footer .container {
    text-align: center;
}

footer .footer-content {
    margin-bottom: 1rem;
}

footer .footer-links {
    margin-bottom: 1rem;
}

footer .footer-links a {
    color: #bdc3c7;
    text-decoration: none;
    margin: 0 1rem;
    transition: color 0.3s ease;
}

footer .footer-links a:hover {
    color: white;
}

footer .footer-attribution {
    border-top: 1px solid #34495e;
    padding-top: 1rem;
    color: #95a5a6;
    font-size: 0.9rem;
}

footer .footer-attribution a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 500;
}

footer .footer-attribution a:hover {
    color: var(--secondary-color);
    text-decoration: underline;
}

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

::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: linear-gradient(45deg, var(--primary-color), var(--secondary-color));
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(45deg, var(--secondary-color), var(--primary-color));
}

/* Print Styles */
@media print {
    .navbar,
    .search-form,
    .btn,
    footer {
        display: none !important;
    }
    
    .product-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
}
