/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
}

.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header styles */
header {
    text-align: center;
    margin-bottom: 30px;
    position: relative;
}

.back-btn {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    color: #2c3e50;
    text-decoration: none;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.back-btn:hover {
    background: white;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

.logo {
    margin-bottom: 15px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

h1 {
    color: white;
    font-size: 2.5rem;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
}

.subtitle {
    color: rgba(255, 255, 255, 0.9);
    font-size: 1.1rem;
    margin-bottom: 20px;
}

/* QR Grid for index page */
.qr-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
    flex: 1;
}

.qr-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.qr-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 35px rgba(0, 0, 0, 0.2);
}

.qr-code {
    width: 150px;
    height: 150px;
    margin: 0 auto 20px;
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #6c757d;
    position: relative;
}

.qr-code::before {
    content: "QR Code";
    position: absolute;
}

.qr-card h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 8px;
}

.qr-card p {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 1rem;
}

.view-button {
    display: inline-block;
    background: #3498db;
    color: white;
    text-decoration: none;
    padding: 12px 25px;
    border-radius: 25px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.view-button:hover {
    background: #2980b9;
    transform: translateY(-2px);
}

/* Product detail pages */
.product-details {
    flex: 1;
    margin-bottom: 40px;
}

.product-header {
    background: white;
    border-radius: 15px;
    padding: 30px;
    text-align: center;
    margin-bottom: 25px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin-bottom: 5px;
    text-shadow: none;
}

.product-header h2 {
    color: #7f8c8d;
    font-size: 1.3rem;
    margin-bottom: 25px;
    font-weight: 400;
}

.product-image {
    max-width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.specifications, .features, .links-section {
    background: white;
    border-radius: 15px;
    padding: 25px;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.specifications h3, .features h3, .links-section h3 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin-bottom: 20px;
    border-bottom: 2px solid #ecf0f1;
    padding-bottom: 10px;
}

.specifications ul, .features ul {
    list-style: none;
}

.specifications li, .features li {
    padding: 8px 0;
    border-bottom: 1px solid #ecf0f1;
}

.specifications li:last-child, .features li:last-child {
    border-bottom: none;
}

/* Resource links */
.resource-links {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.resource-btn {
    display: block;
    text-decoration: none;
    padding: 15px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    text-align: center;
    transition: all 0.3s ease;
}

.resource-btn.manufacturer {
    background: #3498db;
    color: white;
}

.resource-btn.manufacturer:hover {
    background: #2980b9;
}

.resource-btn.manual {
    background: #e74c3c;
    color: white;
}

.resource-btn.manual:hover {
    background: #c0392b;
}

.resource-btn.inspection {
    background: #2ecc71;
    color: white;
}

.resource-btn.inspection:hover {
    background: #27ae60;
}

/* Footer */
.main-footer {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    margin-top: auto;
    box-shadow: 0 -4px 15px rgba(0, 0, 0, 0.1);
}

.patent-btn {
    background: #9b59b6;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 20px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 10px;
    transition: all 0.3s ease;
}

.patent-btn:hover {
    background: #8e44ad;
    transform: translateY(-2px);
}

/* Modal styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: white;
    margin: 10% auto;
    padding: 30px;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    position: relative;
    animation: modalSlideIn 0.3s ease;
}

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

.close {
    position: absolute;
    right: 20px;
    top: 15px;
    color: #aaa;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #333;
}

.modal-content h3 {
    color: #2c3e50;
    margin-bottom: 20px;
    font-size: 1.5rem;
}

.patent-list p {
    margin-bottom: 15px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

/* Mobile optimizations */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }

    h1 {
        font-size: 2rem;
    }

    .qr-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }

    .qr-card {
        padding: 20px;
    }

    .product-header {
        padding: 20px;
    }

    .product-header h1 {
        font-size: 2rem;
    }

    .specifications, .features, .links-section {
        padding: 20px;
    }

    .back-btn {
        position: static;
        display: inline-block;
        margin-bottom: 15px;
        transform: none;
    }

    .modal-content {
        margin: 20% auto;
        padding: 20px;
        width: 95%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 10px;
    }

    h1 {
        font-size: 1.8rem;
    }

    .qr-code {
        width: 120px;
        height: 120px;
    }

    .product-header h1 {
        font-size: 1.8rem;
    }

    .resource-links {
        gap: 10px;
    }

    .resource-btn {
        padding: 12px 15px;
        font-size: 0.9rem;
    }
}

/* Print styles */
@media print {
    body {
        background: white;
        color: black;
    }

    .modal {
        display: none !important;
    }

    .patent-btn {
        display: none;
    }
}
