/**
 * Public styles for Simple Licensing System
 */

/* License Verification Form */
.sls-license-verification-form {
    max-width: 500px;
    margin: 20px 0;
    padding: 20px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
}

.sls-license-verification-form h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
}

.sls-form-group {
    margin-bottom: 15px;
}

.sls-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: bold;
    color: #333;
}

.sls-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
    box-sizing: border-box;
    transition: border-color 0.3s ease;
}

.sls-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.3);
}

.sls-form-help {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    color: #666;
    font-style: italic;
}

.sls-button {
    display: inline-block;
    padding: 10px 20px;
    background: #0073aa;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.sls-button:hover {
    background: #005a87;
    color: #fff;
}

.sls-button:focus {
    outline: none;
    box-shadow: 0 0 5px rgba(0, 115, 170, 0.5);
}

.sls-button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.sls-button-primary {
    background: #0073aa;
}

.sls-button-secondary {
    background: #666;
}

.sls-button-success {
    background: #46b450;
}

.sls-button-danger {
    background: #dc3232;
}

.sls-button-warning {
    background: #ffb900;
}

/* License Status Display */
.sls-license-status {
    max-width: 600px;
    margin: 20px 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    overflow: hidden;
}

.sls-status-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    background: #f9f9f9;
    border-bottom: 1px solid #ddd;
}

.sls-status-header h3 {
    margin: 0;
    color: #333;
    font-size: 1.1em;
}

.sls-status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: bold;
    font-size: 14px;
}

.sls-status-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.sls-status-active .sls-status-dot {
    background: #46b450;
}

.sls-status-inactive .sls-status-dot {
    background: #dc3232;
}

.sls-status-suspended .sls-status-dot {
    background: #ffb900;
}

.sls-status-expired .sls-status-dot {
    background: #666;
}

.sls-status-active .sls-status-text {
    color: #46b450;
}

.sls-status-inactive .sls-status-text {
    color: #dc3232;
}

.sls-status-suspended .sls-status-text {
    color: #ffb900;
}

.sls-status-expired .sls-status-text {
    color: #666;
}

.sls-status-details {
    padding: 20px;
}

.sls-status-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.sls-status-item:last-child {
    border-bottom: none;
}

.sls-status-item label {
    font-weight: bold;
    color: #333;
    flex: 0 0 120px;
}

.sls-status-item span {
    flex: 1;
    text-align: right;
    color: #666;
}

.sls-status-item code {
    background: #f1f1f1;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: monospace;
    font-size: 12px;
}

.sls-last-updated {
    padding: 10px 20px;
    background: #f9f9f9;
    border-top: 1px solid #eee;
    text-align: center;
    color: #666;
}

/* Result Container */
.sls-result-container {
    margin-top: 15px;
    padding: 15px;
    border-radius: 3px;
}

.sls-result-success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.sls-result-error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.sls-result-warning {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
}

.sls-result-info {
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* License Details in Results */
.sls-license-details {
    margin-top: 15px;
}

.sls-license-details h4 {
    margin: 0 0 10px 0;
    color: #333;
    font-size: 1em;
}

.sls-license-details table {
    width: 100%;
    border-collapse: collapse;
}

.sls-license-details th,
.sls-license-details td {
    padding: 8px 12px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

.sls-license-details th {
    background: #f9f9f9;
    font-weight: bold;
    color: #333;
}

.sls-license-details td {
    color: #666;
}

/* Expiry Indicators */
.sls-expired {
    color: #dc3232;
    font-weight: bold;
}

.sls-expiring {
    color: #ffb900;
    font-weight: bold;
}

/* Loading State */
.sls-loading {
    opacity: 0.6;
    pointer-events: none;
}

.sls-loading-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #0073aa;
    border-radius: 50%;
    animation: sls-spin 1s linear infinite;
    margin-right: 8px;
}

@keyframes sls-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Error Messages */
.sls-error {
    color: #dc3232;
    font-weight: bold;
    padding: 10px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 3px;
}

.sls-success {
    color: #155724;
    font-weight: bold;
    padding: 10px;
    background: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 3px;
}

.sls-warning {
    color: #856404;
    font-weight: bold;
    padding: 10px;
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    border-radius: 3px;
}

.sls-info {
    color: #0c5460;
    font-weight: bold;
    padding: 10px;
    background: #d1ecf1;
    border: 1px solid #bee5eb;
    border-radius: 3px;
}

/* WooCommerce My Account Integration */
.woocommerce-account .sls-license-list {
    margin: 20px 0;
}

.woocommerce-account .sls-license-item {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 15px;
    margin-bottom: 15px;
}

.woocommerce-account .sls-license-item h4 {
    margin: 0 0 10px 0;
    color: #333;
}

.woocommerce-account .sls-license-key {
    font-family: monospace;
    background: #fff;
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 12px;
}

.woocommerce-account .sls-license-meta {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 14px;
    color: #666;
}

.woocommerce-account .sls-license-meta span {
    display: flex;
    flex-direction: column;
}

.woocommerce-account .sls-license-meta strong {
    color: #333;
    margin-bottom: 2px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .sls-license-verification-form,
    .sls-license-status {
        margin: 10px;
        border-radius: 0;
    }
    
    .sls-status-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .sls-status-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .sls-status-item label {
        flex: none;
    }
    
    .sls-status-item span {
        text-align: left;
    }
    
    .woocommerce-account .sls-license-meta {
        flex-direction: column;
        gap: 10px;
    }
}

@media (max-width: 480px) {
    .sls-license-verification-form {
        padding: 15px;
    }
    
    .sls-input {
        padding: 8px 10px;
        font-size: 16px; /* Prevent zoom on iOS */
    }
    
    .sls-button {
        width: 100%;
        padding: 12px;
    }
    
    .sls-license-details table,
    .sls-license-details th,
    .sls-license-details td {
        font-size: 12px;
    }
}

/* Integration with Common Themes */
.sls-license-verification-form input,
.sls-license-verification-form button {
    box-sizing: border-box;
}

/* WordPress Default Styling Compatibility */
.entry-content .sls-license-verification-form,
.entry-content .sls-license-status {
    margin: 1.5em 0;
}

.entry-content .sls-license-verification-form h3,
.entry-content .sls-license-status h3 {
    margin-top: 0;
}

/* Print Styles */
@media print {
    .sls-license-verification-form {
        background: transparent;
        border: 1px solid #000;
    }
    
    .sls-button {
        display: none;
    }
    
    .sls-license-status {
        background: transparent;
        border: 1px solid #000;
    }
    
    .sls-status-dot {
        border: 1px solid #000;
    }
}
