/**
 * WP Markdown Export - Frontend Button Styles
 */

/* Button wrapper */
.wp-markdown-export-button-wrapper {
    position: relative;
    display: inline-flex;
    margin-left: 12px;
    vertical-align: middle;
}

/* Main button - subtle style */
.wp-markdown-export-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.5;
    color: #9ca3af;
    background-color: transparent;
    border: 1px solid #e5e7eb;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wp-markdown-export-button:hover {
    background-color: transparent;
    border-color: #d1d5db;
    color: #6b7280;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
}

.wp-markdown-export-button:focus {
    outline: none;
}

.wp-markdown-export-button:active {
    background-color: transparent;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

/* Share icon (left side) */
.wp-markdown-share-icon {
    flex-shrink: 0;
}

/* Dropdown icon (right side) */
.wp-markdown-dropdown-icon {
    transition: transform 0.2s ease;
    margin-left: auto;
}

.wp-markdown-export-button[aria-expanded="true"] .wp-markdown-dropdown-icon {
    transform: rotate(180deg);
}

/* Dropdown menu */
.wp-markdown-dropdown-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    z-index: 1000;
    min-width: 200px;
    padding: 4px 0;
    background-color: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.wp-markdown-dropdown-menu[aria-hidden="false"] {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Dropdown items */
.wp-markdown-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.5;
    color: #374151;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
    transition: background-color 0.15s ease;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    text-align: left;
}

.wp-markdown-dropdown-item:hover {
    background-color: #f3f4f6;
    color: #111827;
}

.wp-markdown-dropdown-item:active {
    background-color: #e5e7eb;
}

.wp-markdown-dropdown-item svg {
    flex-shrink: 0;
    opacity: 0.7;
}

/* Success state for copy button */
.wp-markdown-dropdown-item.copied {
    color: #059669;
}

.wp-markdown-dropdown-item.copied svg {
    opacity: 1;
}

/* Loading state */
.wp-markdown-dropdown-item.loading {
    opacity: 0.6;
    cursor: wait;
}

/* Notification toast */
.wp-markdown-toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 10000;
    padding: 12px 20px;
    background-color: #111827;
    color: #ffffff;
    border-radius: 8px;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(8px);
    transition: all 0.3s ease;
    pointer-events: none;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

.wp-markdown-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.wp-markdown-toast.success {
    background-color: #059669;
}

.wp-markdown-toast.error {
    background-color: #dc2626;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .wp-markdown-export-button-wrapper {
        display: block;
        margin-left: 0;
        margin-top: 8px;
    }

    .wp-markdown-dropdown-menu {
        left: 0;
        right: 0;
        width: 100%;
        max-width: none;
    }

    .wp-markdown-toast {
        left: 16px;
        right: 16px;
        bottom: 16px;
    }
}

/* Dark mode support (optional) */
@media (prefers-color-scheme: dark) {
    .wp-markdown-export-button {
        color: #e5e7eb;
        background-color: #1f2937;
        border-color: #374151;
    }

    .wp-markdown-export-button:hover {
        background-color: #111827;
        border-color: #4b5563;
        color: #f9fafb;
    }

    .wp-markdown-dropdown-menu {
        background-color: #1f2937;
        border-color: #374151;
    }

    .wp-markdown-dropdown-item {
        color: #e5e7eb;
    }

    .wp-markdown-dropdown-item:hover {
        background-color: #374151;
        color: #f9fafb;
    }

    .wp-markdown-dropdown-item:active {
        background-color: #4b5563;
    }
}

/* Accessibility improvements */
.wp-markdown-export-button:focus-visible,
.wp-markdown-dropdown-item:focus-visible {
    outline: 2px solid #3b82f6;
    outline-offset: 2px;
}

/* Print - hide button when printing */
@media print {
    .wp-markdown-export-button-wrapper {
        display: none !important;
    }
}
