/* Post to Image Generator Styles - Premium Vanilla Edition */

/* ------------- Variables & Reset ------------- */
:root {
    --pti-primary: #3b82f6;
    --pti-primary-hover: #2563eb;
    --pti-bg-light: #f8fafc;
    --pti-surface: #ffffff;
    --pti-text-main: #1e293b;
    --pti-text-muted: #64748b;
    --pti-border: #e2e8f0;
    --pti-shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --pti-shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --pti-shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --pti-shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    --pti-radius-md: 0.5rem;
    --pti-radius-lg: 0.75rem;
    --pti-radius-full: 9999px;
    --pti-transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ------------- Generate Button (WordPress post page) ------------- */
#pti-generate {
    background: linear-gradient(135deg, #6366f1 0%, #a855f7 100%);
    color: white;
    border: none;
    padding: 12px 28px;
    font-size: 16px;
    font-weight: 600;
    border-radius: var(--pti-radius-full);
    cursor: pointer;
    box-shadow: 0 4px 14px 0 rgba(99, 102, 241, 0.39);
    transition: var(--pti-transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    letter-spacing: 0.5px;
    margin: 20px 0;
}

#pti-generate:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.45);
}

#pti-generate:active {
    transform: translateY(0);
}

/* ------------- Off-screen Canvas Target ------------- */
#pti-content {
    position: fixed;
    left: -9999px;
    top: 0;
    width: 1200px !important;
    max-width: none !important; /* Force full width so columns render correctly on mobile */
    background: #f1f2f6; /* Soft modern gray backdrop */
    padding: 40px;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: var(--pti-text-main);
    box-sizing: border-box;
}

.pti-site-name {
    text-align: center;
    font-weight: 700;
    margin-bottom: 15px;
    font-size: 18px;
    color: #0f172a;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.pti-inner-border {
    border: 6px solid var(--pti-border-color, #0f172a);
    background: #ffffff;
    padding: 50px 60px;
    box-sizing: border-box;
    box-shadow: var(--pti-shadow-md);
    border-radius: 8px; /* Elegant border rounding */
}

.pti-logo {
    text-align: center;
    margin-bottom: 25px;
}

.pti-logo img {
    max-height: 90px;
    width: auto;
    display: inline-block;
}

.pti-logo h1 {
    font-size: 36px;
    margin: 0;
    color: #0f172a;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.pti-meta {
    background-color: var(--pti-border-color, #0f172a);
    color: #ffffff;
    padding: 14px 25px;
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 35px;
    border-radius: 6px;
    letter-spacing: 0.5px;
}

.pti-title {
    font-family: 'Ramabhadra', sans-serif;
    font-weight: bold;
    font-size: 38px;
    line-height: 1.3;
    margin: 0 0 30px 0;
    color: #e11d48; /* Premium vibrant red */
    text-align: center;
}

.pti-body-container {
    display: flex;
    flex-direction: column;
}

.pti-body-text {
    font-family: 'Mandali', sans-serif;
    font-weight: 400; /* Balanced weight for readability */
    font-size: 16px;
    line-height: 1.8;
    color: #334155;
    column-count: 3;
    column-gap: 40px;
    text-align: justify;
}

.pti-featured-image {
    margin-bottom: 35px;
    text-align: center;
}

.pti-featured-image img {
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: var(--pti-radius-lg);
    box-shadow: var(--pti-shadow-md);
}

.pti-footer {
    margin-top: 50px;
    border-top: 2px solid var(--pti-border);
    padding-top: 25px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--pti-text-muted);
}

.pti-dots {
    display: flex;
    gap: 8px;
}

.pti-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.15); /* More depth */
}

.pti-dot-cyan { background-color: #06b6d4; }
.pti-dot-pink { background-color: #ec4899; }
.pti-dot-yellow { background-color: #eab308; }
.pti-dot-black { background-color: #0f172a; }


/* ------------- Modal & UI Overlay ------------- */
#pti-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.75); /* Dark cinematic overlay */
    backdrop-filter: blur(12px); /* Premium Glassmorphism */
    -webkit-backdrop-filter: blur(12px);
    z-index: 999999;
    flex-direction: column;
    opacity: 0;
    animation: ptiFadeIn 0.3s forwards cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes ptiFadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.pti-modal-content {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    position: relative;
}

.pti-close {
    position: absolute;
    top: 25px;
    right: 35px;
    cursor: pointer;
    font-size: 44px;
    color: white;
    font-weight: 200;
    z-index: 100000;
    line-height: 1;
    transition: var(--pti-transition);
    text-shadow: 0 4px 6px rgba(0,0,0,0.3);
}

.pti-close:hover {
    color: #f87171; /* Soft destructive red */
    transform: scale(1.1) rotate(90deg);
}

.pti-scroll-container {
    flex: 1;
    overflow-y: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 60px 30px;
}

/* Premium Scrollbar */
.pti-scroll-container::-webkit-scrollbar {
    width: 8px;
}
.pti-scroll-container::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03); 
}
.pti-scroll-container::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2); 
    border-radius: 10px;
}
.pti-scroll-container::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.4); 
}

#pti-canvas {
    max-width: 100%;
    height: auto;
    display: block;
    box-shadow: var(--pti-shadow-xl);
    border-radius: 2px; /* Small radius for an image */
    animation: ptiSlideUp 0.5s forwards cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(30px) scale(0.98);
    opacity: 0;
}

@keyframes ptiSlideUp {
    to {
        transform: translateY(0) scale(1);
        opacity: 1;
    }
}

/* ------------- Toolbar ------------- */
.pti-toolbar {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 24px 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 16px;
    border-top: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 -10px 30px rgba(0,0,0,0.05);
}

/* Unified Premium Buttons */
.pti-btn {
    border: none;
    padding: 12px 28px;
    border-radius: var(--pti-radius-full); /* Pill shape is very modern */
    font-weight: 600;
    cursor: pointer;
    color: white;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-size: 14px;
    text-decoration: none;
    font-family: system-ui, -apple-system, sans-serif;
    transition: var(--pti-transition);
    box-shadow: var(--pti-shadow-sm);
    letter-spacing: 0.5px;
}

.pti-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--pti-shadow-md);
    color: white; /* Maintain white color on hover for a tag */
}

.pti-btn:active {
    transform: translateY(-1px);
    box-shadow: var(--pti-shadow-sm);
}

/* Custom button styles */
#pti-column-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 18px;
    cursor: pointer;
    outline: none;
    min-width: 150px;
    background-color: var(--pti-surface);
    color: var(--pti-text-main);
    border: 1px solid var(--pti-border);
}

#pti-column-select:hover {
    border-color: #cbd5e1;
    background-color: #f1f5f9;
}

#pti-column-select:focus {
    border-color: var(--pti-primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.pti-btn-cyan {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    box-shadow: 0 4px 10px rgba(14, 165, 233, 0.3);
}
.pti-btn-cyan:hover { box-shadow: 0 6px 15px rgba(14, 165, 233, 0.4); }

.pti-btn-green {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    box-shadow: 0 4px 10px rgba(16, 185, 129, 0.3);
}
.pti-btn-green:hover { box-shadow: 0 6px 15px rgba(16, 185, 129, 0.4); }

.pti-btn-orange {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 4px 10px rgba(245, 158, 11, 0.3);
}
.pti-btn-orange:hover { box-shadow: 0 6px 15px rgba(245, 158, 11, 0.4); }


/* ------------- Responsive Overrides ------------- */
@media (max-width: 768px) {
    /* We don't override pti-content or its children because the final image should look identical regardless of device generated on */
    .pti-toolbar {
        padding: 20px;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .pti-scroll-container {
        padding: 40px 15px;
    }

    .pti-btn {
        padding: 12px 10px;
        font-size: 13px;
        width: 100%;
        box-sizing: border-box;
    }

    .pti-close {
        top: 20px;
        right: 20px;
        font-size: 40px;
        text-shadow: 0 4px 15px rgba(0,0,0,0.6); 
    }
}