/* InstaPost - Custom Styles */

/* Quote Preview Container */
.quote-preview-container {
    width: 100%;
    padding-bottom: 100%; /* Default 1:1 aspect ratio */
    position: relative;
    margin: 0 auto;
    max-width: 400px;
    overflow: hidden;
}

/* Quote Preview */
.quote-preview {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    text-align: center;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

/* Quote Content */
.quote-content {
    position: relative;
    z-index: 2;
    max-width: 90%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    width: 100%;
}

/* Quote Text */
.quote-text {
    font-family: 'Playfair Display', serif;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.4;
    margin-bottom: 1rem;
    color: #333;
}

/* Quote Author */
.quote-author {
    font-family: 'Playfair Display', serif;
    font-size: 1rem;
    font-style: italic;
    color: #555;
}

/* Quotation Marks */
.quote-text.with-quotation-marks::before,
.quote-text.with-quotation-marks::after {
    content: '"';
    font-size: 3rem;
    line-height: 0;
    position: relative;
    color: rgba(0, 0, 0, 0.2);
}

.quote-text.with-quotation-marks::before {
    top: 0.5rem;
    left: -0.5rem;
}

.quote-text.with-quotation-marks::after {
    bottom: -0.5rem;
    right: -0.5rem;
}

/* Text Shadow Effect */
.quote-text.with-shadow,
.quote-author.with-shadow {
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}

/* Overlay Effect */
.quote-preview.with-overlay::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.3);
    z-index: 1;
}

/* Color Themes */
.quote-preview.light {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}
.quote-preview.light .quote-text { color: #333; }
.quote-preview.light .quote-author { color: #555; }

.quote-preview.dark {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
}
.quote-preview.dark .quote-text { color: #fff; }
.quote-preview.dark .quote-author { color: #ddd; }

.quote-preview.blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}
.quote-preview.blue .quote-text { color: #fff; }
.quote-preview.blue .quote-author { color: #f0f0f0; }

.quote-preview.green {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}
.quote-preview.green .quote-text { color: #333; }
.quote-preview.green .quote-author { color: #444; }

.quote-preview.purple {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}
.quote-preview.purple .quote-text { color: #333; }
.quote-preview.purple .quote-author { color: #555; }

/* Background Gradients */
.quote-preview.gradient-1 {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.quote-preview.gradient-2 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
}

.quote-preview.gradient-3 {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

.quote-preview.gradient-4 {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
}

/* Background Patterns */
.quote-preview.pattern-1 {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg width='20' height='20' viewBox='0 0 20 20' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.05' fill-rule='evenodd'%3E%3Ccircle cx='3' cy='3' r='3'/%3E%3Ccircle cx='13' cy='13' r='3'/%3E%3C/g%3E%3C/svg%3E");
}

.quote-preview.pattern-2 {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg width='40' height='40' viewBox='0 0 40 40' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='%23000000' fill-opacity='0.05' fill-rule='evenodd'%3E%3Cpath d='M0 40L40 0H20L0 20M40 40V20L20 40'/%3E%3C/g%3E%3C/svg%3E");
}

.quote-preview.pattern-3 {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23000000' fill-opacity='0.05'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.quote-preview.pattern-4 {
    background-color: #ffffff;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23000000' fill-opacity='0.05' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
}

/* Nature Backgrounds */
.quote-preview.nature-1 {
    background-image: url('https://source.unsplash.com/featured/?nature,mountains');
    background-size: cover;
    background-position: center;
}

.quote-preview.nature-2 {
    background-image: url('https://source.unsplash.com/featured/?nature,ocean');
    background-size: cover;
    background-position: center;
}

.quote-preview.nature-3 {
    background-image: url('https://source.unsplash.com/featured/?nature,forest');
    background-size: cover;
    background-position: center;
}

.quote-preview.nature-4 {
    background-image: url('https://source.unsplash.com/featured/?nature,sunset');
    background-size: cover;
    background-position: center;
}

/* Abstract Backgrounds */
.quote-preview.abstract-1 {
    background-image: url('https://source.unsplash.com/featured/?abstract,art');
    background-size: cover;
    background-position: center;
}

.quote-preview.abstract-2 {
    background-image: url('https://source.unsplash.com/featured/?abstract,paint');
    background-size: cover;
    background-position: center;
}

.quote-preview.abstract-3 {
    background-image: url('https://source.unsplash.com/featured/?abstract,texture');
    background-size: cover;
    background-position: center;
}

.quote-preview.abstract-4 {
    background-image: url('https://source.unsplash.com/featured/?abstract,colors');
    background-size: cover;
    background-position: center;
}

/* Minimal Backgrounds */
.quote-preview.minimal-1 {
    background-color: #ffffff;
}

.quote-preview.minimal-2 {
    background-color: #f8f9fa;
}

.quote-preview.minimal-3 {
    background-color: #212529;
}

.quote-preview.minimal-4 {
    background-color: #343a40;
}

/* Image Size Aspect Ratios */
.quote-preview-container.square {
    padding-bottom: 100%; /* 1:1 */
}

.quote-preview-container.portrait {
    padding-bottom: 125%; /* 4:5 */
}

.quote-preview-container.landscape {
    padding-bottom: 56.25%; /* 16:9 */
}

.quote-preview-container.facebook {
    padding-bottom: 37%; /* 851:315 */
}

/* Color Swatches */
.color-selector, .background-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.color-swatch, .bg-swatch {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
    border: 2px solid transparent;
    transition: all 0.3s ease;
}

.color-swatch:hover, .bg-swatch:hover,
input:checked + .color-swatch, input:checked + .bg-swatch {
    transform: scale(1.1);
    border-color: var(--primary-color);
}

.color-swatch.light {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.color-swatch.dark {
    background: linear-gradient(135deg, #2c3e50 0%, #1a1a2e 100%);
}

.color-swatch.blue {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.color-swatch.green {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

.color-swatch.purple {
    background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%);
}

/* Background Swatches */
.bg-swatch.gradient-1 {
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}

.bg-swatch.gradient-2 {
    background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%);
}

.bg-swatch.gradient-3 {
    background: linear-gradient(135deg, #a1c4fd 0%, #c2e9fb 100%);
}

.bg-swatch.gradient-4 {
    background: linear-gradient(135deg, #d4fc79 0%, #96e6a1 100%);
}

/* Popular Quotes */
.popular-quote {
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
    height: 100%;
}

.popular-quote:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.popular-quote-text {
    font-style: italic;
    margin-bottom: 0.5rem;
}

.popular-quote-author {
    font-weight: bold;
    color: #666;
}

/* Form Elements */
.form-check-inline {
    margin-right: 0.75rem;
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .quote-text {
        font-size: 1.2rem;
    }
    
    .quote-author {
        font-size: 0.9rem;
    }
    
    .quote-preview-container {
        max-width: 300px;
    }
}

/* Animation */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.quote-preview {
    animation: fadeIn 0.5s ease-out forwards;
}

/* Loading Spinner */
.loading-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
}

.loading-spinner.active {
    display: block;
}

/* Share Buttons */
.share-buttons {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}

.share-buttons button {
    min-width: 120px;
}

/* Comments Section */
.comments-section {
    margin-top: 3rem;
}

.comment {
    padding: 1rem;
    border-bottom: 1px solid #eee;
    margin-bottom: 1rem;
}

.comment-header {
    margin-bottom: 0.5rem;
}

/* Font Selector */
.font-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

/* Download Button Animation */
@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(var(--bs-success-rgb), 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(var(--bs-success-rgb), 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(var(--bs-success-rgb), 0);
    }
}

#downloadBtn {
    animation: pulse 2s infinite;
}

/* Tool Container */
.tool-container {
    margin-bottom: 2rem;
}

.tool-title {
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.tool-description {
    margin-bottom: 2rem;
    font-size: 1.1rem;
    color: #666;
}

/* Ad Containers */
.ad-container {
    position: relative;
    background-color: #f8f9fa;
    border-radius: 4px;
    overflow: hidden;
}

.ad-label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 2px 5px;
    background-color: rgba(0, 0, 0, 0.1);
    color: #666;
    font-size: 10px;
    z-index: 1;
}

.ad-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #aaa;
    font-size: 12px;
}

/* Button Styles */
#getRandomQuoteBtn {
    transition: all 0.3s ease;
    font-weight: 500;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

#getRandomQuoteBtn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

#getRandomQuoteBtn:active {
    transform: translateY(1px);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

#getRandomQuoteBtn .fa-sync-alt {
    transition: transform 0.3s ease;
}

#getRandomQuoteBtn:hover .fa-sync-alt {
    transform: rotate(180deg);
}
