/**
 * Public styles for ifFound plugin
 */

/* Variables */
:root {
    --iffound-primary: #014c43;
    --iffound-primary-hover: #51a59b;
    --iffound-secondary: #f7f7f7;
    --iffound-text: #333;
    --iffound-border: #ddd;
    --iffound-success: #46b450;
    --iffound-danger: #dc3232;
}

/* QR Generator */
.iffound-qr-generator {
    max-width: 600px;
    margin: 0 auto;
    padding: 20px;
}

.iffound-generator-container {
    background: #fff;
    border: 1px solid var(--iffound-border);
    border-radius: 8px;
    padding: 30px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.iffound-step {
    margin-bottom: 30px;
}

.iffound-step h3 {
    color: var(--iffound-primary);
    margin-bottom: 15px;
}

.iffound-step.active {
    display: block;
}

.iffound-qr-preview {
    text-align: center;
    margin: 20px 0;
}

.iffound-qr-preview img {
    max-width: 300px;
    height: auto;
    border: 2px solid var(--iffound-border);
    padding: 10px;
    background: #fff;
    border-radius: 4px;
}

.iffound-qr-url {
    font-size: 12px;
    color: #666;
    margin-top: 10px;
    word-break: break-all;
}

/* Form elements */
.iffound-form-group {
    margin-bottom: 20px;
}

.iffound-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: var(--iffound-text);
}

.iffound-input {
    width: 100%;
    padding: 10px 15px;
    border: 1px solid var(--iffound-border);
    border-radius: 4px;
    font-size: 16px;
}

.iffound-input:focus {
    outline: none;
    border-color: var(--iffound-primary);
}

/* Buttons */
.iffound-button {
    display: inline-block;
    padding: 12px 24px;
    border: 1px solid transparent;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-right: 10px;
    margin-bottom: 10px;
}

.iffound-button-primary {
    background-color: var(--iffound-primary);
    color: #fff;
    border-color: var(--iffound-primary);
}

.iffound-button-primary:hover {
    background-color: var(--iffound-primary-hover);
    border-color: var(--iffound-primary-hover);
    color: #fff;
}

.iffound-button-secondary {
    background-color: #fff;
    color: var(--iffound-primary);
    border-color: var(--iffound-primary);
}

.iffound-button-secondary:hover {
    background-color: var(--iffound-primary);
    color: #fff;
}

.iffound-button-link {
    background: none;
    color: var(--iffound-primary);
    border: none;
    padding: 5px 10px;
    text-decoration: underline;
}

.iffound-button-link:hover {
    color: var(--iffound-primary-hover);
}

.iffound-button-small {
    padding: 6px 12px;
    font-size: 14px;
}

.iffound-button-danger {
    color: var(--iffound-danger);
    border-color: var(--iffound-danger);
}

.iffound-button-danger:hover {
    background-color: var(--iffound-danger);
    color: #fff;
}

.iffound-button-disabled,
.iffound-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Subscription prompt */
.iffound-subscription-prompt {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.iffound-subscription-content {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    max-width: 500px;
    text-align: center;
}

.iffound-subscription-content h4 {
    color: var(--iffound-primary);
    margin-bottom: 20px;
    font-size: 24px;
}

/* Success message */
.iffound-success-message {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.iffound-message-content {
    background: #fff;
    padding: 40px;
    border-radius: 8px;
    max-width: 500px;
    text-align: center;
}

.iffound-message-content h4 {
    color: var(--iffound-success);
    margin-bottom: 20px;
}

/* Accessory Shop */
.iffound-accessory-shop {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

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

.iffound-accessory-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

.iffound-col-2 { grid-template-columns: repeat(2, 1fr); }
.iffound-col-3 { grid-template-columns: repeat(3, 1fr); }
.iffound-col-4 { grid-template-columns: repeat(4, 1fr); }

.iffound-accessory-item {
    background: #fff;
    border: 1px solid var(--iffound-border);
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.iffound-accessory-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.iffound-accessory-image {
    width: 100%;
    height: 200px;
    background: var(--iffound-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.iffound-accessory-image img {
    max-width: 100%;
    max-height: 100%;
    object-fit: cover;
}

.iffound-accessory-details {
    padding: 20px;
}

.iffound-accessory-details h4 {
    color: var(--iffound-primary);
    margin-bottom: 15px;
}

.iffound-accessory-features ul {
    list-style: none;
    padding: 0;
    margin: 0 0 15px 0;
}

.iffound-accessory-features li {
    padding-left: 20px;
    position: relative;
    margin-bottom: 5px;
    font-size: 14px;
}

.iffound-accessory-features li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: var(--iffound-success);
}

.iffound-accessory-price {
    font-size: 24px;
    font-weight: bold;
    color: var(--iffound-primary);
    margin-bottom: 15px;
}

/* User QR Codes */
.iffound-user-qrcodes {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.iffound-qrcodes-header {
    text-align: center;
    margin-bottom: 30px;
}

.iffound-subscription-notice {
    background: #f0f8ff;
    border: 1px solid #0073aa;
    border-radius: 4px;
    padding: 20px;
    margin: 20px 0;
}

.iffound-no-codes {
    text-align: center;
    padding: 60px 20px;
    background: var(--iffound-secondary);
    border-radius: 8px;
}

.iffound-qrcodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.iffound-qrcode-item {
    background: #fff;
    border: 1px solid var(--iffound-border);
    border-radius: 8px;
    padding: 20px;
    text-align: center;
}

.iffound-qrcode-image {
    margin-bottom: 15px;
}

.iffound-qrcode-image img {
    max-width: 150px;
    height: auto;
}

.iffound-qrcode-details h4 {
    color: var(--iffound-primary);
    margin-bottom: 10px;
}

.iffound-qrcode-date {
    font-size: 14px;
    color: #666;
}

.iffound-qrcode-url {
    font-size: 12px;
    color: #999;
    word-break: break-all;
}

.iffound-qrcode-actions {
    margin-top: 15px;
}

/* Account page */
.iffound-account-qrcodes {
    padding: 20px 0;
}

.iffound-account-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
}

.iffound-subscription-banner {
    background: linear-gradient(135deg, var(--iffound-primary) 0%, var(--iffound-primary-hover) 100%);
    color: #fff;
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 30px;
    text-align: center;
}

.iffound-subscription-banner h3 {
    color: #fff;
    margin-bottom: 10px;
}

.iffound-button-accent {
    background: #fff;
    color: var(--iffound-primary);
}

.iffound-subscription-status {
    margin-bottom: 20px;
}

.iffound-status-active {
    color: var(--iffound-success);
    font-weight: 600;
}

.iffound-stats {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
}

.iffound-stat-item {
    text-align: center;
    flex: 1;
    padding: 20px;
    background: var(--iffound-secondary);
    border-radius: 8px;
}

.iffound-stat-number {
    display: block;
    font-size: 36px;
    font-weight: bold;
    color: var(--iffound-primary);
}

.iffound-stat-label {
    display: block;
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

.iffound-empty-state {
    text-align: center;
    padding: 60px 20px;
}

.iffound-empty-state img {
    max-width: 200px;
    opacity: 0.5;
    margin-bottom: 20px;
}

/* Table */
.iffound-qrcodes-table {
    margin-bottom: 30px;
}

.iffound-qrcodes-table .shop_table {
    width: 100%;
}

.iffound-qr-identifier {
    color: #999;
    font-family: monospace;
}

/* Modal */
.iffound-modal {
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
}

.iffound-modal-content {
    background-color: #fff;
    padding: 30px;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
}

.iffound-modal-large {
    max-width: 800px;
}

.iffound-modal-close {
    position: absolute;
    right: 15px;
    top: 15px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #666;
}

.iffound-modal-close:hover {
    color: #000;
}

.iffound-modal-body {
    display: flex;
    gap: 30px;
    align-items: center;
}

.iffound-modal-qr-preview {
    flex-shrink: 0;
}

.iffound-modal-qr-image {
    max-width: 300px;
    height: auto;
}

.iffound-modal-qr-info {
    flex: 1;
}

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

.iffound-spinner {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid var(--iffound-primary);
    border-radius: 50%;
    animation: iffound-spin 1s linear infinite;
}

@keyframes iffound-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .iffound-col-2,
    .iffound-col-3,
    .iffound-col-4 {
        grid-template-columns: 1fr;
    }
    
    .iffound-modal-body {
        flex-direction: column;
    }
    
    .iffound-stats {
        flex-direction: column;
        gap: 15px;
    }
    
    .iffound-account-header {
        flex-direction: column;
        gap: 15px;
    }
    
    .iffound-qrcodes-table table {
        font-size: 14px;
    }
}