/**
 * FCD Core SaaS - Premium Admin Dashboard CSS
 */

:root {
    --fcd-primary: #6366f1;
    --fcd-primary-dark: #4f46e5;
    --fcd-bg: #f8fafc;
    --fcd-white: #ffffff;
    --fcd-text: #1e293b;
    --fcd-text-muted: #64748b;
    --fcd-border: #e2e8f0;
    --fcd-radius: 12px;
}

/* Accessibility: High Contrast Focus */
:focus {
    outline: 2px solid var(--fcd-primary) !important;
    outline-offset: 2px !important;
}

.fcd-tool-card:focus-within {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.4) !important;
}

/* Best Practices: Aspect Ratio & Performance */
/* NOTE: Scoped to FCD wrappers only - do NOT apply display:block globally to svg/img */
.fcd-tool-card img,
.fcd-frontend-grid img {
    max-width: 100%;
    height: auto;
}

/* General Layout */
.fcd-admin-wrap {
    background: var(--fcd-background);
    padding: 20px;
    border-radius: var(--fcd-radius);
    margin-top: 20px;
}

.fcd-admin-wrap h1 {
    font-weight: 800;
    color: var(--fcd-text);
    margin-bottom: 30px;
    font-size: 28px;
}

/* Tabs System */
.fcd-premium-admin-tabs {
    background: var(--fcd-surface);
    border-radius: var(--fcd-radius);
    box-shadow: var(--fcd-shadow);
    overflow: hidden;
    border: 1px solid var(--fcd-border);
}

.fcd-tabs-nav {
    display: flex;
    background: #f1f5f9;
    padding: 10px 10px 0 10px;
    border-bottom: 1px solid var(--fcd-border);
}

.fcd-tab-btn {
    padding: 12px 24px;
    border: none;
    background: none;
    font-weight: 600;
    color: var(--fcd-text-muted);
    cursor: pointer;
    border-radius: 8px 8px 0 0;
    transition: all 0.2s;
    font-size: 14px;
}

.fcd-tab-btn:hover {
    color: var(--fcd-primary);
    background: rgba(99, 102, 241, 0.05);
}

.fcd-tab-btn.active {
    color: var(--fcd-primary);
    background: var(--fcd-surface);
    box-shadow: 0 -2px 0 var(--fcd-primary) inset;
}

.fcd-tab-content {
    display: none;
    padding: 30px;
}

.fcd-tab-content.active {
    display: block;
}

/* Grid & Fields */
.fcd-meta-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
}

.widefat {
    border-radius: 8px !important;
    border: 1px solid var(--fcd-border) !important;
    padding: 8px 12px !important;
    box-shadow: none !important;
}

.widefat:focus {
    border-color: var(--fcd-primary) !important;
    box-shadow: 0 0 0 2px rgba(99, 102, 241, 0.2) !important;
}

/* Icon Preview Box */
.fcd-icon-preview-box {
    width: 64px;
    height: 64px;
    border-radius: var(--fcd-radius);
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    border: 1px solid var(--fcd-border);
    color: var(--fcd-primary);
}

.fcd-icon-preview-box i, .fcd-icon-preview-box span, .fcd-icon-preview-box svg {
    font-size: 32px !important;
    width: 32px;
    height: 32px;
}

/* Mobile Tap Targets */
@media (max-width: 768px) {
    .fcd-tool-card, .button, .fcd-filter-btn, .tag {
        min-height: 48px !important;
        padding-top: 12px !important;
        padding-bottom: 12px !important;
    }
    
    .fcd-breadcrumb ol li a {
        padding: 10px 5px;
        display: inline-block;
    }
}

/* Force visibility for tool components to bypass reveal animations */
.fcd-tool, 
.fcd-tool-header, 
.fcd-frontend-grid .fcd-tool-card,
.fcd-tool-guide {
    opacity: 1 !important;
    transform: none !important;
    visibility: visible !important;
    transition: none !important;
}

/* Sidebar Alignment Fix */
.fcd-tool-page-wrapper {
    width: 100%;
    display: block;
    overflow: hidden;
}

/* Builder Layout */
.fcd-builder-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.fcd-editor-pane label {
    display: block;
    margin-top: 20px;
    margin-bottom: 8px;
    color: var(--fcd-text);
}

.fcd-preview-pane {
    background: #f8fafc;
    border-radius: var(--fcd-radius);
    padding: 20px;
    border: 2px dashed var(--fcd-border);
}

.fcd-preview-pane h3 {
    margin-top: 0;
    display: flex;
    justify-content: space-between;
}

.preview-box {
    background: white;
    min-height: 400px;
    border-radius: 8px;
    box-shadow: var(--fcd-shadow);
    padding: 20px;
}

/* CodeMirror Adjustments */
.CodeMirror {
    border-radius: 8px;
    border: 1px solid var(--fcd-border);
    height: 300px !important;
}

/* Settings Form */
.fcd-settings-section {
    background: var(--fcd-surface);
    padding: 30px;
    border-radius: var(--fcd-radius);
    box-shadow: var(--fcd-shadow);
    margin-bottom: 30px;
}

.fcd-settings-section h3 {
    margin-top: 0;
    font-size: 20px;
    color: var(--fcd-primary);
}

.fcd-premium-form .form-table th {
    width: 200px;
    font-weight: 600;
}

/* Dashboard Frontend (Shortcode Styles) */
.fcd-premium-dashboard {
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    padding: 40px;
    font-family: 'Inter', sans-serif;
}

.fcd-dash-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 40px;
    border-bottom: 1px solid #eee;
    padding-bottom: 30px;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 20px;
}

.user-info .avatar img {
    border-radius: 50%;
    border: 3px solid var(--fcd-primary);
}

.fcd-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

.fcd-badge.premium { background: #dcfce7; color: #166534; }
.fcd-badge.free { background: #f1f5f9; color: #475569; }

.fcd-btn-upgrade {
    background: linear-gradient(135deg, var(--fcd-primary), var(--fcd-secondary));
    color: white;
    padding: 12px 24px;
    border-radius: 30px;
    text-decoration: none;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3);
    transition: transform 0.2s;
}

.fcd-btn-upgrade:hover {
    transform: translateY(-2px);
    color: white;
}

.fcd-dash-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 30px;
}

.fcd-dash-card {
    background: #f8fafc;
    border-radius: 16px;
    padding: 25px;
}

.fcd-dash-card h3 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 20px;
}

.tool-list {
    list-style: none;
    padding: 0;
}

.tool-list li {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #e2e8f0;
}

.tool-name { font-weight: 600; color: #334155; }
.tool-date { font-size: 13px; color: #94a3b8; }

/* Auth System Styles */
.fcd-auth-card {
    max-width: 450px;
    margin: 60px auto;
    background: white;
    padding: 40px;
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
    font-family: 'Inter', sans-serif;
}

.fcd-auth-card h2 {
    margin-top: 0;
    font-size: 28px;
    color: var(--fcd-text);
}

.fcd-auth-card p {
    color: var(--fcd-text-muted);
    margin-bottom: 30px;
}

.fcd-field {
    margin-bottom: 20px;
}

.fcd-field label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #475569;
}

.fcd-field input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.2s;
}

.fcd-field input:focus {
    outline: none;
    border-color: var(--fcd-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.fcd-btn-primary {
    width: 100%;
    background: var(--fcd-primary);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}

.fcd-btn-primary:hover {
    background: var(--fcd-primary-hover);
}

.fcd-auth-links {
    margin-top: 25px;
    text-align: center;
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 14px;
}

.fcd-alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
}

.fcd-alert.error {
    background: #fef2f2;
    color: #991b1b;
    border: 1px solid #fee2e2;
}

/* Usage Badge */
.fcd-usage-badge {
    display: inline-block;
    background: #f1f5f9;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    color: #475569;
    margin-bottom: 20px;
    border: 1px solid #e2e8f0;
}

.fcd-usage-badge strong {
    color: var(--fcd-primary);
}

.fcd-btn-logout {
    font-size: 13px;
    color: #94a3b8;
    text-decoration: none;
    margin-left: 15px;
}

.fcd-btn-logout:hover {
    color: #ef4444;
}
/* Icon Picker Modal - Categorized */
#fcd-icon-modal-overlay {
    backdrop-filter: blur(8px);
}

.fcd-icon-modal {
    background: var(--fcd-surface);
    width: min(900px, 95vw);
    max-height: 85vh;
    border-radius: var(--fcd-radius);
    display: flex;
    flex-direction: column;
    box-shadow: var(--fcd-shadow-lg);
    border: 1px solid var(--fcd-border);
    animation: fcd-modal-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    overflow: hidden;
}

@keyframes fcd-modal-in {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.fcd-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid var(--fcd-border);
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.fcd-modal-header h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.fcd-modal-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.fcd-modal-sidebar {
    width: 220px;
    background: #f1f5f9;
    border-right: 1px solid var(--fcd-border);
    padding: 20px 10px;
    overflow-y: auto;
}

.fcd-category-btn {
    display: block;
    width: 100%;
    padding: 10px 15px;
    text-align: left;
    border: none;
    background: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: var(--fcd-text-muted);
    margin-bottom: 5px;
    transition: all 0.2s;
}

.fcd-category-btn:hover {
    background: rgba(99, 102, 241, 0.05);
    color: var(--fcd-primary);
}

.fcd-category-btn.active {
    background: var(--fcd-primary);
    color: white;
}

.fcd-modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 25px;
    background: white;
}

.fcd-modal-search-wrap {
    margin-bottom: 20px;
}

#fcd_icon_search {
    width: 100%;
    padding: 12px 18px;
    border-radius: 10px;
    border: 1px solid var(--fcd-border);
    font-size: 15px;
    outline: none;
}

.fcd-icon-grid-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.fcd-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 15px;
}

.fcd-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    border: 1px solid var(--fcd-border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    background: #f8fafc;
    min-height: 90px;
}

.fcd-icon-item:hover {
    background: white;
    border-color: var(--fcd-primary);
    transform: translateY(-3px);
    box-shadow: var(--fcd-shadow);
}

.fcd-icon-item .dashicons, .fcd-icon-item i {
    font-size: 28px;
    margin-bottom: 10px;
    color: var(--fcd-text);
}

.fcd-icon-item span {
    font-size: 11px;
    color: var(--fcd-text-muted);
    text-align: center;
    word-break: break-all;
    display: block;
    line-height: 1.2;
}

#fcd_close_icon_picker {
    background: white;
    border: 1px solid var(--fcd-border);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

/* Tool Grid Frontend Styles */
.fcd-frontend-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin: 30px 0;
}

.fcd-tool-card {
    background: white;
    border-radius: 20px;
    padding: 25px;
    border: 1px solid rgba(0,0,0,0.05);
    box-shadow: 0 10px 25px rgba(0,0,0,0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.fcd-tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(99, 102, 241, 0.12);
    border-color: rgba(99, 102, 241, 0.3);
}

.fcd-tool-card .card-icon {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, #6366f1, #a855f7);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 16px rgba(99, 102, 241, 0.2);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    position: relative;
    overflow: hidden;
    color: white;
}

.fcd-tool-card .card-icon.fcd-icon-force-show .dashicons,
.fcd-tool-card .card-icon.fcd-icon-force-show i,
.fcd-tool-card .card-icon.fcd-icon-force-show img,
.fcd-tool-card .card-icon.fcd-icon-force-show svg {
    font-size: 30px !important;
    color: white !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    text-indent: 0 !important;
    width: 100%;
    height: 100%;
    max-width: 35px;
    max-height: 35px;
    object-fit: contain;
}

.fcd-tool-card .card-icon.fcd-icon-force-show .dashicons {
    font-family: dashicons !important;
}

.fcd-tool-card .card-icon.fcd-icon-force-show .dashicons:before {
    font-size: 30px !important;
    line-height: 1;
}

.fcd-emoji-icon {
    font-size: 30px;
    line-height: 1;
}

.fcd-tool-card:hover .card-icon {
    transform: scale(1.1) rotate(5deg);
}

.fcd-premium-grid-wrap {
    margin: 40px 0;
}

.fcd-grid-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    gap: 20px;
    flex-wrap: wrap;
}

.fcd-search-box {
    position: relative;
    flex: 1;
    min-width: 300px;
}

.fcd-search-box .dashicons {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #94a3b8;
}

.fcd-search-box input {
    width: 100%;
    padding: 12px 15px 12px 45px;
    border-radius: 12px;
    border: 1px solid var(--fcd-border);
    background: var(--fcd-surface);
    color: var(--fcd-text);
    font-size: 15px;
    transition: all 0.3s ease;
}

.fcd-search-box input:focus {
    outline: none;
    border-color: var(--fcd-primary);
    box-shadow: 0 0 0 4px rgba(99, 102, 241, 0.1);
}

.fcd-filter-tabs {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 5px;
}

.fcd-filter-btn {
    padding: 8px 16px;
    border-radius: 30px;
    border: 1px solid var(--fcd-border);
    background: var(--fcd-surface);
    color: #64748b;
    cursor: pointer;
    font-size: 14px;
    white-space: nowrap;
    transition: all 0.3s ease;
}

.fcd-filter-btn:hover {
    border-color: var(--fcd-primary);
    color: var(--fcd-primary);
}

.fcd-filter-btn.active {
    background: var(--fcd-primary);
    color: white;
    border-color: var(--fcd-primary);
}

.fcd-tool-card .card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid var(--fcd-border);
}

.tool-cat-tag {
    font-size: 11px;
    text-transform: uppercase;
    color: #94a3b8;
    background: #f1f5f9;
    padding: 2px 8px;
    border-radius: 4px;
}

.open-link {
    font-size: 14px;
    font-weight: 600;
    color: var(--fcd-primary);
    display: flex;
    align-items: center;
    gap: 5px;
}

.fcd-tool-card:hover .open-link i {
    transform: translateX(5px);
}

.open-link i {
    transition: transform 0.3s ease;
}

@media (max-width: 768px) {
    .fcd-grid-controls {
        flex-direction: column;
        align-items: stretch;
    }
    .fcd-search-box {
        min-width: 100%;
    }
}

.fcd-tool-card h3 {
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 700;
}

.fcd-tool-card p {
    margin: 0;
    font-size: 14px;
    color: #64748b;
    line-height: 1.6;
    flex: 1;
}

.fcd-tool-card .pro-badge {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #dcfce7;
    color: #166534;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 10px;
    font-weight: 800;
    text-transform: uppercase;
}

/* Icon Picker Modal Styles */
#fcd-icon-modal-overlay {
    background: rgba(15, 23, 42, 0.6) !important;
    backdrop-filter: blur(4px);
}

.fcd-icon-modal {
    background: #fff;
    width: 800px;
    max-width: 90%;
    height: 600px;
    max-height: 80vh;
    border-radius: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid #e2e8f0;
}

.fcd-modal-header {
    padding: 20px 25px;
    border-bottom: 1px solid #f1f5f9;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f8fafc;
}

.fcd-modal-header h3 {
    margin: 0;
    font-size: 1.25rem;
    color: #1e293b;
    font-weight: 700;
}

#fcd_close_icon_picker {
    background: none;
    border: none;
    font-size: 24px;
    color: #94a3b8;
    cursor: pointer;
    line-height: 1;
}

.fcd-modal-main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.fcd-modal-sidebar {
    width: 200px;
    background: #f8fafc;
    border-right: 1px solid #f1f5f9;
    padding: 20px 10px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.fcd-category-btn {
    padding: 10px 15px;
    border: none;
    background: transparent;
    text-align: left;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    transition: all 0.2s;
    font-size: 0.9rem;
}

.fcd-category-btn:hover { background: #f1f5f9; color: #4f46e5; }
.fcd-category-btn.active { background: #4f46e5; color: #fff; }

.fcd-modal-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 20px;
}

.fcd-modal-search-wrap { margin-bottom: 20px; }
#fcd_icon_search {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 1rem;
}

.fcd-icon-grid-scroll {
    flex: 1;
    overflow-y: auto;
    padding-right: 10px;
}

.fcd-icon-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 10px;
}

.fcd-icon-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 15px 10px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid transparent;
}

.fcd-icon-item:hover {
    background: #f1f5f9;
    border-color: #e2e8f0;
    transform: translateY(-2px);
}

.fcd-icon-item span.dashicons, 
.fcd-icon-item i {
    font-size: 32px !important;
    width: 32px;
    height: 32px;
    color: #475569;
    margin-bottom: 8px;
}

.fcd-icon-item span:not(.dashicons) {
    font-size: 11px;
    color: #94a3b8;
    text-align: center;
    word-break: break-all;
    display: block;
}

.fcd-icon-preview-box {
    width: 50px;
    height: 50px;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #4f46e5;
}

.fcd-icon-preview-box .dashicons, 
.fcd-icon-preview-box i,
.fcd-icon-preview-box svg {
    font-size: 24px !important;
    width: 24px;
    height: 24px;
}

.fcd-svg-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
}

.fcd-svg-icon-wrap svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

/* Ultra-Premium Glassmorphism Modal */
.fcd-premium-fa-modal {
    background: #0f172a; /* Deep slate blue */
    width: 850px;
    max-width: 95%;
    border-radius: 24px;
    overflow: hidden;
    color: #f8fafc;
    box-shadow: 0 40px 100px -20px rgba(0,0,0,0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    animation: fcdModalPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes fcdModalPop {
    from { opacity: 0; transform: scale(0.95) translateY(20px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.fcd-prem-modal-header {
    background: rgba(30, 41, 59, 0.5);
    padding: 0 30px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.fcd-prem-tabs-wrap {
    display: flex;
    gap: 5px;
}

.fcd-prem-tab {
    padding: 22px 25px;
    background: transparent;
    border: none;
    color: #64748b;
    font-weight: 700;
    font-size: 13px;
    letter-spacing: 1.5px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-bottom: 3px solid transparent;
}

.fcd-prem-tab:hover {
    color: #e2e8f0;
}

.fcd-prem-tab.active {
    color: #38bdf8;
    border-bottom: 3px solid #38bdf8;
    background: rgba(56, 189, 248, 0.05);
}

.fcd-prem-close {
    background: rgba(255, 255, 255, 0.05);
    border: none;
    color: #94a3b8;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.fcd-prem-close:hover {
    background: #ef4444;
    color: white;
}

.fcd-prem-modal-body {
    padding: 40px;
}

.fcd-prem-top-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
}

.fcd-prem-sub-links {
    display: flex;
    gap: 25px;
}

.fcd-prem-sub-links span {
    font-size: 14px;
    color: #475569;
    cursor: pointer;
    font-weight: 600;
    transition: color 0.2s;
}

.fcd-prem-sub-links span.active, 
.fcd-prem-sub-links span:hover {
    color: #94a3b8;
}

.fcd-prem-live-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    background: rgba(255, 255, 255, 0.03);
    padding: 12px 25px;
    border-radius: 100px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

#fcd_adv_preview_label {
    font-size: 13px;
    color: #64748b;
    font-weight: 600;
}

#fcd_adv_live_icon_preview {
    font-size: 32px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #38bdf8;
}

#fcd_adv_live_icon_preview svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.fcd-prem-code-container {
    background: #020617; /* Very dark background for code */
    border-radius: 16px;
    padding: 35px;
    margin-bottom: 35px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: inset 0 2px 10px rgba(0,0,0,0.5);
}

.fcd-prem-pane {
    display: none;
    width: 100%;
    animation: fcdFadeIn 0.3s ease;
}

.fcd-prem-pane.active {
    display: block;
}

@keyframes fcdFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.fcd-code-label {
    font-size: 13px;
    color: #475569;
    margin-bottom: 15px;
    font-weight: 500;
}

.fcd-prem-pane textarea {
    width: 100%;
    background: transparent;
    border: none;
    color: #7dd3fc;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 22px;
    text-align: center;
    resize: none;
    outline: none;
    min-height: 80px;
}

.fcd-prem-modal-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(255, 255, 255, 0.02);
    margin: -40px -40px -40px -40px;
    padding: 25px 40px;
    margin-top: 5px;
}

.fcd-footer-hint {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #475569;
    font-size: 13px;
}

.fcd-footer-hint i { color: #38bdf8; }

.fcd-prem-apply-btn {
    background: #38bdf8;
    color: #020617;
    border: none;
    padding: 14px 30px;
    border-radius: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.fcd-prem-apply-btn:hover {
    background: white;
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(56, 189, 248, 0.2);
}

/* =========================================================
   MOBILE RESPONSIVE FIXES - Full Coverage
   ========================================================= */

/* Base: Prevent horizontal scroll - scoped to FCD content areas */
.fcd-premium-grid-wrap,
.fcd-tool-page-wrapper,
.fcd-premium-dashboard,
.fcd-frontend-grid {
    max-width: 100%;
    overflow-x: hidden;
}

/* ---- Tool Grid: Mobile Fix ---- */
.fcd-frontend-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}

.fcd-premium-grid-wrap {
    margin: 20px 0;
}

/* Search Box: Remove fixed min-width causing overflow */
.fcd-search-box {
    min-width: 0 !important;
    flex: 1 1 100%;
}

/* ---- Tablet (max 900px) ---- */
@media (max-width: 900px) {
    .fcd-frontend-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 16px !important;
    }

    .fcd-dash-grid {
        grid-template-columns: 1fr !important;
    }

    .fcd-builder-layout {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .fcd-premium-dashboard {
        padding: 24px !important;
    }

    .fcd-dash-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 16px !important;
    }
}

/* ---- Mobile (max 768px) ---- */
@media (max-width: 768px) {

    /* Tool Grid: 2 columns on most phones */
    .fcd-frontend-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
        margin: 16px 0 !important;
    }

    /* Tool Card: compact on mobile */
    .fcd-tool-card {
        padding: 16px !important;
        border-radius: 14px !important;
    }

    .fcd-tool-card .card-icon {
        width: 48px !important;
        height: 48px !important;
        min-width: 48px !important;
        min-height: 48px !important;
        border-radius: 12px !important;
        margin-bottom: 12px !important;
    }

    .fcd-tool-card h3 {
        font-size: 14px !important;
        margin-bottom: 6px !important;
        line-height: 1.3 !important;
    }

    .fcd-tool-card p {
        font-size: 12px !important;
        line-height: 1.5 !important;
    }

    .fcd-tool-card .card-footer {
        margin-top: 12px !important;
        padding-top: 10px !important;
        height: auto !important;
    }

    .tool-cat-tag {
        font-size: 10px !important;
    }

    .open-link {
        font-size: 12px !important;
    }

    /* Grid Controls */
    .fcd-grid-controls {
        flex-direction: column !important;
        align-items: stretch !important;
        gap: 12px !important;
        margin-bottom: 16px !important;
    }

    .fcd-search-box {
        width: 100% !important;
        min-width: 0 !important;
    }

    .fcd-search-box input {
        width: 100% !important;
        box-sizing: border-box !important;
        font-size: 14px !important;
        padding: 10px 10px 10px 40px !important;
    }

    /* Filter Tabs: horizontal scroll */
    .fcd-filter-tabs {
        display: flex !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        gap: 8px !important;
        padding-bottom: 8px !important;
        scrollbar-width: none !important;
    }

    .fcd-filter-tabs::-webkit-scrollbar {
        display: none !important;
    }

    .fcd-filter-btn {
        flex-shrink: 0 !important;
        padding: 7px 14px !important;
        font-size: 13px !important;
        white-space: nowrap !important;
    }

    /* Premium Dashboard */
    .fcd-premium-dashboard {
        padding: 16px !important;
        border-radius: 14px !important;
        box-shadow: 0 4px 12px rgba(0,0,0,0.05) !important;
    }

    .fcd-dash-header {
        flex-direction: column !important;
        gap: 16px !important;
        padding-bottom: 16px !important;
        margin-bottom: 20px !important;
    }

    .user-info {
        gap: 12px !important;
    }

    .fcd-btn-upgrade {
        width: 100% !important;
        text-align: center !important;
        padding: 10px 16px !important;
    }

    .fcd-dash-grid {
        grid-template-columns: 1fr !important;
        gap: 16px !important;
    }

    .fcd-dash-card {
        padding: 16px !important;
        border-radius: 12px !important;
    }

    /* Auth Card */
    .fcd-auth-card {
        margin: 20px auto !important;
        padding: 24px 20px !important;
        border-radius: 16px !important;
        max-width: 100% !important;
        box-sizing: border-box !important;
    }

    .fcd-auth-card h2 {
        font-size: 22px !important;
    }

    /* Admin tabs nav: scrollable */
    .fcd-tabs-nav {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch !important;
        flex-wrap: nowrap !important;
        scrollbar-width: none !important;
    }

    .fcd-tabs-nav::-webkit-scrollbar {
        display: none !important;
    }

    .fcd-tab-btn {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
    }

    .fcd-tab-content {
        padding: 16px !important;
    }

    /* Builder layout single column */
    .fcd-builder-layout {
        grid-template-columns: 1fr !important;
    }

    .fcd-meta-grid {
        grid-template-columns: 1fr !important;
    }

    /* Icon Modal: full screen on mobile */
    .fcd-icon-modal,
    .fcd-premium-fa-modal {
        width: 100% !important;
        max-width: 100vw !important;
        height: 100% !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
    }

    .fcd-modal-main {
        flex-direction: column !important;
    }

    .fcd-modal-sidebar {
        width: 100% !important;
        border-right: none !important;
        border-bottom: 1px solid var(--fcd-border) !important;
        padding: 12px !important;
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        overflow-x: auto !important;
        gap: 6px !important;
    }

    .fcd-category-btn {
        white-space: nowrap !important;
        flex-shrink: 0 !important;
        padding: 8px 12px !important;
        font-size: 12px !important;
    }

    /* Premium Modal: tabs scrollable */
    .fcd-prem-modal-header {
        padding: 0 16px !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
    }

    .fcd-prem-tabs-wrap {
        overflow-x: auto !important;
        flex-wrap: nowrap !important;
        scrollbar-width: none !important;
    }

    .fcd-prem-tab {
        padding: 14px 16px !important;
        font-size: 11px !important;
        white-space: nowrap !important;
    }

    .fcd-prem-modal-body {
        padding: 20px 16px !important;
    }

    .fcd-prem-top-info {
        flex-direction: column !important;
        gap: 16px !important;
        margin-bottom: 20px !important;
    }

    .fcd-prem-sub-links {
        gap: 12px !important;
        flex-wrap: wrap !important;
    }

    .fcd-prem-live-preview {
        padding: 10px 16px !important;
    }

    .fcd-prem-code-container {
        padding: 20px !important;
    }

    .fcd-prem-modal-footer {
        flex-direction: column-reverse !important;
        gap: 12px !important;
        padding: 16px !important;
        margin: 0 !important;
    }

    .fcd-prem-apply-btn {
        width: 100% !important;
        text-align: center !important;
    }

    /* Settings section */
    .fcd-settings-section {
        padding: 16px !important;
    }

    /* Usage Badge */
    .fcd-usage-badge {
        font-size: 12px !important;
        padding: 6px 12px !important;
    }

    /* Auth links */
    .fcd-auth-links {
        flex-direction: column !important;
        gap: 10px !important;
    }
}

/* ---- Small Mobile (max 480px) ---- */
@media (max-width: 480px) {

    /* Tool Grid: 2 columns even on small screens */
    .fcd-frontend-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .fcd-tool-card {
        padding: 12px !important;
        border-radius: 12px !important;
    }

    .fcd-tool-card .card-icon {
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        min-height: 40px !important;
        border-radius: 10px !important;
        margin-bottom: 10px !important;
    }

    .fcd-tool-card h3 {
        font-size: 13px !important;
    }

    .fcd-tool-card p {
        font-size: 11px !important;
    }

    .fcd-premium-dashboard {
        padding: 12px !important;
    }

    .fcd-premium-grid-wrap {
        margin: 10px 0 !important;
    }
}

/* ---- Very Small Screens (max 360px) ---- */
@media (max-width: 360px) {
    .fcd-frontend-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 8px !important;
    }

    .fcd-tool-card {
        padding: 10px !important;
    }

    .fcd-tool-card h3 {
        font-size: 12px !important;
    }

    .fcd-tool-card p,
    .open-link,
    .tool-cat-tag {
        display: none !important;
    }

    .fcd-tool-card .card-footer {
        display: none !important;
    }

    .fcd-tool-card .card-icon {
        margin-bottom: 8px !important;
    }
}
