/* MagzPress Frontend Styles */

/* Magazine List Styles */
.magzpress-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.magzpress-filters {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
}

.magzpress-search {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.magzpress-search input[type="text"] {
    flex: 1;
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
}

.magzpress-search button {
    padding: 10px 20px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.magzpress-search button:hover {
    background: #005a87;
}

.magzpress-filter-controls {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.magzpress-filter-controls select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    min-width: 150px;
}

/* Magazine Grid */
.magzpress-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 30px;
    margin-bottom: 40px;
}

.magzpress-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
}

.magzpress-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.magzpress-card-image {
    position: relative;
    height: 300px;
    overflow: hidden;
}

.magzpress-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.magzpress-card:hover .magzpress-card-image img {
    transform: scale(1.05);
}

.magzpress-placeholder-image {
    width: 100%;
    height: 100%;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999;
}

.magzpress-placeholder-image .dashicons {
    font-size: 60px;
    width: 60px;
    height: 60px;
}

.magzpress-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.magzpress-card:hover .magzpress-card-overlay {
    opacity: 1;
}

.magzpress-view-btn {
    background: #007cba;
    color: white;
    padding: 12px 24px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 500;
    transition: background 0.3s ease;
}

.magzpress-view-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

.magzpress-access-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: bold;
    text-transform: uppercase;
}

.magzpress-access-badge.free {
    background: #28a745;
    color: white;
}

.magzpress-access-badge.paid {
    background: #ffc107;
    color: #212529;
}

.magzpress-card-content {
    padding: 20px;
}

.magzpress-card-title {
    margin: 0 0 10px 0;
    font-size: 18px;
    line-height: 1.3;
}

.magzpress-card-title a {
    text-decoration: none;
    color: #333;
}

.magzpress-card-title a:hover {
    color: #007cba;
}

.magzpress-issue-number {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #666;
    font-weight: 500;
}

.magzpress-publication-date {
    margin: 0 0 10px 0;
    font-size: 14px;
    color: #666;
}

.magzpress-card-excerpt {
    margin: 0 0 15px 0;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.magzpress-card-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.magzpress-category-tag {
    background: #e9ecef;
    color: #495057;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    text-decoration: none;
}

/* Single Magazine View */
.magzpress-single-view {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.magzpress-magazine-header {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.magzpress-magazine-cover img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.magzpress-placeholder-cover {
    width: 100%;
    height: 400px;
    background: #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: #999;
}

.magzpress-placeholder-cover .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
}

.magzpress-magazine-title {
    margin: 0 0 20px 0;
    font-size: 32px;
    line-height: 1.2;
    color: #333;
}

.magzpress-magazine-info p {
    margin: 0 0 10px 0;
    font-size: 16px;
    line-height: 1.5;
}

.magzpress-access-info {
    margin: 20px 0;
}

.magzpress-magazine-description {
    margin: 20px 0;
    font-size: 16px;
    line-height: 1.6;
}

.magzpress-categories,
.magzpress-tags {
    margin: 15px 0;
}

.magzpress-tag {
    background: #007cba;
    color: white;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    margin-right: 5px;
    text-decoration: none;
}


.magzpress-preview-notice {
    background: #fff3cd;
    border: 1px solid #ffeaa7;
    color: #856404;
    padding: 15px;
    text-align: center;
    font-weight: 500;
}

.magzpress-viewer-controls {
    background: #f8f9fa;
    padding: 15px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    gap: 15px;
    align-items: center;
}

.magzpress-download-btn,
.magzpress-fullscreen-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 8px 16px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    text-decoration: none;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.magzpress-download-btn:hover,
.magzpress-fullscreen-btn:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}


/* Download Only View */
.magzpress-download-only {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background: #f8f9fa;
}

.magzpress-download-message {
    text-align: center;
    padding: 40px;
}

.magzpress-download-message .dashicons {
    font-size: 80px;
    width: 80px;
    height: 80px;
    color: #007cba;
    margin-bottom: 20px;
}

.magzpress-download-message h4 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #333;
}

.magzpress-download-message p {
    margin: 0 0 25px 0;
    font-size: 16px;
    color: #666;
}

.magzpress-download-btn-large {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 15px 30px;
    background: #007cba;
    color: white;
    border-radius: 6px;
    text-decoration: none;
    font-size: 16px;
    font-weight: 500;
    transition: background 0.3s ease;
}

.magzpress-download-btn-large:hover {
    background: #005a87;
    color: white;
    text-decoration: none;
}

/* Payment Section */
.magzpress-payment-section {
    background: #f8f9fa;
    padding: 30px;
    border-radius: 8px;
    margin-top: 40px;
    text-align: center;
    border: 1px solid #e9ecef;
}

.magzpress-payment-section h3 {
    margin: 0 0 15px 0;
    font-size: 24px;
    color: #333;
}

.magzpress-payment-section p {
    margin: 0 0 25px 0;
    font-size: 16px;
    color: #666;
}

.magzpress-purchase-btn {
    background: #28a745;
    color: white;
    padding: 15px 30px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s ease;
}

.magzpress-purchase-btn:hover {
    background: #218838;
}

/* Pagination */
.magzpress-pagination {
    text-align: center;
    margin-top: 40px;
}

.magzpress-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 4px;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    color: #007cba;
}

.magzpress-pagination .page-numbers:hover,
.magzpress-pagination .page-numbers.current {
    background: #007cba;
    color: white;
    border-color: #007cba;
}

/* Error Messages */
.magzpress-error {
    background: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 4px;
    border: 1px solid #f5c6cb;
}

.magzpress-no-results {
    text-align: center;
    font-size: 18px;
    color: #666;
    padding: 40px 20px;
}

/* Responsive Design */
@media (max-width: 768px) {

    .magzpress-list-container,
    .magzpress-single-view {
        padding: 15px;
    }

    .magzpress-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    .magzpress-magazine-header {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .magzpress-magazine-cover {
        max-width: 300px;
        margin: 0 auto;
    }

    .magzpress-filter-controls {
        flex-direction: column;
    }

    .magzpress-filter-controls select {
        min-width: auto;
        width: 100%;
    }

    .magzpress-search {
        flex-direction: column;
    }

    .magzpress-viewer-controls {
        flex-wrap: wrap;
    }
}

/* PDF Viewer Styles */
.pdf-viewer-toolbar {
    background: #f8f9fa;
    border-bottom: 1px solid #e9ecef;
    padding: 10px 15px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.pdf-controls-left,
.pdf-controls-right {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 12px;
    background: #007cba;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
    transition: background 0.3s ease;
}

.pdf-btn:hover:not(:disabled) {
    background: #005a87;
}

.pdf-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.pdf-btn .dashicons {
    font-size: 16px;
    width: 16px;
    height: 16px;
}

.pdf-page-info {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    margin: 0 10px;
}

.pdf-zoom-level {
    font-size: 14px;
    color: #666;
    font-weight: 500;
    min-width: 40px;
    text-align: center;
}

.pdf-canvas-container {
    flex: 1;
    overflow: auto;
    background: #525659;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    min-height: 400px;
}

.pdf-canvas {
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    background: white;
    max-width: 100%;
    height: auto;
}

/* Loading and Error States */
.magzpress-pdf-loading,
.magzpress-pdf-error {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 300px;
    text-align: center;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.magzpress-pdf-error .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #dc3545;
    margin-bottom: 15px;
}

.magzpress-pdf-loading p,
.magzpress-pdf-error p {
    margin: 0;
    font-size: 16px;
    color: #666;
}

/* Responsive PDF Viewer */
@media (max-width: 768px) {
    .pdf-viewer-toolbar {
        flex-direction: column;
        gap: 15px;
    }

    .pdf-controls-left,
    .pdf-controls-right {
        flex-wrap: wrap;
        justify-content: center;
    }

    .pdf-btn {
        font-size: 12px;
        padding: 8px 12px;
    }

    .pdf-canvas-container {
        padding: 10px;
    }
}

.cta-buttons-widget {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.elementor-button {
    padding: 0.45rem 1.1rem;
    border: none;
    border-radius: 24px;
    font-size: 0.98rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-width: 90px;
    line-height: 1.2;
    box-shadow: none;
}

.elementor-button-primary {
    background: linear-gradient(45deg, #4ecdc4, #44a08d);
    color: #fff;
    box-shadow: 0 2px 8px rgba(78, 205, 196, 0.13);
}

.elementor-button-primary:hover {
    transform: translateY(-1px) scale(1.03);
    box-shadow: 0 4px 16px rgba(78, 205, 196, 0.18);
}

.elementor-button-secondary {
    background: transparent;
    color: #44a08d;
    border: 1.5px solid #44a08d;
}

.elementor-button-secondary:hover {
    background: #e6f7f7;
    color: #1a7f37;
    transform: translateY(-1px) scale(1.03);
}

/* Newsletter Popup */
.newsletter-popup {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.newsletter-popup.active {
    opacity: 1;
    visibility: visible;
}

.popup-content {
    background: white;
    padding: 2.5rem;
    border-radius: 20px;
    max-width: 500px;
    width: 90%;
    text-align: center;
    transform: scale(0.8);
    transition: transform 0.3s ease;
    position: relative;
}

.newsletter-popup.active .popup-content {
    transform: scale(1);
}

.popup-title {
    color: #333;
    font-size: 2rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.popup-subtitle {
    color: #666;
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.5;
}

.popup-form {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.popup-input {
    flex: 1;
    padding: 1rem;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
}

.popup-input:focus {
    outline: none;
    border-color: #4ecdc4;
}

.popup-submit {
    padding: 1rem 2rem;
    background: #4ecdc4;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.3s ease;
}

.popup-submit:hover {
    background: #44a08d;
}

.close-popup {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 2rem;
    cursor: pointer;
    color: #999;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-popup:hover {
    background: #f0f0f0;
    color: #333;
}

@media (max-width: 480px) {
    .elementor-button {
        width: 100%;
        margin-bottom: 0.4rem;
    }
}
