/* E-Katalog Download Plugin - Frontend Styles */

/* Sticky Button Styles */
#ekatalog-sticky-button {
    position: fixed;
    left: 20px;
    bottom: 20px;
    z-index: 9999;
    transition: all 0.3s ease;
    -webkit-transform: translateZ(0);
    transform: translateZ(0);
    will-change: transform;
}


#ekatalog-trigger {
    background: #fecb26;
    color: #474747;
    border: none;
    border-radius: 50%;
    width: 70px;
    height: 70px;
    padding: 0;
    cursor: pointer;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(254, 203, 38, 0.4);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

#ekatalog-trigger:hover {
    background: #f4c430;
    box-shadow: 0 6px 20px rgba(254, 203, 38, 0.5);
    transform: scale(1.1);
}

.ekatalog-pdf-icon {
    width: 32px;
    height: 32px;
    display: block;
    object-fit: contain;
}

/* Modal Styles */
.ekatalog-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    animation: fadeIn 0.3s ease;
}

.ekatalog-modal.show {
    display: flex !important;
    align-items: center;
    justify-content: center;
}

.ekatalog-modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    max-width: 600px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
    position: relative;
    margin: 0;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from { 
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to { 
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Modal Header */
.ekatalog-modal-header {
    padding: 30px 30px 20px;
    border-bottom: 1px solid #e5e5e5;
    position: relative;
}

.ekatalog-modal-header h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    font-weight: 600;
    color: #333;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ekatalog-modal-header p {
    margin: 0;
    color: #666;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ekatalog-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    color: #999;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
}

.ekatalog-close:hover {
    color: #333;
}

/* Form Styles */
#ekatalog-form {
    padding: 30px;
}

.ekatalog-form-row {
    display: flex;
    gap: 20px;
    margin-bottom: 20px;
}

.ekatalog-form-group {
    flex: 1;
}

.ekatalog-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #333;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ekatalog-form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.ekatalog-form-group input:focus {
    outline: none;
    border-color: #fecb26;
    box-shadow: 0 0 0 3px rgba(254, 203, 38, 0.1);
}

.ekatalog-form-group input::placeholder {
    color: #999;
}

/* Form Footer */
.ekatalog-form-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #e5e5e5;
}

.ekatalog-success-message {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #28a745;
    font-weight: 600;
    font-size: 14px;
}

.ekatalog-success-icon {
    background: #28a745;
    color: white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: bold;
}


/* Buttons */
.ekatalog-buttons {
    display: flex;
    gap: 12px;
}

.ekatalog-close-btn {
    background: #f8f9fa;
    color: #6c757d;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ekatalog-close-btn:hover {
    background: #e9ecef;
    border-color: #adb5bd;
}

.ekatalog-submit-btn {
    background: #fecb26;
    color: #474747;
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.ekatalog-submit-btn:hover {
    background: #f4c430;
    transform: translateY(-1px);
}

.ekatalog-submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

/* Loading State */
.ekatalog-loading {
    position: relative;
    pointer-events: none;
}

.ekatalog-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 #fecb26;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Error Messages */
.ekatalog-error {
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
    display: none;
}

.ekatalog-form-group.error input {
    border-color: #dc3545;
}

.ekatalog-form-group.error .ekatalog-error {
    display: block;
}

/* reCAPTCHA Styles */
.ekatalog-recaptcha {
    margin: 20px 0;
    text-align: center;
}

.ekatalog-recaptcha .g-recaptcha {
    display: inline-block;
}

/* Toast Notifications */
.ekatalog-toast-error {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #dc3545;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
    z-index: 10001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    max-width: 300px;
    animation: slideInRight 0.3s ease;
}

.ekatalog-toast-success {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #28a745;
    color: white;
    padding: 15px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
    z-index: 10001;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    max-width: 300px;
    animation: slideInRight 0.3s ease;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .ekatalog-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .ekatalog-form-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .ekatalog-form-footer {
        flex-direction: column;
        gap: 20px;
        align-items: stretch;
    }
    
    .ekatalog-buttons {
        justify-content: center;
    }
    
    #ekatalog-sticky-button {
        left: 15px;
        bottom: 15px;
    }
    
    #ekatalog-trigger {
        width: 75px;
        height: 75px;
    }
    
    .ekatalog-pdf-icon {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .ekatalog-modal-header,
    #ekatalog-form {
        padding: 20px;
    }
    
    .ekatalog-modal-header h2 {
        font-size: 20px;
    }
    
    .ekatalog-buttons {
        flex-direction: column;
    }
    
    .ekatalog-close-btn,
    .ekatalog-submit-btn {
        width: 100%;
    }
    
    #ekatalog-sticky-button {
        left: 15px;
        bottom: 15px;
        position: fixed;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
    
    #ekatalog-trigger {
        width: 80px;
        height: 80px;
    }
    
    .ekatalog-pdf-icon {
        width: 36px;
        height: 36px;
    }
}

/* Touch device optimizations */
@media (max-width: 767px) {
    #ekatalog-sticky-button {
        position: fixed !important;
        left: 15px !important;
        bottom: 15px !important;
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
        -webkit-backface-visibility: hidden;
        backface-visibility: hidden;
    }
    
    #ekatalog-trigger {
        width: 80px !important;
        height: 80px !important;
        min-width: 80px;
        min-height: 80px;
    }
    
    .ekatalog-pdf-icon {
        width: 38px !important;
        height: 38px !important;
    }
}
