/**
 * JK Catalog Creator - Public Styles
 */

/* Base Styles */
.jk-catalog-btn,
.jk-catalog-download-btn,
.jk-catalog-view-btn,
.jk-catalog-generate-btn {
    display: inline-block;
    padding: 12px 24px;
    background: #2c5aa0;
    color: white;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin: 5px;
}

.jk-catalog-btn:hover,
.jk-catalog-download-btn:hover,
.jk-catalog-view-btn:hover,
.jk-catalog-generate-btn:hover {
    background: #1e3d6f;
    color: white;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(44, 90, 160, 0.3);
}

.jk-catalog-btn:active,
.jk-catalog-download-btn:active,
.jk-catalog-view-btn:active,
.jk-catalog-generate-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(44, 90, 160, 0.3);
}

.jk-catalog-btn:disabled,
.jk-catalog-download-btn:disabled,
.jk-catalog-view-btn:disabled,
.jk-catalog-generate-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Button Variants */
.jk-catalog-btn.secondary {
    background: #6c757d;
}

.jk-catalog-btn.secondary:hover {
    background: #545b62;
}

.jk-catalog-btn.success {
    background: #28a745;
}

.jk-catalog-btn.success:hover {
    background: #218838;
}

.jk-catalog-btn.danger {
    background: #dc3545;
}

.jk-catalog-btn.danger:hover {
    background: #c82333;
}

/* Request Form */
.jk-catalog-request-wrapper {
    max-width: 500px;
    margin: 20px auto;
    padding: 20px;
    border: 1px solid #ddd;
    border-radius: 8px;
    background: #f9f9f9;
}

.jk-catalog-request-title {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.jk-catalog-request-description {
    margin: 0 0 20px 0;
    color: #666;
    line-height: 1.5;
}

.jk-catalog-request-field {
    margin-bottom: 15px;
}

.jk-catalog-request-field label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
}

.jk-catalog-email-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    box-sizing: border-box;
}

.jk-catalog-email-input:focus {
    outline: none;
    border-color: #2c5aa0;
    box-shadow: 0 0 0 2px rgba(44, 90, 160, 0.2);
}

.jk-catalog-submit-btn {
    width: 100%;
    padding: 12px;
    background: #2c5aa0;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.jk-catalog-submit-btn:hover {
    background: #1e3d6f;
}

.jk-catalog-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* Messages */
.jk-catalog-success {
    padding: 15px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    margin: 10px 0;
}

.jk-catalog-error {
    padding: 15px;
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    border-radius: 4px;
    margin: 10px 0;
}

.jk-catalog-warning {
    padding: 15px;
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
    border-radius: 4px;
    margin: 10px 0;
}

.jk-catalog-info {
    padding: 15px;
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    border-radius: 4px;
    margin: 10px 0;
}

/* Progress Bar */
.jk-catalog-progress {
    width: 100%;
    height: 20px;
    background: #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    margin: 10px 0;
}

.jk-catalog-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #2c5aa0, #4a90e2);
    border-radius: 10px;
    transition: width 0.3s ease;
    position: relative;
}

.jk-catalog-progress-bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shimmer 2s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.jk-catalog-progress-text {
    text-align: center;
    font-size: 12px;
    color: #666;
    margin-top: 5px;
}

/* Catalog List */
.jk-catalog-list {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin: 20px 0;
}

.jk-catalog-item {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: white;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.jk-catalog-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.jk-catalog-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.jk-catalog-description {
    margin: 0 0 15px 0;
    color: #666;
    line-height: 1.5;
}

.jk-catalog-date {
    margin: 0 0 15px 0;
    font-size: 12px;
    color: #999;
}

.jk-catalog-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Embed Container */
.jk-catalog-embed {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Modal Styles */
.jk-catalog-modal {
    display: none;
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.8);
    backdrop-filter: blur(5px);
}

.jk-catalog-modal-content {
    position: relative;
    background: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 8px;
    width: 90%;
    max-width: 800px;
    max-height: 80vh;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}

.jk-catalog-modal-header {
    padding: 20px;
    border-bottom: 1px solid #ddd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8f9fa;
}

.jk-catalog-modal-title {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.jk-catalog-modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.3s ease;
}

.jk-catalog-modal-close:hover {
    background: #e9ecef;
    color: #333;
}

.jk-catalog-modal-body {
    padding: 20px;
    overflow-y: auto;
    max-height: calc(80vh - 120px);
}

/* Loading States */
.jk-catalog-loading {
    position: relative;
    pointer-events: none;
    opacity: 0.7;
}

.jk-catalog-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 #2c5aa0;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive Design */
@media (max-width: 768px) {
    .jk-catalog-request-wrapper {
        margin: 10px;
        padding: 15px;
    }
    
    .jk-catalog-list {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .jk-catalog-item {
        padding: 15px;
    }
    
    .jk-catalog-actions {
        flex-direction: column;
    }
    
    .jk-catalog-btn,
    .jk-catalog-download-btn,
    .jk-catalog-view-btn,
    .jk-catalog-generate-btn {
        width: 100%;
        margin: 5px 0;
    }
    
    .jk-catalog-modal-content {
        width: 95%;
        margin: 10% auto;
    }
    
    .jk-catalog-modal-header,
    .jk-catalog-modal-body {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    .jk-catalog-request-wrapper {
        margin: 5px;
        padding: 10px;
    }
    
    .jk-catalog-modal-content {
        width: 98%;
        margin: 5% auto;
    }
    
    .jk-catalog-modal-header,
    .jk-catalog-modal-body {
        padding: 10px;
    }
}

/* Print Styles */
@media print {
    .jk-catalog-btn,
    .jk-catalog-download-btn,
    .jk-catalog-view-btn,
    .jk-catalog-generate-btn,
    .jk-catalog-request-wrapper,
    .jk-catalog-actions {
        display: none !important;
    }
    
    .jk-catalog-item {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .jk-catalog-list {
        display: block;
    }
}

/* Accessibility */
.jk-catalog-btn:focus,
.jk-catalog-download-btn:focus,
.jk-catalog-view-btn:focus,
.jk-catalog-generate-btn:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

.jk-catalog-modal-close:focus {
    outline: 2px solid #2c5aa0;
    outline-offset: 2px;
}

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .jk-catalog-btn,
    .jk-catalog-download-btn,
    .jk-catalog-view-btn,
    .jk-catalog-generate-btn {
        border: 2px solid #000;
    }
    
    .jk-catalog-item {
        border: 2px solid #000;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .jk-catalog-btn,
    .jk-catalog-download-btn,
    .jk-catalog-view-btn,
    .jk-catalog-generate-btn,
    .jk-catalog-item {
        transition: none;
    }
    
    .jk-catalog-progress-bar::after {
        animation: none;
    }
    
    .jk-catalog-loading::after {
        animation: none;
    }
}
