/**
 * Public styles for the E-book Lead Capture plugin.
 *
 * @since      1.0.0
 * @package    Ebook_Lead_Capture
 * @subpackage Ebook_Lead_Capture/public/css
 */

/* E-book List Layout */
.ebook-list {
    margin: 30px 0;
}

.ebook-list-item {
    display: flex;
    margin-bottom: 30px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.ebook-list-image {
    flex: 0 0 200px;
    margin-right: 30px;
}

.ebook-list-image img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.ebook-list-details {
    flex: 1;
}

.ebook-list-details h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.ebook-excerpt {
    margin-bottom: 20px;
}

/* E-book Grid Layout */
.ebook-grid {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -15px 30px;
}

.ebook-grid-item {
    padding: 15px;
    margin-bottom: 30px;
    text-align: center;
}

.ebook-grid-columns-2 .ebook-grid-item {
    width: 50%;
}

.ebook-grid-columns-3 .ebook-grid-item {
    width: 33.333%;
}

.ebook-grid-columns-4 .ebook-grid-item {
    width: 25%;
}

.ebook-grid-image {
    margin-bottom: 15px;
}

.ebook-grid-image img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

/* Single E-book Layout */
.ebook-single {
    margin: 30px 0;
}

.ebook-single-content {
    display: flex;
    flex-wrap: wrap;
}

.ebook-single-image {
    flex: 0 0 300px;
    margin-right: 30px;
    margin-bottom: 30px;
}

.ebook-single-image img {
    max-width: 100%;
    height: auto;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.ebook-single-details {
    flex: 1;
    min-width: 300px;
}

.ebook-page-count {
    margin-bottom: 20px;
    color: #666;
}

.ebook-page-count .dashicons {
    vertical-align: middle;
    margin-right: 5px;
}

/* No image placeholder */
.ebook-no-image {
    background-color: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 200px;
    border: 1px solid #eee;
}

.ebook-no-image .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #999;
}

/* Download Button */
.ebook-download-button {
    display: inline-block;
    background-color: #f7931e;
    color: #fff;
    padding: 12px 25px;
    text-decoration: none;
    border: none;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ebook-download-button:hover,
.ebook-download-button:focus {
    background-color: #e07c0e;
    color: #fff;
}

/* Form Popup Overlay */
.ebook-form-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 999999;
    display: none;
}

.ebook-form-popup {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    background-color: #fff;
    padding: 30px;
    border-radius: 5px;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    z-index: 1000000;
    display: none;
}

.ebook-popup-close {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease;
}

.ebook-popup-close:hover {
    color: #d63638;
}

.ebook-popup-title {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

/* Form Styles */
.ebook-form-container {
    margin-top: 20px;
}

.ebook-form-group {
    margin-bottom: 20px;
}

.ebook-form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

.ebook-form-group label .required {
    color: #d63638;
}

.ebook-form-group input[type="text"],
.ebook-form-group input[type="email"],
.ebook-form-group input[type="tel"],
.ebook-form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 3px;
    font-size: 16px;
}

.ebook-form-group.has-error input {
    border-color: #d63638;
}

/* CAPTCHA Styles */
.ebook-captcha-container {
    margin-top: 5px;
}

.ebook-captcha-code {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.ebook-captcha-code img {
    height: 50px;
    border: 1px solid #ddd;
    background-color: #f8f8f8;
    margin-right: 10px;
}

.ebook-refresh-captcha {
    background: none;
    border: none;
    color: #666;
    cursor: pointer;
    padding: 0;
    font-size: 16px;
}

.ebook-refresh-captcha:hover {
    color: #f7931e;
}

.ebook-form-group .error-message {
    color: #d63638;
    font-size: 14px;
    margin-top: 5px;
}

.ebook-global-error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 10px 15px;
    border-radius: 3px;
    margin-bottom: 20px;
}

.ebook-form-submit {
    margin-top: 20px;
}

.ebook-form-submit button {
    padding: 12px 25px;
    background-color: #f7931e;
    color: #fff;
    border: none;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ebook-form-submit button:hover,
.ebook-form-submit button:disabled {
    background-color: #e07c0e;
}

.ebook-form-submit button:disabled {
    cursor: not-allowed;
    opacity: 0.7;
}

/* Success Message */
.ebook-success-message {
    display: none;
    text-align: center;
}

.ebook-success-icon {
    color: #46b450;
    font-size: 64px;
    margin-bottom: 20px;
}

.ebook-success-icon svg {
    width: 64px;
    height: 64px;
}

.ebook-success-title {
    font-size: 24px;
    margin-bottom: 15px;
    color: #46b450;
}

.ebook-success-text {
    margin-bottom: 25px;
}

.ebook-success-ebook-title {
    font-weight: 600;
}

.ebook-download-now {
    display: inline-block;
    background-color: #f7931e;
    color: #fff;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 3px;
    font-size: 16px;
    font-weight: 600;
    margin-top: 10px;
    transition: all 0.2s ease;
}

.ebook-download-now:hover,
.ebook-download-now:focus {
    background-color: #e07c0e;
    color: #fff;
}

.ebook-email-notice {
    margin-top: 15px;
    padding: 10px;
    background-color: #f8f9fa;
    border-radius: 3px;
    font-size: 14px;
    color: #666;
}

/* Empty states */
.ebook-list-empty,
.ebook-grid-empty,
.ebook-single-error {
    padding: 20px;
    background-color: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 3px;
    text-align: center;
    color: #666;
}

/* Responsive Adjustments */
@media only screen and (max-width: 768px) {
    .ebook-list-item {
        flex-direction: column;
    }
    
    .ebook-list-image {
        margin-right: 0;
        margin-bottom: 20px;
    }
    
    .ebook-grid-columns-3 .ebook-grid-item,
    .ebook-grid-columns-4 .ebook-grid-item {
        width: 50%;
    }
    
    .ebook-single-content {
        flex-direction: column;
    }
    
    .ebook-single-image {
        margin-right: 0;
    }
}

@media only screen and (max-width: 480px) {
    .ebook-grid-columns-2 .ebook-grid-item,
    .ebook-grid-columns-3 .ebook-grid-item,
    .ebook-grid-columns-4 .ebook-grid-item {
        width: 100%;
    }
    
    .ebook-form-popup {
        padding: 20px;
    }
}
