/* Modal Base Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--background-primary);
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.modal-header {
    background: var(--primary-color);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    margin: 0;
    font-weight: 600;
    font-size: 1.3rem;
}

.close {
    font-size: 20px;
    cursor: pointer;
    background: none;
    border: none;
    color: white;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.close:hover {
    background: rgba(255, 255, 255, 0.1);
}

.modal-body {
    padding: 32px;
    overflow-y: auto;
    max-height: 60vh;
    color: var(--text-primary);
    line-height: 1.6;
}

.modal-body h3,
.modal-body h4 {
    color: var(--text-primary);
    margin-top: 24px;
    margin-bottom: 16px;
    font-weight: 600;
}

.modal-body ul {
    margin-left: 20px;
    margin-bottom: 16px;
}

.modal-body li {
    margin-bottom: 8px;
    color: var(--text-secondary);
}

/* Suppliers Modal Styles */
.suppliers-modal-content {
    max-width: 900px;
    width: 95%;
}

.suppliers-modal-header {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.suppliers-modal-body {
    padding: 0;
    max-height: 70vh;
    overflow-y: auto;
}

.suppliers-section {
    display: none;
    padding: 40px 32px;
}

.suppliers-section.active {
    display: block;
}

.suppliers-intro {
    text-align: center;
    margin-bottom: 40px;
}

.suppliers-icon {
    font-size: 3rem;
    margin-bottom: 16px;
}

.suppliers-intro h3 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--text-primary);
}

.suppliers-intro p {
    color: var(--text-secondary);
    max-width: 500px;
    margin: 0 auto;
    line-height: 1.6;
}

.serial-form {
    display: flex;
    gap: 16px;
    max-width: 400px;
    margin: 0 auto 24px;
}

.serial-input {
    flex: 1;
    padding: 16px 20px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    transition: all 0.3s ease;
}

.serial-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.help-text {
    text-align: center;
}

.help-text p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.help-text a {
    color: var(--accent-color);
    text-decoration: none;
}

.serial-error-message {
    display: none;
    max-width: 500px;
    margin: 24px auto;
    padding: 24px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 12px;
    text-align: center;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: slideInUp 0.3s ease-out;
}

.serial-error-message.show {
    display: block;
}

.error-icon {
    font-size: 2rem;
    margin-bottom: 12px;
}

.serial-error-message h4 {
    color: #dc2626;
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 12px;
}

.serial-error-message p {
    color: #7f1d1d;
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 8px;
}

.serial-error-message p:last-child {
    margin-bottom: 0;
}

.serial-error-message a {
    color: #dc2626;
    text-decoration: underline;
    font-weight: 500;
}

.serial-error-message a:hover {
    color: #b91c1c;
}

.suppliers-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-color);
}

.suppliers-header h3 {
    font-size: 1.3rem;
    font-weight: 600;
    color: var(--text-primary);
}

.suppliers-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 24px;
}

/* Testimonials Modal Styles */
.testimonials-modal-content {
    max-width: 800px;
    width: 95%;
    max-height: 85vh;
}

.testimonials-modal-header {
    background: linear-gradient(135deg, #000000 0%, #333333 100%);
    color: white;
    padding: 24px 32px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.testimonials-modal-body {
    padding: 32px;
    max-height: 70vh;
    overflow-y: auto;
}

.testimonials-stats {
    text-align: center;
    margin-bottom: 40px;
    padding: 24px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 16px;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
}

.overall-rating {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
}

.rating-number {
    font-size: 2.5rem;
    font-weight: 600;
    color: var(--text-primary);
}

.stars {
    font-size: 1.5rem;
    color: #fbbf24;
    letter-spacing: 2px;
}

.reviews-count {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.testimonials-list {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Responsive adjustments for testimonials modal */
@media (max-width: 768px) {
    .testimonials-modal-content {
        margin: 2% auto;
        width: 98%;
        max-height: 90vh;
    }

    .testimonials-modal-body {
        padding: 20px;
        max-height: 75vh;
    }

    .testimonials-stats {
        margin-bottom: 24px;
        padding: 20px;
    }

    .rating-number {
        font-size: 2rem;
    }

    .testimonial-item {
        padding: 20px;
    }

    .testimonial-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .user-info {
        gap: 10px;
    }

    .user-avatar {
        width: 36px;
        height: 36px;
        font-size: 13px;
    }

    .testimonial-text {
        font-size: 0.9rem;
    }
}

/* Responsive adjustments for suppliers modal */
@media (max-width: 768px) {
    .suppliers-modal-content {
        margin: 5% auto;
        width: 98%;
    }

    .suppliers-section {
        padding: 24px 20px;
    }

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

    .suppliers-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }

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

    .supplier-actions {
        flex-direction: column;
    }
}