/* Sites Section Styles */
#sites-section {
    background: #1e1e1e;
    width: 100%;
    margin-top: 100px;
}

#sites-section main {
    width: 100vw;
    height: 100vh;
    padding: 0;
    margin: 0;
    position: fixed;
    top: 0;
    left: 0;
}

.sites-container {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Mode Toggle inside GrapeJS panels */
.gjs-mode-toggle-container {
    display: flex !important;
    align-items: center;
    padding: 0 8px;
    visibility: visible !important;
    opacity: 1 !important;
}

.gjs-mode-toggle {
    display: flex;
    gap: 4px;
}

/* Style panel buttons for mode toggle */
#mode-toggle-web,
#mode-toggle-email {
    padding: 4px 8px !important;
    margin: 0 2px !important;
    border: 1px solid #404040 !important;
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
    border-radius: 3px !important;
    cursor: pointer !important;
    font-size: 12px !important;
    visibility: visible !important;
    opacity: 1 !important;
    display: inline-block !important;
}

#mode-toggle-web:hover,
#mode-toggle-email:hover {
    background: #3d3d3d !important;
    border-color: #667eea !important;
}

#mode-toggle-web.active,
#mode-toggle-email.active {
    background: #667eea !important;
    color: white !important;
    border-color: #667eea !important;
}

.gjs-mode-btn {
    padding: 4px 8px;
    border: 1px solid #404040;
    background: #2d2d2d;
    color: #e0e0e0;
    border-radius: 3px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.2s ease;
}

.gjs-mode-btn:hover {
    background: #3d3d3d;
    border-color: #667eea;
}

.gjs-mode-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* GrapeJS Editor Container */
#gjs {
    width: 100%;
    height: 100%;
    position: absolute !important;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Override GrapeJS styles for better integration */
.gjs-editor {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    height: 100% !important;
    width: 100% !important;
    display: flex !important;
    background: #1e1e1e !important;
    color: #e0e0e0 !important;
}

.gjs-cv-canvas {
    height: 100% !important;
    flex: 1 !important;
}

.gjs-pn-panels {
    background: #2d2d2d !important;
    border-color: #404040 !important;
}

.gjs-pn-panel {
    background: #2d2d2d !important;
    border-color: #404040 !important;
}

.gjs-pn-btn {
    color: #e0e0e0 !important;
}

.gjs-pn-btn:hover {
    background: #3d3d3d !important;
}

.gjs-block {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
    border-color: #404040 !important;
}

.gjs-block:hover {
    background: #3d3d3d !important;
}

.gjs-sm-sector {
    background: #2d2d2d !important;
    border-color: #404040 !important;
}

.gjs-sm-property {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
}

.gjs-sm-property input,
.gjs-sm-property select {
    background: #1e1e1e !important;
    color: #e0e0e0 !important;
    border-color: #404040 !important;
}

.gjs-layer {
    background: #2d2d2d !important;
    color: #e0e0e0 !important;
}

.gjs-layer:hover {
    background: #3d3d3d !important;
}

.gjs-cv-canvas {
    background: #1e1e1e !important;
}

.gjs-frame {
    background: #1e1e1e !important;
}

.gjs-toolbar {
    background: #2d2d2d !important;
}

.gjs-toolbar-item {
    color: #e0e0e0 !important;
}

.gjs-toolbar-item:hover {
    background: #3d3d3d !important;
}

/* Custom styles for better UX */
.sites-section-header {
    display: none; /* Hide if not needed, or style as needed */
}

/* Project List View */
.sites-project-list {
    width: 100%;
    height: 100%;
    padding: 40px;
    overflow-y: auto;
}

.sites-project-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.sites-project-list-header h2 {
    color: #e0e0e0;
    font-size: 28px;
    font-weight: 600;
    margin: 0;
}

/* View Toggle */
.sites-view-toggle {
    display: flex;
    gap: 8px;
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 4px;
}

.sites-view-toggle-btn {
    background: transparent;
    border: none;
    color: #a0a0a0;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sites-view-toggle-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    color: #e0e0e0;
}

.sites-view-toggle-btn.active {
    background: #667eea;
    color: white;
}

.sites-view-toggle-btn i {
    font-size: 18px;
}

/* Table View */
.sites-projects-table-container {
    background: transparent;
    box-shadow: none;
    border: 0.5px solid #c1c1c1;
    overflow-x: auto;
    margin-bottom: 20px;
}

#sites-projects-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#sites-projects-table th,
#sites-projects-table td {
    text-align: left;
    vertical-align: top;
    padding: 12px;
}

#sites-projects-table th {
    background: none !important;
    color: #495057;
    font-weight: lighter;
    font-size: 7px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    position: sticky;
    top: 0;
    height: 20px;
    padding: 5px;
    z-index: 10;
    border: none;
}

#sites-projects-table tbody tr {
    transition: all 0.2s ease;
    cursor: pointer;
}

#sites-projects-table tbody tr:nth-child(odd) {
    background-color: #fafafa;
}

#sites-projects-table tbody tr:nth-child(even) {
    background-color: #f8f9ff;
}

#sites-projects-table tbody tr:hover {
    background-color: #e3f2fd;
    transform: translateY(-1px);
}

.sites-project-row {
    cursor: pointer;
}

/* Description column max-width */
#sites-projects-table td:nth-child(3) {
    max-width: 500px;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Project image cell */
#sites-projects-table .project-image-cell {
    width: 80px;
}

#sites-projects-table .project-table-image {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

#sites-projects-table .project-table-image-placeholder {
    color: #999;
    font-size: 0.85rem;
    padding: 10px;
    display: inline-block;
}

/* Skills pills styling (reuse from projects.css) */
#sites-projects-table .skills-cell {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}

#sites-projects-table .skill-pill {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
    background-color: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
    white-space: nowrap;
    line-height: 1.3;
}

/* Status badge styling (reuse from projects.css) */
#sites-projects-table .status-badge {
    display: inline-block;
    padding: 2px 12px;
    border-radius: 20px;
    font-size: 10px !important;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#sites-projects-table .status-active {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

#sites-projects-table .status-completed {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

#sites-projects-table .status-on-hold {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeaa7;
}

#sites-projects-table .status-cancelled {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.sites-projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
}

.sites-project-card {
    background: #2d2d2d;
    border: 1px solid #404040;
    border-radius: 8px;
    padding: 24px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sites-project-card:hover {
    background: #3d3d3d;
    border-color: #667eea;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.2);
}

.sites-project-card-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.sites-project-card-title {
    color: #e0e0e0;
    font-size: 18px;
    font-weight: 600;
    margin: 0;
}

.sites-project-card-client {
    color: #a0a0a0;
    font-size: 14px;
    margin: 0;
}

.sites-project-card-description {
    color: #c0c0c0;
    font-size: 14px;
    margin: 8px 0 0 0;
    line-height: 1.5;
}

.sites-empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

.sites-empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #495057;
}

.sites-empty-state p {
    font-size: 16px;
    margin-bottom: 30px;
}

/* Empty state in table */
#sites-projects-table .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #6c757d;
}

#sites-projects-table .empty-state h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #495057;
}

#sites-projects-table .empty-state p {
    font-size: 16px;
    margin-bottom: 30px;
}

/* Project Editor View */
.sites-project-editor {
    width: 100%;
    height: 100%;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

/* Editor Header with Back Button */
.sites-editor-header {
    padding: 16px 24px;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
    display: flex;
    align-items: center;
}

.sites-back-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: transparent;
    border: 1px solid #404040;
    border-radius: 6px;
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sites-back-btn:hover {
    background: rgba(102, 126, 234, 0.1);
    border-color: #667eea;
    color: #667eea;
}

.sites-back-btn i {
    font-size: 18px;
}

.sites-editor-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-left: auto;
}

.sites-project-name {
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 500;
}

.sites-save-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: #667eea;
    border: none;
    border-radius: 6px;
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sites-save-btn:hover {
    background: #5568d3;
    transform: translateY(-1px);
}

.sites-save-btn:disabled {
    background: #4a4a4a;
    cursor: not-allowed;
    transform: none;
}

.sites-save-btn.saving {
    background: #4a4a4a;
}

.sites-save-btn i {
    font-size: 18px;
}

/* Tab Selector */
.sites-tab-selector {
    display: flex;
    gap: 0;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
    padding: 0 20px;
    z-index: 10;
}

.sites-tab-btn {
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    color: #a0a0a0;
    padding: 16px 24px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sites-tab-btn:hover {
    color: #e0e0e0;
    background: rgba(102, 126, 234, 0.1);
}

.sites-tab-btn.active {
    color: #667eea;
    border-bottom-color: #667eea;
    background: rgba(102, 126, 234, 0.05);
}

/* Tab Panels */
.sites-tab-panels {
    flex: 1;
    position: relative;
    overflow: hidden;
}

.sites-tab-panel {
    display: none;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
}

.sites-tab-panel.active {
    display: block;
}

/* No Code Tab (GrapeJS) */
#sites-tab-no-code.active {
    display: block;
}

#sites-tab-no-code #gjs {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
}

/* Vibe Code Tab - Split Layout */
#sites-tab-vibe-code.active {
    display: flex;
    flex-direction: row;
    background: #1e1e1e;
    overflow: hidden;
}

/* Code Editor Panel */
.vibe-code-editor-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-right: 1px solid #404040;
    min-width: 0;
}

.vibe-code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
}

.vibe-code-header h3 {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
}

.sites-code-copy-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.sites-code-copy-btn:hover {
    background: #5568d3;
}

.vibe-code-content-wrapper {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.sites-code-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    margin: 0;
    padding: 16px;
    background: #1a1a1a;
    color: #e0e0e0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 12px;
    line-height: 1.6;
    overflow: auto;
    white-space: pre;
    word-wrap: normal;
}

.sites-code-content code {
    display: block;
    color: #e0e0e0;
    font-family: inherit;
}

/* AI Chat Panel */
.vibe-chat-panel {
    width: 380px;
    min-width: 320px;
    display: flex;
    flex-direction: column;
    background: #252525;
}

.vibe-chat-header {
    padding: 12px 20px;
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
}

.vibe-chat-header h3 {
    color: #e0e0e0;
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.vibe-chat-header h3 i {
    color: #667eea;
    font-size: 18px;
}

.vibe-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.vibe-chat-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 40px 20px;
    color: #888;
}

.vibe-chat-welcome-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.vibe-chat-welcome-icon i {
    font-size: 28px;
    color: white;
}

.vibe-chat-welcome h4 {
    color: #e0e0e0;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.vibe-chat-welcome p {
    color: #888;
    font-size: 13px;
    line-height: 1.5;
    margin: 0;
}

/* Chat Messages */
.vibe-chat-message {
    display: flex;
    gap: 10px;
    animation: messageSlideIn 0.2s ease;
}

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

.vibe-chat-message.user {
    flex-direction: row-reverse;
}

.vibe-chat-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.vibe-chat-message.user .vibe-chat-message-avatar {
    background: #667eea;
    color: white;
}

.vibe-chat-message.assistant .vibe-chat-message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.vibe-chat-message-content {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    line-height: 1.5;
}

.vibe-chat-message.user .vibe-chat-message-content {
    background: #667eea;
    color: white;
    border-bottom-right-radius: 4px;
}

.vibe-chat-message.assistant .vibe-chat-message-content {
    background: #333;
    color: #e0e0e0;
    border-bottom-left-radius: 4px;
}

/* Chat Input */
.vibe-chat-input-container {
    padding: 12px 16px;
    background: #2d2d2d;
    border-top: 1px solid #404040;
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.vibe-chat-input {
    flex: 1;
    padding: 10px 14px;
    background: #1e1e1e;
    border: 1px solid #404040;
    border-radius: 8px;
    color: #e0e0e0;
    font-size: 13px;
    line-height: 1.4;
    resize: none;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.vibe-chat-input:focus {
    outline: none;
    border-color: #667eea;
}

.vibe-chat-input::placeholder {
    color: #666;
}

.vibe-chat-send-btn {
    width: 40px;
    height: 40px;
    background: #667eea;
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.vibe-chat-send-btn:hover {
    background: #5568d3;
    transform: scale(1.05);
}

.vibe-chat-send-btn:disabled {
    background: #4a4a4a;
    cursor: not-allowed;
    transform: none;
}

