/* ================================== */
/* 1. Styles for Mobile Clip Button */
/* (On the single post page)      */
/* ================================== */

.cm-button-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin: 20px 0;
}

/* Modernized button style */
.cm-view-mobile-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #0052b3, #003366);
    color: #ffffff !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none !important;
    padding: 12px 24px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 66, 130, 0.2);
    transition: all 0.2s ease-out;
}
.cm-view-mobile-btn:hover {
    background: linear-gradient(135deg, #005fcf, #004080);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 66, 130, 0.3);
}


/* ================================== */
/* 2. Styles for Mobile Clip Page */
/* (The /mclip/ page UI)          */
/* ================================== */

/* --- Base & Layout --- */

body.cm-mobile-clip-page {
    background-color: #f0f2f5; /* Light, modern background */
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    box-sizing: border-box;
}

/* New page container for layout */
.cm-mclip-page-container {
    width: 100%;
    max-width: 1600px;
    margin: 0 auto;
}

/* New main content wrapper for flex layout */
.cm-mclip-main-content {
    display: flex;
    flex-direction: column; /* Mobile-first: stacked */
    align-items: center;
    width: 100%;
    padding: 20px;
    gap: 30px;
    box-sizing: border-box;
}

/* --- Header --- */

.cm-mclip-header {
    background-color: #ffffff;
    padding: 15px 20px;
    text-align: left;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    position: sticky; /* Sticky is cleaner than fixed */
    top: 0;
    width: 100%;
    z-index: 1000;
    box-sizing: border-box;
}
.cm-mclip-header .cm-mclip-home-link {
    font-size: 18px;
    font-weight: 600;
    color: #222;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 8px;
}
.cm-mclip-header .cm-mclip-home-link:hover {
    color: #004a99;
}

/* --- Preview Wrapper --- */

.cm-mclip-wrapper {
    width: 100%;
    max-width: 480px; /* Max width on mobile */
    margin: 0;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    border-radius: 16px;
    overflow: hidden; /* Clips the scaled content */
    background-color: #fff; /* Background for the container */
    
    /* == NEW == Ensures it appears below scaled content */
    position: relative; 
    z-index: 10; 
}

/* --- UI Controls Wrapper --- */

.cm-mclip-ui-wrapper {
    display: block;
    width: 100%;
    max-width: 480px; /* Max width on mobile */
    background: #ffffff;
    margin: 0; /* Handled by flex gap */
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding: 20px;
    box-sizing: border-box;
}

/* --- "Read Full Article" Button --- */

.cm-mclip-redirect-btn {
    display: block;
    background: linear-gradient(135deg, #107E3A, #0c5a2a);
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 700;
    font-size: 18px;
    text-align: center;
    padding: 18px 20px;
    margin: 0; /* Use padding on parent */
    border-radius: 12px;
    transition: all 0.2s ease-out;
    box-shadow: 0 4px 15px rgba(16, 126, 58, 0.3);
}
.cm-mclip-redirect-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 126, 58, 0.4);
}

/* --- Share Section & Buttons --- */

.cm-mclip-share-section {
    padding: 25px 0 0 0; /* Added padding-top */
}

/* Primary Share Buttons Container */
.cm-mclip-primary-share {
    display: flex;
    flex-direction: column; /* Stack buttons vertically */
    gap: 12px;
    margin-bottom: 25px;
}

/* Base Share Button Style (Sizing) */
.cm-mclip-share-btn {
    flex: 1; 
    padding: 18px 20px; /* Matched redirect-btn */
    font-size: 18px; /* Matched redirect-btn */
    font-weight: 700; /* Matched redirect-btn */
    border: 2px solid transparent; /* Base border for all */
    border-radius: 12px; /* Matched redirect-btn */
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s ease;
    white-space: nowrap;
}
.cm-mclip-share-btn:disabled {
    opacity: 0.6;
    cursor: wait;
    transform: none;
    box-shadow: none;
}
.cm-mclip-share-btn i {
    font-size: 16px;
}

/* == CHANGE 3: "Share Image" - Primary Button (Color) == */
.cm-mclip-share-btn.primary {
    background: linear-gradient(135deg, #007bff, #0056b3); /* New Blue Color */
    border-color: transparent; /* Remove border */
    color: #ffffff;
}
.cm-mclip-share-btn.primary i {
    color: #ffffff;
}
.cm-mclip-share-btn.primary:not(:disabled):hover {
    background: linear-gradient(135deg, #0088ff, #0062cc); /* Corresponding hover */
    border-color: transparent;
    transform: translateY(-1px);
}

/* "Download" - Secondary Button (Outline) */
.cm-mclip-share-btn.secondary {
    background-color: transparent;
    border-color: #e0e0e0;
    color: #106634;
}
.cm-mclip-share-btn.secondary i {
    color: #106634;
}
.cm-mclip-share-btn.secondary:not(:disabled):hover {
    background-color: #f5f5f5;
    border-color: #106634;
}

/* "Share Link" - Tertiary Button (Subtle) */
.cm-mclip-share-btn.tertiary {
    background-color: #f0f2f5;
    border-color: #f0f2f5;
    color: #333;
}
.cm-mclip-share-btn.tertiary i {
    color: #106634;
}
.cm-mclip-share-btn.tertiary:not(:disabled):hover {
    background-color: #e4e6e9;
    border-color: #e4e6e9;
}


/* --- Social Icons --- */

.cm-mclip-share-title {
    font-size: 14px;
    font-weight: 600;
    color: #aaa; /* Lighter color */
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-top: 30px; /* More space */
    margin-bottom: 15px;
}

.cm-mclip-share-icons {
    display: flex;
    justify-content: space-around;
    align-items: center;
}

.cm-mclip-icon-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px; /* Slightly larger */
    height: 48px; /* Slightly larger */
    border-radius: 50%;
    font-size: 24px; /* Larger icon */
    text-decoration: none;
    color: #fff;
    transition: all 0.2s ease-out;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.cm-mclip-icon-btn:hover {
    transform: translateY(-3px) scale(1.05);
    box-shadow: 0 5px 10px rgba(0,0,0,0.1);
}

.cm-mclip-icon-btn i {
    line-height: 48px;
    text-align: center;
}

.cm-mclip-icon-btn.whatsapp  { background-color: #25D366; }
.cm-mclip-icon-btn.facebook  { background-color: #1877F2; }
.cm-mclip-icon-btn.twitter   { background-color: #1DA1F2; }
.cm-mclip-icon-btn.telegram  { background-color: #0088cc; }
.cm-mclip-icon-btn.print     { background-color: #666666; }


/* --- Loader & Toast (Unchanged) --- */

.cm-mclip-loader-overlay {
    position: fixed;
    inset: 0; /* (top, right, bottom, left = 0) */
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    display: none; /* Hidden by default */
}

.cm-mclip-spinner-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

#cm-mclip-loader-text {
    font-size: 16px;
    font-weight: 500;
    color: #333;
}

.cm-mclip-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f0f2f5;
    border-top-color: #106634;
    border-radius: 50%;
    animation: cm-spin 1s linear infinite;
}

@keyframes cm-spin {
    to { transform: rotate(360deg); }
}

.cm-mclip-toast {
    position: fixed;
    bottom: -100px; /* Start off-screen */
    left: 50%;
    transform: translateX(-50%);
    background: #222;
    color: #fff;
    padding: 12px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    font-size: 15px;
    font-weight: 500;
    z-index: 9999;
    transition: bottom 0.4s ease-out;
}
.cm-mclip-toast.show {
    bottom: 30px; /* Animate in */
}
.cm-mclip-toast.error {
    background: #d9534f; /* Red for errors */
    color: #fff;
}


/* --- Desktop Layout (Unchanged) --- */
/* (Applies to screens 992px and wider) */

@media (min-width: 992px) {
    .cm-mclip-main-content {
        flex-direction: row; /* Side-by-side */
        align-items: flex-start; /* Align to top */
        justify-content: center;
        padding: 40px;
        gap: 40px;
    }

    .cm-mclip-wrapper {
        flex: 1; /* Take up available space */
        max-width: 500px; /* Limit preview size */
        /* Make preview sticky so it follows scroll */
        position: sticky;
        top: 100px; 
    }

    .cm-mclip-ui-wrapper {
        flex: 1; /* Take up available space */
        max-width: 420px; /* Limit control panel size */
        /* Let it scroll naturally */
    }
}

