/* Christmas Card Creator Styles */
/* Prefix all selectors with .cc-container to avoid conflicts with WordPress themes */

.cc-container {
    font-family: 'Poppins', sans-serif;
    color: #343a40;
    line-height: 1.6;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    position: relative;
}

/* Snowflakes Animation */
.cc-snowflakes {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.cc-snowflake {
    color: #ffffff;
    font-size: 1em;
    font-family: Arial, sans-serif;
    text-shadow: 0 0 5px rgba(0, 0, 0, 0.3);
    position: absolute;
    top: -10%;
    z-index: 9999;
    user-select: none;
    pointer-events: none;
    animation-name: cc-snowflake-fall, cc-snowflake-shake;
    animation-duration: 10s, 3s;
    animation-timing-function: linear, ease-in-out;
    animation-iteration-count: infinite, infinite;
    animation-play-state: running, running;
}

@keyframes cc-snowflake-fall {
    0% {
        top: -10%;
    }
    100% {
        top: 100%;
    }
}

@keyframes cc-snowflake-shake {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(80px);
    }
}

/* Header Styles */
.cc-header {
    background-color: #c1272d;
    color: #ffffff;
    text-align: center;
    padding: 2rem 1rem;
    position: relative;
    border-bottom: 5px solid #d4af37;
    border-radius: 10px 10px 0 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.cc-header h2 {
    font-family: 'Mountains of Christmas', cursive, serif;
    font-size: 2.5rem;
    margin-bottom: 0.5rem;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.3);
    color: #ffffff;
}

.cc-header p {
    font-size: 1.1rem;
    max-width: 600px;
    margin: 0 auto;
}

.cc-ornament {
    position: absolute;
    width: 60px;
    height: 60px;
    background-size: contain;
    background-repeat: no-repeat;
    top: 50%;
    transform: translateY(-50%);
}

.cc-ornament.left {
    left: 5%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="%23d4af37"/><circle cx="50" cy="50" r="35" fill="%23c1272d"/><path d="M50,10 L50,90 M10,50 L90,50" stroke="%23d4af37" stroke-width="5"/></svg>');
}

.cc-ornament.right {
    right: 5%;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><circle cx="50" cy="50" r="40" fill="%23d4af37"/><circle cx="50" cy="50" r="35" fill="%230f5132"/><path d="M50,10 L50,90 M10,50 L90,50" stroke="%23d4af37" stroke-width="5"/></svg>');
}

/* Main Container Layout */
.cc-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 2rem;
}

.cc-section {
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 1 1.5rem;
    position: relative;
    flex: 1;
    min-width: 300px;
}

.cc-section h3 {
    color: #0f5132;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    border-bottom: 2px solid #d4af37;
    padding-bottom: 0.5rem;
}

/* Image Upload Section */
.cc-image-options {
    display: flex;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.cc-file-upload, .cc-camera-button {
    display: inline-block;
    padding: 0.75rem 1.5rem;
    cursor: pointer;
    background-color: #0f5132;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    font-weight: 500;
    transition: all 0.3s ease;
    text-align: center;
    font-size: 1rem;
    line-height: 1.5;
}

.cc-file-upload:hover, .cc-camera-button:hover {
    background-color: #0c3f26;
    transform: translateY(-2px);
}

.cc-file-input {
    display: none;
}

.cc-preview-container {
    width: 100%;
    height: 250px;
    border: 2px dashed #d4af37;
    border-radius: 5px;
    overflow: hidden;
    position: relative;
    background-color: #f0f0f0;
}

.cc-image-preview, .cc-camera-preview {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.cc-no-image {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #aaa;
    font-style: italic;
}

.cc-camera-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: none;
}

.cc-capture-button, .cc-camera-close {
    position: absolute;
    bottom: 10px;
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
    z-index: 10;
}

.cc-capture-button {
    left: 10px;
    background-color: #c1272d;
    color: #ffffff;
}

.cc-camera-close {
    right: 10px;
    background-color: #6c757d;
    color: #ffffff;
}

/* Card Preview Section */
.cc-card-preview {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    min-height: 300px;
}

.cc-card-frame {
    width: 100%;
    max-width: 350px;
    aspect-ratio: 7/5;
    border: 10px solid #d4af37;
    border-radius: 10px;
    overflow: hidden;
    position: relative;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.cc-card-image-container {
    width: 100%;
    height: 100%;
    position: relative;
}

.cc-card-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cc-card-text-container {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.5);
    color: #ffffff;
    text-align: center;
}

.cc-card-text-preview {
    margin: 0;
    font-family: 'Mountains of Christmas', cursive, serif;
    font-size: 24px;
    word-wrap: break-word;
}

/* Text Customization Section */
.cc-text-options {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cc-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.cc-label {
    font-weight: 500;
    color: #0f5132;
}

.cc-textarea, .cc-select {
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: inherit;
    resize: vertical;
    width: 100%;
}

.cc-color-picker {
    width: 100%;
    height: 40px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.cc-range {
    width: 100%;
}

.cc-size-value {
    display: inline-block;
    min-width: 40px;
    text-align: right;
}

/* Submit Section */
.cc-submit-section {
    text-align: center;
    margin: 2rem 0;
}

.cc-generate-button {
    padding: 1rem 2rem;
    font-size: 1.2rem;
    background-color: #c1272d;
    color: #ffffff;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.cc-generate-button:hover {
    background-color: #a11d23;
    transform: translateY(-3px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

.cc-loading {
    margin-top: 1rem;
    display: none;
}

.cc-spinner {
    width: 40px;
    height: 40px;
    margin: 0 auto;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-radius: 50%;
    border-top-color: #c1272d;
    animation: cc-spin 1s ease-in-out infinite;
}

@keyframes cc-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Modal Styles */
.cc-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    z-index: 1000;
    overflow: auto;
}

.cc-modal-content {
    background-color: #ffffff;
    margin: 5% auto;
    padding: 2rem;
    width: 80%;
    max-width: 800px;
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
    position: relative;
}

.cc-close-button {
    position: absolute;
    top: 10px;
    right: 20px;
    font-size: 2rem;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    line-height: 1;
}

.cc-close-button:hover {
    color: #343a40;
}

.cc-final-card-container {
    width: 100%;
    margin: 2rem 0;
    ;
}

.cc-final-card {
    max-width: 100%;
    max-height: 70vh;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    border: 10px solid #d4af37;
    border-radius: 10px;
}

.cc-modal-buttons {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1.5rem;
    flex-wrap: wrap;
}

.cc-modal-buttons button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-weight: 500;
}

.cc-download-button {
    background-color: #0f5132;
    color: #ffffff;
}

.cc-create-new {
    background-color: #c1272d;
    color: #ffffff;
}

/* Font Loading */
@font-face {
    font-family: 'Mountains of Christmas';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/mountainsofchristmas/v20/3y9w6a4zcCnn5X0FDyrKi2ZRUBIy8uxoUo7NGsMQ.woff2) format('woff2');
    font-display: swap;
}

@font-face {
    font-family: 'Poppins';
    font-style: normal;
    font-weight: 400;
    src: url(https://fonts.gstatic.com/s/poppins/v20/pxiEyp8kv8JHgFVrJJfecg.woff2) format('woff2');
    font-display: swap;
}

/* Responsive Design */
@media (max-width: 768px) {
    .cc-grid {
        flex-direction: column;
    }
    
    .cc-header h2 {
        font-size: 2rem;
    }
    
    .cc-ornament {
        display: none;
    }
    
    .cc-image-options {
        flex-direction: column;
    }
    
    .cc-file-upload, .cc-camera-button {
        width: 100%;
    }
    
    .cc-modal-content {
        width: 95%;
        padding: 1rem;
    }
    
    .cc-modal-buttons {
        flex-direction: column;
    }
    
    .cc-modal-buttons button {
        width: 100%;
    }
}

/* WordPress-specific compatibility fixes */
.cc-container input[type="range"] {
    background: transparent;
}

.cc-container button, 
.cc-container input[type="button"] {
    box-shadow: none;
    text-shadow: none;
}

.cc-container button:hover, 
.cc-container input[type="button"]:hover {
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.3);
}

/* Fix for themes that might override our styles */
.cc-container .cc-section h3 {
    margin: 0 0 1.5rem 0;
    padding: 0 0 0.5rem 0;
    background: none;
}

.cc-container .cc-card-text-preview {
    line-height: 1.3;
}

/* Fix for WordPress admin bar overlap */
body.admin-bar .cc-modal {
    top: 32px;
    height: calc(100% - 32px);
}

@media screen and (max-width: 782px) {
    body.admin-bar .cc-modal {
        top: 46px;
        height: calc(100% - 46px);
    }
}