/* Social Profiles Section Styles - Modern & Cool Design */
#profiles-section {
    position: relative;
    z-index: 2;
    display: none;
    padding-top: 90px;
    width: 100%;
    margin: 0;
    box-sizing: border-box;
}

#profiles-section.active {
    display: block;
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

#profiles-section main {
    padding: 0;
    width: 100%;
    box-sizing: border-box;
}

.profiles-container {
    width: 100%;
    padding: 0 24px;
    box-sizing: border-box;
}

/* Add Profile button in global header */
.section-buttons .add-profile-button {
    background: transparent;
    color: #6c757d;
    border: 0.5px solid #c1c1c1;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
    box-shadow: none;
}

.section-buttons .add-profile-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.section-buttons .add-profile-button i {
    font-size: 16px;
}

/* Profiles Grid */
.profiles-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 24px;
    margin-bottom: 32px;
    align-items: stretch;
}

/* Profile Card */
.profile-card {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 20px;
    padding: 24px;
    box-shadow: 
        0 4px 24px rgba(0, 0, 0, 0.06),
        0 1px 2px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.8);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Platform-specific top border colors */
.profile-card[data-platform="instagram"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #E4405F, #F56040, #FCAF45, #FFDC80);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card[data-platform="facebook"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #1877F2;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card[data-platform="twitter"]::before,
.profile-card[data-platform="x"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #000000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card[data-platform="linkedin"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #0077B5;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card[data-platform="youtube"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #FF0000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card[data-platform="tiktok"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, #000000, #FF0050);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card[data-platform="pinterest"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #BD081C;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card[data-platform="threads"]::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: #000000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.profile-card:hover {
    transform: translateY(-4px);
    box-shadow: 
        0 12px 40px rgba(0, 0, 0, 0.15),
        0 4px 12px rgba(0, 0, 0, 0.08);
}

.profile-card:hover::before {
    opacity: 1;
}

.profile-card-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 16px;
    position: relative;
    padding-right: 90px; /* Make room for badges in top-right */
}

.profile-avatar {
    width: 56px;
    height: 56px;
    min-width: 56px;
    min-height: 56px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    flex-shrink: 0;
    overflow: hidden;
    position: relative;
    font-size: 0;
    line-height: 0;
}

/* Platform-specific avatar backgrounds */
.profile-avatar[data-platform="instagram"] {
    background: linear-gradient(135deg, #E4405F 0%, #F56040 50%, #FCAF45 100%);
}

.profile-avatar[data-platform="facebook"] {
    background: #1877F2;
}

.profile-avatar[data-platform="twitter"],
.profile-avatar[data-platform="x"] {
    background: #000000;
}

.profile-avatar[data-platform="linkedin"] {
    background: #0077B5;
}

.profile-avatar[data-platform="youtube"] {
    background: #FF0000;
}

.profile-avatar[data-platform="tiktok"] {
    background: linear-gradient(135deg, #000000 0%, #FF0050 100%);
}

.profile-avatar[data-platform="pinterest"] {
    background: #BD081C;
}

.profile-avatar[data-platform="threads"] {
    background: #000000;
}

.profile-avatar i {
    font-size: 28px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-style: normal;
    font-weight: normal;
    speak: none;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    color: white !important;
}

.profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 14px;
    display: block;
}

.profile-info {
    flex: 1;
    min-width: 0;
    padding-right: 0;
    position: relative;
    display: flex;
    flex-direction: column;
    min-height: 80px;
}

.profile-username {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.profile-username .verified-badge {
    display: inline-flex;
    align-items: center;
    color: #667eea;
    font-size: 14px;
}

.profile-username .primary-badge {
    padding: 2px 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-radius: 6px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.primary-badge.standalone {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 8px;
}

.profile-display-name {
    font-size: 14px;
    color: #6b7280;
    margin: 0 0 8px 0;
    font-weight: 500;
}

.profile-bio {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 39px;
    max-height: 39px;
}

.profile-stats {
    display: flex;
    gap: 16px;
    margin-top: auto;
    padding-top: 16px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.profile-stat {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.profile-stat-value {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a2e;
}

.profile-stat-label {
    font-size: 11px;
    color: #6b7280;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.profile-badges-container {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: flex-end;
    z-index: 1;
}

.profile-status-badge {
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    white-space: nowrap;
}

.profile-status-badge.active {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.profile-status-badge.inactive {
    background: rgba(107, 114, 128, 0.1);
    color: #6b7280;
}

.profile-actions {
    position: absolute;
    top: 24px;
    right: 24px;
    display: flex;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.profile-card:hover .profile-actions {
    opacity: 1;
}

.profile-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.profile-action-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.profile-action-btn.edit {
    color: #667eea;
}

.profile-action-btn.delete {
    color: #ef4444;
}

/* Empty State */
.profiles-empty-state {
    text-align: center;
    padding: 80px 24px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    border: 2px dashed rgba(102, 126, 234, 0.2);
}

.empty-state-icon {
    width: 80px;
    height: 80px;
    margin: 0 auto 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 40px;
}

.profiles-empty-state h3 {
    font-size: 24px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0 0 8px 0;
}

.profiles-empty-state p {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 24px 0;
}

.add-profile-btn-empty {
    padding: 14px 28px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 14px;
    cursor: pointer;
    font-size: 15px;
    font-weight: 600;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.35);
    white-space: nowrap;
    margin: 0 auto;
}

.add-profile-btn-empty:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.45);
}

.add-profile-btn-empty:active {
    transform: translateY(0);
}

/* Modal */
.profile-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    overflow-y: auto;
}

.profile-modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* Connection Status Display */
.connection-status-display {
    padding: 20px;
    background: rgba(0, 0, 0, 0.02);
    border-radius: 12px;
    margin-bottom: 16px;
}

.connection-status-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.connection-status-indicator i {
    font-size: 12px;
    color: #6b7280;
}

.connection-status-indicator.connected i {
    color: #10b981;
}

.connection-description {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

.connect-btn {
    width: 100%;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.35);
}

.connect-btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.45);
}

.connect-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Status Messages */
.profiles-status-message {
    position: fixed;
    bottom: 30px;
    right: 30px;
    padding: 16px 24px;
    border-radius: 14px;
    font-size: 14px;
    font-weight: 500;
    display: none;
    z-index: 1001;
    animation: slideInUp 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
}

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

.profiles-status-message.success {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    display: block;
}

.profiles-status-message.error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    display: block;
}

/* Responsive */
@media (max-width: 768px) {
    #profiles-section {
        padding: 70px 0 0 0;
    }
    
    #profiles-section main {
        padding: 0;
    }
    
    .profiles-container {
        padding: 0 16px;
    }

    .profiles-grid {
        grid-template-columns: 1fr;
    }

    .profile-stats {
        flex-wrap: wrap;
        gap: 12px;
    }
}

/* ==========================================
   Dark Mode Support
   ========================================== */

body.dark-mode #profiles-section {
    background: #0a0a0a;
}

body.dark-mode .profile-card {
    background: #171717;
    border-color: rgba(255, 255, 255, 0.06);
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.3);
}

body.dark-mode .profile-card:hover {
    box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
}

body.dark-mode .profile-username {
    color: #f1f1f1;
}

body.dark-mode .profile-display-name {
    color: #a1a1aa;
}

body.dark-mode .profile-bio {
    color: #a1a1aa;
}

body.dark-mode .profile-stats {
    border-top-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .profile-stat-value {
    color: #f1f1f1;
}

body.dark-mode .profile-stat-label {
    color: #a1a1aa;
}

body.dark-mode .profile-action-btn {
    background: #262626;
    color: #e5e5e5;
}

body.dark-mode .profiles-empty-state {
    background: rgba(23, 23, 23, 0.5);
    border-color: rgba(102, 126, 234, 0.3);
}

body.dark-mode .profiles-empty-state h3 {
    color: #f1f1f1;
}

body.dark-mode .profiles-empty-state p {
    color: #a1a1aa;
}

body.dark-mode .connection-status-display {
    background: rgba(255, 255, 255, 0.03);
}

body.dark-mode .connection-description {
    color: #a1a1aa;
}
