/**
 * Neogen Product Registration - Frontend Styles
 */

.neogen-my-products {
    max-width: 1000px;
}

.neogen-my-products h2 {
    margin-bottom: 10px;
    font-size: 1.5rem;
    color: #1a1a2e;
}

.neogen-my-products .description {
    color: #666;
    margin-bottom: 30px;
}

.neogen-my-products h3 {
    font-size: 1.2rem;
    margin: 30px 0 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #e5e7eb;
}

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

/* Product Card */
.product-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    gap: 15px;
    transition: box-shadow 0.2s, transform 0.2s;
}

.product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
}

.product-card.registered {
    border-color: #10b981;
    background: linear-gradient(135deg, #f0fdf4 0%, #fff 100%);
}

.product-card .product-image img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 8px;
}

.product-card .product-info {
    flex: 1;
}

.product-card .product-info h4 {
    margin: 0 0 10px;
    font-size: 1rem;
}

/* Serial Badge */
.serial-badge {
    background: #f3f4f6;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.85rem;
    margin-bottom: 8px;
    display: inline-block;
}

.serial-badge .label {
    color: #6b7280;
}

.serial-badge .value {
    font-family: monospace;
    font-weight: bold;
    color: #1f1efb;
}

/* Warranty Info */
.warranty-info {
    font-size: 0.9rem;
    margin-bottom: 12px;
}

.warranty-info .label {
    color: #6b7280;
}

.warranty-info.active .status {
    color: #10b981;
    font-weight: 500;
}

.warranty-info.expired .status {
    color: #ef4444;
}

/* Orders Accordion */
.orders-accordion .order-item {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    margin-bottom: 10px;
    overflow: hidden;
}

.order-header {
    background: #f9fafb;
    padding: 15px 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    cursor: pointer;
    transition: background 0.2s;
}

.order-header:hover {
    background: #f3f4f6;
}

.order-number {
    font-weight: 600;
}

.order-date {
    color: #6b7280;
    font-size: 0.9rem;
}

.order-status {
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.8rem;
    background: #e5e7eb;
}

.order-status.completed {
    background: #d1fae5;
    color: #065f46;
}

.order-status.processing {
    background: #dbeafe;
    color: #1e40af;
}

.toggle-icon {
    margin-right: auto;
    transition: transform 0.2s;
}

.order-header.open .toggle-icon {
    transform: rotate(180deg);
}

/* Order Products */
.order-products {
    padding: 20px;
    background: #fff;
}

.product-row {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f3f4f6;
}

.product-row:last-child {
    border-bottom: none;
}

.product-thumb img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
}

.product-details {
    flex: 1;
}

.product-details h4 {
    margin: 0 0 5px;
    font-size: 0.95rem;
}

.product-details .qty {
    color: #6b7280;
    font-size: 0.85rem;
}

.registered-count {
    color: #10b981;
    font-size: 0.85rem;
    display: block;
}

/* Registration Form */
.product-registration {
    text-align: left;
}

.registration-form {
    display: flex;
    gap: 8px;
}

.serial-input {
    padding: 8px 12px;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    width: 180px;
    font-size: 0.9rem;
}

.serial-input:focus {
    border-color: #1f1efb;
    outline: none;
    box-shadow: 0 0 0 2px rgba(31, 30, 251, 0.1);
}

/* Buttons */
.register-serial-btn {
    background: #1f1efb !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 16px !important;
    border-radius: 6px !important;
    cursor: pointer;
    transition: background 0.2s;
}

.register-serial-btn:hover {
    background: #0d2175 !important;
}

.register-serial-btn:disabled {
    background: #9ca3af !important;
    cursor: not-allowed;
}

.download-manual-btn {
    background: #10b981 !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 14px !important;
    border-radius: 6px !important;
    margin-top: 10px;
    cursor: pointer;
    transition: background 0.2s;
}

.download-manual-btn:hover {
    background: #059669 !important;
}

.all-registered {
    color: #10b981;
    font-weight: 500;
}

.no-manual {
    color: #9ca3af;
    font-size: 0.85rem;
}

/* Messages */
.registration-message {
    margin-top: 8px;
    font-size: 0.85rem;
}

.registration-message.success {
    color: #10b981;
}

.registration-message.error {
    color: #ef4444;
}

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

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #1f1efb;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .product-row {
        flex-wrap: wrap;
    }

    .product-registration {
        width: 100%;
        margin-top: 10px;
    }

    .registration-form {
        flex-direction: column;
    }

    .serial-input {
        width: 100%;
    }

    .order-header {
        flex-wrap: wrap;
        gap: 8px;
    }
}
