/**
 * Examples Block Plugin - CSS
 * This file handles styling for CV Examples, Cover Letter Examples, and their batch creators
 */

/* =============================================================================
   COMMON STYLES
   ============================================================================= */

/* Main wrappers */
.cv-examples-wrapper,
.cover-letter-examples-wrapper {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen-Sans, Ubuntu, Cantarell, 'Helvetica Neue', sans-serif;
}

/* Section styling */
.cv-example-section,
.cover-letter-example-section {
    box-shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    overflow: hidden;
    background-color: #fff;
    border-radius: 8px;
}

.cv-example-section:hover,
.cover-letter-example-section:hover {
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transform: translateY(-3px);
}

/* Title styling */
.cv-example-title,
.cover-letter-example-title {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 24px;
    font-weight: 600; 
    padding-bottom: 10px;
}

/* Image containers */
.cv-example-image,
.cover-letter-example-image {
    margin-bottom: 15px;
    position: relative;
    border-radius: 4px;
    overflow: hidden;	
    max-height: 934px;
}

.cv-example-image img,
.cover-letter-example-image img {
    width: 100%;
    height: auto;
    display: block;
    max-width: 100%;
    transition: all 0.3s ease;
}

/* Hover overlay for images */
.cv-example-image::after,
.cover-letter-example-image::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.cv-example-image:hover::after,
.cover-letter-example-image:hover::after {
    opacity: 1;
}

/* Hover buttons on images */
.cv-example-image-button-overlay,
.cover-letter-example-image-button-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.cv-example-image:hover .cv-example-image-button-overlay,
.cover-letter-example-image:hover .cover-letter-example-image-button-overlay {
    opacity: 1;
    pointer-events: auto;
}

.cv-example-image-button,
.cover-letter-example-image-button {
    background-color: #ff9900;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s ease;
    text-align: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.cv-example-image-button:hover,
.cover-letter-example-image-button:hover {
    background-color: #ff8800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Image upload buttons in editor */
.cv-example-image-button,
.cover-letter-example-image-button {
	width: 100%;
    padding: 10px 30px !important;
    text-align: center;
    margin-bottom: 15px;
}

.cv-example-change-image,
.cover-letter-example-change-image {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background-color: rgba(0, 0, 0, 0.7) !important;
    color: white !important;
    padding: 8px 12px !important;
    border-radius: 4px;
    font-size: 12px;
}

/* Subtitle styling */
.cv-example-subtitle,
.cover-letter-example-subtitle {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 500;
    color: #444;
}

/* Description styling */
.cv-example-description,
.cover-letter-example-description {
    margin-bottom: 15px;
    line-height: 1.6;
}

/* Link/button styling */
.cv-example-button,
.cover-letter-example-button {
	transition: all 0.3s ease;
    font-weight: 500;
    cursor: pointer;
    text-align: center;
    display: inline-block;
    padding: 14px 40px;
    text-decoration: none;
    margin-top: 10px;
    background: #fcb900 !important;
    color: #000 !important;
	font-size:18px !important;
    border-radius:32px !important;	
}

.cv-example-button:hover,
.cover-letter-example-button:hover {
    opacity: 0.9;
    transform: translateY(-2px);
    box-shadow: 0px 3px 2px rgba(0, 0, 0, .15);
}

.cv-example-image-button,
.cover-letter-example-image-button {
	background: #fcb900 !important;
    color: #000 !important;
}

/* Add section buttons */
.cv-example-add-section,
.cover-letter-example-add-section {
    margin-bottom: 20px;
    width: 100%;
    justify-content: center;
    padding: 15px !important;
    background-color: #f0f0f0 !important;
    border: 2px dashed #ccc !important;
}

.cv-example-add-section:hover,
.cover-letter-example-add-section:hover {
    background-color: #e5e5e5 !important;
}

/* Remove section buttons */
.cv-example-remove-section,
.cover-letter-example-remove-section {
    margin-top: 15px;
    font-size: 12px !important;
}

/* Link containers in editor */
.cv-example-link-container,
.cover-letter-example-link-container {
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Editor-specific styles */
.cv-examples-block-editor .cv-example-url-input,
.cover-letter-examples-block-editor .cover-letter-example-url-input {
    margin-top: 8px;
}

/* Link sections */
.cv-link-section,
.cover-letter-link-section {
    text-align: center;
    margin-bottom: 30px;
}

/* Section overrides for editor */
.cv-example-section,
.cover-letter-example-section {
    background-color: #f0f4f7 !important;
    border: 2px solid #f0f4f7;
    box-shadow: none;
}

h3.cv-example-title,
h3.cover-letter-example-title {
    font-size: 25px !important;
    font-weight: 800;
    text-align: center;
}

.cv-example-image,
.cover-letter-example-image {
    margin-bottom: 25px;
}

.cv-example-description p,
.cover-letter-example-description p {
    margin: 0;
}

/* =============================================================================
   BATCH CREATOR STYLES
   ============================================================================= */

.cv-examples-batch-creator,
.cover-letter-examples-batch-creator {
    margin: 20px 0;
}

.cv-examples-batch-titles,
.cover-letter-examples-batch-titles {
    width: 100%;
    margin-bottom: 20px;
}

.cv-examples-batch-actions,
.cover-letter-examples-batch-actions {
    margin-top: 15px;
    display: flex;
    justify-content: flex-end;
}

.cv-examples-batch-loading,
.cover-letter-examples-batch-loading {
    display: flex;
    align-items: center;
}

.cv-examples-batch-loading .components-spinner,
.cover-letter-examples-batch-loading .components-spinner {
    margin-right: 10px;
}

.wp-block-custom-cv-examples-batch-creator .components-placeholder__fieldset,
.wp-block-custom-cover-letter-examples-batch-creator .components-placeholder__fieldset {
    max-width: 100%;
}

.wp-block-custom-cv-examples-batch-creator .components-placeholder__label,
.wp-block-custom-cover-letter-examples-batch-creator .components-placeholder__label {
    display: flex;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

.wp-block-custom-cv-examples-batch-creator .components-placeholder__label svg,
.wp-block-custom-cover-letter-examples-batch-creator .components-placeholder__label svg {
    margin-right: 10px;
}

.wp-block-custom-cv-examples-batch-creator .components-notice,
.wp-block-custom-cover-letter-examples-batch-creator .components-notice {
    margin-left: 0;
    margin-right: 0;
    margin-bottom: 15px;
}

/* Make text areas higher priority */
.cv-examples-batch-titles textarea,
.cover-letter-examples-batch-titles textarea {
    min-height: 150px !important;
    font-family: monospace;
    padding: 10px;
}

.cv-examples-batch-instructions,
.cover-letter-examples-batch-instructions {
    font-style: italic;
    color: #757575;
    margin-bottom: 15px;
}

.wp-block-custom-cv-examples-batch-creator .components-placeholder__instructions,
.wp-block-custom-cover-letter-examples-batch-creator .components-placeholder__instructions {
    margin-bottom: 20px;
    color: #555;
}

/* =============================================================================
   CATEGORY-SPECIFIC STYLES
   ============================================================================= */

.category-cv-examples .post-featured-image,
.category-cover-letter-examples .post-featured-image {
    border-radius: 15px;
    border: 0px solid #fbfbfb;
    border-bottom: 12px solid #fcb900;
}

.single-post #content .category-cv-examples .post-featured-image,
.single-post #content .category-cover-letter-examples .post-featured-image {
    max-height: 480px !important;
    background: #fcb900;
    padding: 50px;
}

#content .category-cv-examples .post-featured-image img,
#content .category-cover-letter-examples .post-featured-image img {
    display: block;
    margin: 0 auto;
    min-width: 100%;
    height: auto;
    box-shadow: 2px 2px 2px #22222263;
    transform: rotate(355deg);
}

/* =============================================================================
   EDITOR OVERRIDES
   ============================================================================= */

.block-editor__container img { 
    width: 200px !important;
}

#content .post-text figure img {
    margin-bottom: 30px;
    box-shadow: 0 .2rem 1rem rgb(101 100 107 / 25%) !important;
    border-radius: 15px;
    max-height: 900px;
}

a.cv-example-create-button.components-button.is-primary,
a.cover-letter-example-create-button.components-button.is-primary {
    background: blue !important;
    color: #fff !important;
}

/* =============================================================================
   RESPONSIVE STYLES
   ============================================================================= */

@media screen and (min-width: 768px) {
    .cv-example-section,
    .cover-letter-example-section {
        /* display: grid; */
        grid-template-columns: 1fr 2fr;
        grid-gap: 25px;
    }
    
    .cv-example-title,
    .cover-letter-example-title {
        grid-column: 1 / 3;
    }
    
    .cv-example-image,
    .cover-letter-example-image {
        grid-column: 1;
        grid-row: 2 / 5;
        min-height: 300px;
    }
    
    .cv-example-subtitle,
    .cover-letter-example-subtitle {
        grid-column: 2;
        grid-row: 2;
    }
    
    .cv-example-description,
    .cover-letter-example-description {
        grid-column: 2;
        grid-row: 3;
    }
}

@media screen and (max-width: 767px) {
    .cv-example-title,
    .cv-example-image,
    .cv-example-subtitle,
    .cv-example-description,
    .cover-letter-example-title,
    .cover-letter-example-image,
    .cover-letter-example-subtitle,
    .cover-letter-example-description {
        margin-bottom: 15px;
    }
}