/* ========================================
   EMBED & SHARE SYSTEM CSS FOR CLOCK7.COM
   ======================================== */

/* Share & Embed Floating Buttons - Desktop */
.share-embed-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    display: flex;
    gap: 10px;
    z-index: 100;
}

.share-embed-btn {
    background: rgba(255, 255, 255, 0.95);
    border: none;
    padding: 12px 20px;
    border-radius: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.share-embed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.15);
    background: rgba(255, 255, 255, 1);
}

.share-embed-btn svg {
    width: 18px;
    height: 18px;
}

/* Modal Overlay */
.modal-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    z-index: 1000;
    animation: fadeIn 0.3s ease;
}

.modal-overlay.active {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Modal Content */
.modal-content {
    background: white;
    border-radius: 16px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

.modal-header {
    padding: 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-header h2 {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.2s;
}

.modal-close:hover {
    background: #f3f4f6;
}

.modal-body {
    padding: 20px;
}

/* Tabs */
.modal-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 20px;
}

.modal-tab {
    flex: 1;
    padding: 12px;
    background: none;
    border: none;
    font-size: 14px;
    font-weight: 600;
    color: #6b7280;
    cursor: pointer;
    position: relative;
    transition: color 0.2s;
}

.modal-tab.active {
    color: #667eea;
}

.modal-tab.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 2px;
    background: #667eea;
}

/* Tab Panels */
.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

/* Tool Selector for Embed */
.tool-selector {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}

.tool-chip {
    padding: 8px 16px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 20px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.tool-chip.active {
    border-color: #667eea;
    background: #f3f0ff;
    color: #667eea;
    font-weight: 600;
}

/* Embed Options */
.embed-options {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.option-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 8px;
    display: block;
}

/* Safe fix: Only make the two labels sit in one row */
.embed-options .option-label {
    display: inline-block !important;
    margin-right: 20px;
    vertical-align: middle;
}

.size-selector {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 12px;
}

.size-option {
    padding: 10px;
    border: 2px solid #e5e7eb;
    background: white;
    border-radius: 8px;
    cursor: pointer;
    text-align: center;
    font-size: 13px;
    transition: all 0.2s;
}

.size-option.active {
    border-color: #667eea;
    background: #f3f0ff;
    color: #667eea;
    font-weight: 600;
}

.size-option small {
    display: block;
    font-size: 11px;
    color: #9ca3af;
    margin-top: 2px;
}

/* Custom Size Inputs */
.custom-size {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
}

.custom-size input {
    width: 80px;
    padding: 8px;
    border: 2px solid #e5e7eb;
    border-radius: 6px;
    font-size: 14px;
}

.custom-size button {
    padding: 8px 16px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: background 0.2s;
}

.custom-size button:hover {
    background: #5a67d8;
}

/* Code Box */
.code-box {
    background: #1f2937;
    color: #f9fafb;
    padding: 16px;
    border-radius: 12px;
    font-family: 'Monaco', 'Courier New', monospace;
    font-size: 12px;
    line-height: 1.5;
    position: relative;
    margin-bottom: 16px;
    overflow-x: auto;
}

.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #4b5563;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.copy-code-btn:hover {
    background: #6b7280;
}

.copy-code-btn.copied {
    background: #10b981;
}

/* Social Share Grid */
.social-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: white;
    transition: transform 0.2s, box-shadow 0.2s;
}

.social-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.social-btn svg {
    width: 20px;
    height: 20px;
}

.social-btn.facebook { background: #1877f2; }
.social-btn.twitter { background: #1da1f2; }
.social-btn.linkedin { background: #0077b5; }
.social-btn.whatsapp { background: #25d366; }
.social-btn.reddit { background: #ff4500; }
.social-btn.email { background: #6b7280; }

/* Preview Frame */
.preview-container {
    background: #f9fafb;
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 16px;
}

.preview-label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 12px;
}

.preview-frame {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.preview-frame iframe {
    width: 100%;
    display: block;
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* ============================================
   MOBILE RESPONSIVE - HEADER POSITIONING
   ============================================ */

/* For mobile devices (max-width: 768px) */
@media (max-width: 768px) {
    /* Move buttons to header on mobile */
    .share-embed-container {
        position: fixed;
        top: 10px;  /* Adjust based on your header height */
        bottom: auto;  /* Remove bottom positioning */
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        z-index: 99;  /* Make sure it doesn't overlap with header menu */
        gap: 5px;
    }
    
    /* Smaller, more compact buttons for mobile header */
    .share-embed-btn {
        padding: 8px 14px;
        font-size: 12px;
        border-radius: 25px;
        backdrop-filter: blur(10px);
        background: rgba(255, 255, 255, 0.9);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
    
    /* Hide text labels on very small screens, show only icons */
    .share-embed-btn span {
        display: inline;
    }
    
    .share-embed-btn svg {
        width: 16px;
        height: 16px;
    }
    
    /* Alternative: If your header has a specific height, position below it */
    /* Example: If header is 60px tall */
    .share-embed-container.header-offset {
        top: 70px;  /* Header height + 10px gap */
    }
}

/* For very small mobile devices */
@media (max-width: 480px) {
    .share-embed-container {
        gap: 3px;
    }
    
    /* Show only icons on very small screens */
    .share-embed-btn span {
        display: none;
    }
    
    .share-embed-btn {
        padding: 10px;
        border-radius: 50%;
    }
    
    .share-embed-btn svg {
        width: 18px;
        height: 18px;
    }
}

/* Tablets - keep buttons at bottom but make them smaller */
@media (min-width: 769px) and (max-width: 1024px) {
    .share-embed-container {
        bottom: 15px;
        right: 15px;
    }
    
    .share-embed-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
}

/* Modal responsive adjustments */
@media (max-width: 640px) {
    .modal-content {
        width: 95%;
        max-height: 95vh;
        border-radius: 12px;
    }
    
    .modal-header {
        padding: 15px;
    }
    
    .modal-body {
        padding: 15px;
    }
    
    .size-selector {
        grid-template-columns: 1fr;
    }
    
    .social-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-tabs {
        flex-direction: row;  /* Keep tabs horizontal */
        border-bottom: 1px solid #e5e7eb;
    }
    
    .modal-tab {
        font-size: 13px;
        padding: 10px;
    }
}

/* Alternative Positioning Options for Mobile */

/* Option 1: Sticky bar at top (uncomment to use) */
/*
@media (max-width: 768px) {
    .share-embed-container {
        position: sticky;
        top: 0;
        bottom: auto;
        left: 0;
        right: 0;
        width: 100%;
        transform: none;
        border-radius: 0;
        background: rgba(255, 255, 255, 0.95);
        backdrop-filter: blur(10px);
        padding: 8px;
        justify-content: center;
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    }
}
*/

/* Option 2: Inside header as inline elements (uncomment to use) */
/*
@media (max-width: 768px) {
    .share-embed-container {
        position: static;
        display: inline-flex;
        margin: 0 auto;
    }
}
*/

/* Option 3: Slide-out drawer from side (uncomment to use) */

@media (max-width: 768px) {
    .share-embed-container {
        position: fixed;
        top: 50%;
        bottom: auto;
        right: 0;
        left: auto;
        transform: translateY(-50%);
        flex-direction: column;
        border-radius: 8px 0 0 8px;
        padding: 5px;
    }
    
    .share-embed-btn {
        border-radius: 8px;
        padding: 10px;
    }
    
    .share-embed-btn span {
        display: none;
    }
}
