/* Link in Bio Generator Styles - Tool Specific Only */

.link-bio-wrapper {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 992px) {
    .link-bio-wrapper {
        grid-template-columns: 1fr 1fr;
    }
}

.form-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.form-section:last-of-type {
    border-bottom: none;
}

.form-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.2rem;
    color: var(--primary-color);
}

/* Image Preview */
.image-preview {
    margin-top: 1rem;
    text-align: center;
}

.image-preview img {
    max-width: 150px;
    max-height: 150px;
    width: 100%;
    height: auto;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid var(--primary-color);
    margin-bottom: 0.5rem;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

.remove-image-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.5rem 1rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.remove-image-btn:hover {
    background-color: #5a6268;
}

/* Links Container */
.links-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-bottom: 1rem;
}

.link-item {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.link-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.link-item-number {
    font-weight: bold;
    color: var(--primary-color);
    font-size: 0.9rem;
}

.link-item-actions {
    display: flex;
    gap: 0.5rem;
}

.link-item-actions button {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
    min-width: 60px;
}

.link-item-actions button:hover {
    background-color: #5a6268;
}

.link-item-actions button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.link-item-actions .remove-link-btn {
    background-color: #dc3545;
}

.link-item-actions .remove-link-btn:hover {
    background-color: #c82333;
}

.add-link-btn {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: 500;
    width: 100%;
    transition: background-color 0.3s ease;
}

.add-link-btn:hover {
    background-color: var(--primary-hover);
}

/* Preview Section */
.preview-container {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 400px;
    padding: 1rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.preview-phone {
    width: 100%;
    max-width: 375px;
    background-color: #000;
    border-radius: 25px;
    padding: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    margin: 0 auto;
}

.bio-preview {
    background-color: #fff;
    border-radius: 20px;
    overflow: hidden;
    min-height: 600px;
    max-height: 800px;
    overflow-y: auto;
}

.bio-preview-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 400px;
    color: var(--text-secondary);
    font-style: italic;
}

.bio-preview-content {
    padding: 2rem 1.5rem;
    text-align: center;
}

.bio-preview-profile {
    margin-bottom: 1.5rem;
}

.bio-preview-image {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 1rem;
    border: 3px solid var(--primary-color);
    display: block;
}

.bio-preview-name {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.bio-preview-bio {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    max-width: 300px;
    margin: 0 auto;
}

.bio-preview-links {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin-top: 2rem;
}

.bio-preview-link {
    display: block;
    background-color: var(--primary-color);
    color: white;
    text-decoration: none;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    transition: background-color 0.3s ease, transform 0.2s ease;
    word-wrap: break-word;
}

.bio-preview-link:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Export Section */
.export-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.export-section h3 {
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.export-helper-note {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: var(--surface);
    border-radius: 5px;
    border-left: 3px solid var(--primary-color);
}

.export-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.export-buttons .btn,
.export-buttons .calculate-btn {
    flex: 1;
    min-width: 150px;
}

.link-display {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.link-display input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    background-color: var(--surface);
    color: var(--text-primary);
    font-size: 0.9rem;
    font-family: monospace;
}

.btn-small {
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* Error Messages */
.error-message {
    color: #dc3545;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: block;
}

#shortLinkError {
    margin-top: 1rem;
    padding: 0.75rem;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 5px;
    color: #721c24;
}

/* Share Section */
.share-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid var(--border-color);
}

.share-section h4 {
    margin-bottom: 1rem;
    color: var(--text-primary);
    font-size: 1.1rem;
}

.share-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 0.75rem;
}

.btn-share {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border: none;
    border-radius: 6px;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    color: white;
}

.btn-share:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.share-icon {
    font-size: 1.1rem;
    line-height: 1;
}

.btn-whatsapp {
    background-color: #25D366;
}

.btn-whatsapp:hover:not(:disabled) {
    background-color: #20BA5A;
    transform: translateY(-1px);
}

.btn-x {
    background-color: #000000;
}

.btn-x:hover:not(:disabled) {
    background-color: #333333;
    transform: translateY(-1px);
}

.btn-facebook {
    background-color: #1877F2;
}

.btn-facebook:hover:not(:disabled) {
    background-color: #166FE5;
    transform: translateY(-1px);
}

.btn-native {
    background-color: var(--primary-color);
}

.btn-native:hover:not(:disabled) {
    background-color: var(--primary-hover);
    transform: translateY(-1px);
}

/* Dark Mode Adjustments */
body.dark-mode .bio-preview {
    background-color: var(--card-background);
}

body.dark-mode .bio-preview-name {
    color: var(--text-primary);
}

body.dark-mode .bio-preview-bio {
    color: var(--text-secondary);
}

body.dark-mode .preview-phone {
    background-color: #1a1a1a;
}

/* Responsive Design */
@media (max-width: 768px) {
    .link-bio-wrapper {
        grid-template-columns: 1fr;
    }
    
    .export-buttons {
        flex-direction: column;
    }
    
    .export-buttons .btn,
    .export-buttons .calculate-btn {
        width: 100%;
    }
    
    .link-display {
        flex-direction: column;
    }
    
    .link-item-actions {
        flex-wrap: wrap;
    }
    
    .preview-phone {
        max-width: 100%;
    }
    
    .preview-container {
        padding: 0.5rem;
        min-height: 300px;
    }
    
    .share-buttons {
        grid-template-columns: 1fr 1fr;
    }
    
    .btn-share {
        font-size: 0.85rem;
        padding: 0.65rem 0.85rem;
    }
}

/* Scrollbar Styling for Preview */
.bio-preview::-webkit-scrollbar {
    width: 8px;
}

.bio-preview::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.bio-preview::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.bio-preview::-webkit-scrollbar-thumb:hover {
    background: var(--primary-hover);
}

body.dark-mode .bio-preview::-webkit-scrollbar-track {
    background: var(--surface);
}

/* FAQ Styles - Pure HTML <details>/<summary> implementation */
.tool-faq .faq-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Style the <details> element */
.tool-faq .faq-container details.faq-item {
    background-color: var(--card-background);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 0;
}

/* Style the <summary> element (question) */
.tool-faq .faq-container details.faq-item summary.faq-question {
    list-style: none;
    padding: 1.25rem;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-primary);
    transition: background-color 0.3s ease;
    user-select: none;
}

/* Hide default details marker */
.tool-faq .faq-container details.faq-item summary::-webkit-details-marker {
    display: none;
}

.tool-faq .faq-container details.faq-item summary::marker {
    display: none;
}

/* Hover state */
.tool-faq .faq-container details.faq-item summary.faq-question:hover {
    background-color: var(--surface);
}

/* Open state */
.tool-faq .faq-container details.faq-item[open] summary.faq-question {
    background-color: var(--surface);
}

/* Style the icon */
.tool-faq .faq-container details.faq-item .faq-icon {
    font-size: 1.5rem;
    font-weight: 300;
    color: var(--primary-color);
    transition: transform 0.3s ease;
    flex-shrink: 0;
    margin-left: 1rem;
}

/* Rotate icon when open */
.tool-faq .faq-container details.faq-item[open] .faq-icon {
    transform: rotate(45deg);
}

/* Style the answer */
.tool-faq .faq-container details.faq-item .faq-answer {
    padding: 0 1.25rem 1.25rem;
}

.tool-faq .faq-container details.faq-item .faq-answer p {
    color: var(--text-secondary);
    line-height: 1.8;
    margin: 0;
}

/* ===== NEW FEATURES STYLES ===== */

/* Drag & Drop Styles */
.link-item {
    cursor: move;
    transition: all 0.2s ease;
}

.link-item.dragging {
    opacity: 0.5;
    transform: scale(0.98);
}

.link-item.drag-over {
    border: 2px dashed var(--primary-color);
    background-color: rgba(74, 144, 226, 0.1);
}

/* Section Item Styles */
.section-item {
    background-color: var(--surface);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.section-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.75rem;
}

.section-title-display {
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--primary-color);
    margin: 0;
}

.remove-section-btn {
    background-color: var(--secondary-color);
    color: white;
    border: none;
    padding: 0.25rem 0.5rem;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.8rem;
}

.remove-section-btn:hover {
    background-color: #5a6268;
}

/* Emoji Input Styles */
.link-emoji-input {
    border: 2px solid var(--border-color);
    border-radius: 5px;
    padding: 0.5rem;
    font-size: 1.2rem;
    background-color: var(--card-background);
    color: var(--text-primary);
}

.clear-emoji-btn {
    transition: background-color 0.2s ease;
}

.clear-emoji-btn:hover {
    background-color: #5a6268;
}

/* Preview Section Heading */
.bio-preview-section-heading {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin: 1.5rem 0 0.75rem 0;
    text-align: left;
    opacity: 0.8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85rem;
}

/* Preview Location */
.bio-preview-location {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Button Style Classes */
.button-style-default {
    border-radius: 8px;
}

.button-style-rounded {
    border-radius: 12px;
}

.button-style-pill {
    border-radius: 9999px;
}

.button-style-outline {
    background: transparent !important;
    border: 2px solid var(--primary-color);
    color: var(--primary-color) !important;
}

.button-style-outline:hover {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* Primary Link Highlight */
.bio-preview-link.link-primary {
    box-shadow: 0 0 0 2px rgba(74, 144, 226, 0.3), 0 0 20px rgba(74, 144, 226, 0.2);
    position: relative;
}

.bio-preview-link.link-primary::before {
    content: '⭐';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 0.9rem;
}

/* Link Icon Styles */
.link-icon {
    font-size: 1.2rem;
    line-height: 1;
    display: inline-block;
}

.bio-preview-link {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

/* Theme Preset Styles */
.bio-preview.theme-dark {
    background-color: #2d3748;
    color: #f7fafc;
}

.bio-preview.theme-dark .bio-preview-name {
    color: #f7fafc;
}

.bio-preview.theme-dark .bio-preview-bio,
.bio-preview.theme-dark .bio-preview-location {
    color: #cbd5e0;
}

.bio-preview.theme-dark .bio-preview-link {
    background-color: #4a5568;
}

.bio-preview.theme-dark .bio-preview-link:hover {
    background-color: #2d3748;
}

.bio-preview.theme-minimal {
    background: #f8f9fa;
}

.bio-preview.theme-minimal .bio-preview-link {
    background-color: #e9ecef;
    color: #212529;
}

.bio-preview.theme-minimal .bio-preview-link:hover {
    background-color: #dee2e6;
}

.bio-preview.theme-creator {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

/* Add Section Button */
.add-section-btn {
    transition: background-color 0.3s ease;
}

.add-section-btn:hover {
    background-color: #5a6268;
}

/* QR Code Button */
#generateQRBtn {
    transition: all 0.3s ease;
}

#generateQRBtn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Responsive adjustments for new features */
@media (max-width: 768px) {
    .section-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .bio-preview-section-heading {
        font-size: 0.8rem;
    }
    
    .link-emoji-input {
        font-size: 1rem;
    }
}
