/* Test Listing Styles */
.tms-tests-listing {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 30px;
    margin: 30px 0;
}

.tms-test-card {
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 25px;
    background: #fff;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tms-test-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.tms-test-card h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.4em;
    font-weight: 600;
}

.tms-test-thumbnail {
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.tms-test-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

.tms-test-content {
    color: #555;
    line-height: 1.6;
    margin-bottom: 20px;
}

.tms-test-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0;
    padding: 15px 0;
    border-top: 1px solid #f0f0f0;
    border-bottom: 1px solid #f0f0f0;
}

.tms-test-price {
    font-weight: 700;
    color: #27ae60;
    font-size: 1.2em;
}

.tms-test-price.free {
    color: #7f8c8d;
}

.tms-test-duration {
    color: #7f8c8d;
    font-size: 0.95em;
}

.tms-test-actions {
    text-align: center;
}

.tms-select-test-btn {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
}

.tms-select-test-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
    color: white;
}

.tms-select-test-btn:disabled,
.tms-select-test-btn.disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* No Tests Message */
.tms-no-tests {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

.tms-no-tests p {
    font-size: 1.2em;
    color: #6c757d;
    margin: 0;
}

/* Payment Success Page */
.tms-test-redirect-page {
    max-width: 700px;
    margin: 0 auto;
    padding: 30px 20px;
}

.tms-payment-success {
    text-align: center;
    background: linear-gradient(135deg, #d4edda 0%, #c3e6cb 100%);
    color: #155724;
    padding: 40px 30px;
    border-radius: 12px;
    margin-bottom: 40px;
    border: 1px solid #c3e6cb;
}

.tms-success-icon {
    font-size: 80px;
    color: #28a745;
    margin-bottom: 20px;
    line-height: 1;
}

.tms-payment-success h2 {
    margin: 0 0 15px 0;
    font-size: 2em;
    font-weight: 700;
}

.tms-payment-success p {
    font-size: 1.2em;
    margin: 0;
    opacity: 0.9;
}

.tms-test-details {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
    border-left: 4px solid #667eea;
}

.tms-test-details h3 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1.5em;
}

.tms-test-details p {
    margin: 8px 0;
    font-size: 1.1em;
}

.tms-test-instructions {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    padding: 25px;
    border-radius: 8px;
    margin-bottom: 30px;
}

.tms-test-instructions h4 {
    margin: 0 0 15px 0;
    color: #856404;
    font-size: 1.3em;
}

.tms-test-instructions ul {
    margin: 0;
    padding-left: 20px;
}

.tms-test-instructions li {
    margin-bottom: 8px;
    color: #856404;
    font-size: 1.05em;
}

.tms-test-actions {
    text-align: center;
    margin-bottom: 30px;
}

.tms-start-test-btn {
    display: inline-block;
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    color: white;
    padding: 16px 40px;
    text-decoration: none;
    border-radius: 8px;
    font-size: 18px;
    font-weight: 700;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(231, 76, 60, 0.3);
}

.tms-start-test-btn:hover {
    background: linear-gradient(135deg, #c0392b 0%, #e74c3c 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(231, 76, 60, 0.4);
    color: white;
}

.tms-test-note {
    text-align: center;
    color: #6c757d;
    font-size: 0.95em;
    margin-top: 15px;
    font-style: italic;
}

.tms-support-info {
    margin-top: 40px;
    padding-top: 25px;
    border-top: 1px solid #dee2e6;
    text-align: center;
}

.tms-support-info p {
    margin: 0;
    color: #6c757d;
    font-size: 1.05em;
}

.tms-support-info a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.tms-support-info a:hover {
    text-decoration: underline;
}

/* Error Messages */
.tms-error {
    background: #f8d7da;
    color: #721c24;
    padding: 20px;
    border-radius: 8px;
    text-align: center;
    margin: 20px 0;
    border: 1px solid #f5c6cb;
}

.tms-error h3 {
    margin: 0 0 10px 0;
    color: #721c24;
}

/* WooCommerce Test Details */
.woocommerce-test-details {
    background: #f8f9fa;
    padding: 25px;
    margin: 30px 0;
    border-radius: 8px;
    border-left: 4px solid #28a745;
}

.woocommerce-test-details h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.4em;
}

.test-details-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.test-access-button {
    background: #28a745;
    color: white;
    padding: 12px 24px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
}

.test-access-button:hover {
    background: #218838;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Email Styles */
.test-details-email {
    background: #f8f9fa;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    border-left: 4px solid #667eea;
}

.test-details-email h3 {
    color: #2c3e50;
    margin-bottom: 15px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .tms-tests-listing {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .tms-test-card {
        padding: 20px;
    }
    
    .tms-test-meta {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
    
    .test-details-content {
        flex-direction: column;
        text-align: center;
    }
    
    .tms-payment-success {
        padding: 30px 20px;
    }
    
    .tms-success-icon {
        font-size: 60px;
    }
    
    .tms-payment-success h2 {
        font-size: 1.6em;
    }
}

/* Loading States */
.tms-loading {
    opacity: 0.7;
    pointer-events: none;
}

.tms-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Cart and Checkout Styles */
.cart .tms-test-info,
.checkout .tms-test-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin: 10px 0;
    border-left: 4px solid #667eea;
}

.cart .tms-test-info strong,
.checkout .tms-test-info strong {
    color: #2c3e50;
}