/* ============================================
   AFRICAN HOME CUSTOMIZER - MODERN FLAT UI
   With Micro-Animations & Smooth Effects
   ============================================ */

/* Reset & Base Styles with System Font Stack */
.afc-social-manager * {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.afc-social-manager {
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    color: #1a202c;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
    padding: 30px;
    line-height: 1.6;
}

/* Modern Header with Gradient */
.afc-social-manager .wp-heading-inline {
    color: transparent;
    background: linear-gradient(90deg, #4f46e5 0%, #7c3aed 100%);
    -webkit-background-clip: text;
    background-clip: text;
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 40px;
    padding-bottom: 20px;
    border-bottom: 3px solid;
    border-image: linear-gradient(90deg, #4f46e5, #7c3aed) 1;
    display: flex;
    justify-content: space-between;
    align-items: center;
    letter-spacing: -0.5px;
}

/* Floating Action Button */
.afc-social-manager .page-title-action {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white !important;
    border: none;
    border-radius: 12px;
    padding: 14px 28px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.25);
    position: relative;
    overflow: hidden;
}

.afc-social-manager .page-title-action::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
}

.afc-social-manager .page-title-action:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.35);
}

.afc-social-manager .page-title-action:hover::before {
    left: 100%;
}

/* Modern Grid Container */
.afc-admin-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 30px;
    margin-top: 30px;
    perspective: 1000px;
}

/* Glassmorphism Card */
.afc-admin-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.08),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(255, 255, 255, 0.3);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    animation: cardSlideUp 0.6s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.afc-admin-card:hover {
    transform: translateY(-10px) rotateX(2deg) rotateY(2deg);
    box-shadow: 
        0 25px 60px rgba(0, 0, 0, 0.12),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.afc-admin-card h2 {
    color: #2d3748;
    font-size: 22px;
    font-weight: 800;
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 2px solid;
    border-image: linear-gradient(90deg, #e2e8f0, transparent) 1;
    position: relative;
}

.afc-admin-card h2::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    border-radius: 3px;
}

/* Modern Form Elements */
.afc-form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    align-items: end;
}

.afc-form-group {
    margin-bottom: 0;
    position: relative;
}

.afc-form-group label {
    display: block;
    color: #4a5568;
    font-weight: 600;
    margin-bottom: 10px;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.afc-select,
.afc-input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.9);
    color: #1a202c;
}

.afc-select:focus,
.afc-input:focus {
    outline: none;
    border-color: #4f46e5;
    box-shadow: 
        0 0 0 4px rgba(79, 70, 229, 0.15),
        inset 0 0 0 1px rgba(79, 70, 229, 0.1);
    transform: translateY(-2px);
}

/* Modern Select with Custom Arrow */
.afc-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%234f46e5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 20px center;
    background-size: 16px;
    padding-right: 50px;
    appearance: none;
    cursor: pointer;
}

/* Modern Button System */
.afc-admin-card .button {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 16px 32px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
    isolation: isolate;
    box-shadow: 0 8px 25px rgba(79, 70, 229, 0.25);
}

.afc-admin-card .button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: 0.5s;
    z-index: -1;
}

.afc-admin-card .button:hover {
    transform: translateY(-4px);
    box-shadow: 0 15px 35px rgba(79, 70, 229, 0.35);
}

.afc-admin-card .button:hover::before {
    left: 100%;
}

.afc-admin-card .button.button-link-delete {
    background: linear-gradient(135deg, #fecaca 0%, #fca5a5 100%);
    color: #dc2626;
    box-shadow: 0 8px 25px rgba(220, 38, 38, 0.15);
}

.afc-admin-card .button.button-small {
    padding: 12px 24px;
    font-size: 14px;
}

/* Modern Table Design */
.afc-social-list table.wp-list-table {
    border: none;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    background: white;
    transition: transform 0.3s ease;
}

.afc-social-list table.wp-list-table:hover {
    transform: translateY(-5px);
}

.afc-social-list table.wp-list-table thead {
    background: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.afc-social-list table.wp-list-table thead th {
    color: white;
    border: none;
    padding: 20px 15px;
    font-weight: 600;
    font-size: 14px;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

.afc-social-list table.wp-list-table thead th::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), transparent);
    transition: 0.5s;
}

.afc-social-list table.wp-list-table thead th:hover::before {
    left: 100%;
}

.afc-social-list table.wp-list-table tbody tr {
    border-bottom: 1px solid #f1f5f9;
    transition: all 0.3s ease;
}

.afc-social-list table.wp-list-table tbody tr:hover {
    background: linear-gradient(90deg, #f8fafc 0%, #f1f5f9 100%);
    transform: scale(1.01);
    box-shadow: inset 4px 0 0 #4f46e5;
}

.afc-social-list table.wp-list-table tbody td {
    padding: 20px 15px;
    vertical-align: middle;
    border: none;
    transition: padding 0.3s ease;
}

.afc-social-list table.wp-list-table tbody tr:hover td {
    padding-left: 25px;
}

/* Icon Display with Floating Animation */
.afc-list-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 20px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    animation: float 3s ease-in-out infinite;
}

.afc-list-icon:hover {
    transform: scale(1.1) rotate(5deg);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* Modern Badges */
.afc-icon-type-badge {
    display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    border: 1px solid;
}

.afc-icon-type-badge.custom {
    background: rgba(56, 189, 248, 0.1);
    color: #0284c7;
    border-color: rgba(56, 189, 248, 0.3);
}

.afc-icon-type-badge.fontawesome {
    background: rgba(34, 197, 94, 0.1);
    color: #16a34a;
    border-color: rgba(34, 197, 94, 0.3);
}

.afc-icon-type-badge:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

/* URL Links with Gradient Underline */
.afc-url {
    color: #4f46e5;
    text-decoration: none;
    font-size: 14px;
    word-break: break-all;
    display: inline-block;
    max-width: 250px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    position: relative;
    padding-bottom: 3px;
}

.afc-url::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #4f46e5, #7c3aed);
    transition: width 0.4s ease;
}

.afc-url:hover {
    color: #7c3aed;
}

.afc-url:hover::after {
    width: 100%;
}

/* Actions Container with Hover Effects */
.afc-actions {
    display: flex;
    gap: 10px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

tr:hover .afc-actions {
    opacity: 1;
}

/* Modern Notice Boxes */
.afc-admin-card .notice {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: none;
    border-radius: 12px;
    padding: 20px;
    margin: 0;
    position: relative;
    overflow: hidden;
    border-left: 5px solid #f59e0b;
    animation: slideInRight 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.afc-admin-card .notice::before {
    content: '💡';
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 24px;
    opacity: 0.3;
}

.afc-admin-card .notice p {
    margin: 0;
    color: #92400e;
    font-size: 14px;
    font-weight: 500;
}

/* Code Display with Typing Animation */
.afc-admin-card code {
    background: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
    color: #4f46e5;
    padding: 10px 16px;
    border-radius: 10px;
    font-family: 'JetBrains Mono', 'Fira Code', 'Monaco', monospace;
    font-size: 14px;
    border: 2px solid rgba(79, 70, 229, 0.1);
    display: inline-block;
    position: relative;
    overflow: hidden;
    animation: typewriter 2s steps(40) 1s 1 normal both;
}

/* Metabox with Glass Effect */
.afc-social-metabox {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    padding: 25px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Custom Icon Upload with Drag & Drop Effect */
.custom-icon-upload {
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 3px dashed #cbd5e0;
    border-radius: 16px;
    padding: 40px 30px;
    text-align: center;
    transition: all 0.4s ease;
    position: relative;
    overflow: hidden;
}

.custom-icon-upload::before {
    content: '📤';
    font-size: 48px;
    opacity: 0.3;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    transition: all 0.4s ease;
}

.custom-icon-upload:hover {
    border-color: #4f46e5;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    transform: translateY(-5px);
}

.custom-icon-upload:hover::before {
    opacity: 0.5;
    transform: translate(-50%, -50%) scale(1.1);
}

#custom-icon-preview img {
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.15);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

#custom-icon-preview img:hover {
    transform: scale(1.05) rotate(2deg);
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
}

/* Preview Section with Neumorphism */
.afc-preview {
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f2fe 100%);
    border-radius: 16px;
    padding: 25px;
    margin-top: 25px;
    border: 1px solid rgba(186, 230, 253, 0.5);
    box-shadow: 
        inset 0 2px 5px rgba(255, 255, 255, 0.8),
        0 5px 20px rgba(14, 165, 233, 0.1);
}

.afc-preview h4 {
    color: #0369a1;
    margin-bottom: 20px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.afc-social-preview {
    display: flex;
    align-items: center;
    gap: 20px;
    animation: slideInLeft 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.afc-social-preview-icon {
    width: 70px;
    height: 70px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    color: white;
    box-shadow: 
        0 15px 35px rgba(0, 0, 0, 0.15),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.afc-social-preview-icon:hover {
    transform: scale(1.1) rotate(10deg);
    box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .afc-admin-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .afc-social-manager {
        padding: 20px;
    }
    
    .afc-form-grid {
        grid-template-columns: 1fr;
    }
    
    .afc-social-manager .wp-heading-inline {
        flex-direction: column;
        align-items: flex-start;
        gap: 20px;
    }
    
    .afc-admin-card {
        padding: 25px;
    }
}

/* Keyframe Animations */
@keyframes cardSlideUp {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-10px);
    }
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes typewriter {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

/* Status Indicators with Pulse Animation */
.status-active {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #10b981;
    margin-right: 10px;
    animation: pulse 2s infinite;
}

.status-inactive {
    display: inline-block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #ef4444;
    margin-right: 10px;
}

@keyframes pulse {
    0% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    70% {
        box-shadow: 0 0 0 10px rgba(16, 185, 129, 0);
    }
    100% {
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0);
    }
}

/* Loading Skeleton Animation */
.afc-loading-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 8px;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Ripple Effect for Buttons */
.ripple {
    position: relative;
    overflow: hidden;
}

.ripple::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 5px;
    background: rgba(255, 255, 255, 0.6);
    opacity: 0;
    border-radius: 100%;
    transform: scale(1, 1) translate(-50%);
    transform-origin: 50% 50%;
}

.ripple:focus:not(:active)::after {
    animation: ripple 1s ease-out;
}

@keyframes ripple {
    0% {
        transform: scale(0, 0);
        opacity: 0.5;
    }
    20% {
        transform: scale(60, 60);
        opacity: 0.3;
    }
    100% {
        opacity: 0;
        transform: scale(100, 100);
    }
}

/* Hover Glow Effect */
.hover-glow {
    transition: box-shadow 0.3s ease;
}

.hover-glow:hover {
    box-shadow: 0 0 30px rgba(79, 70, 229, 0.3);
}