﻿
/* ========================================
   HEADER ACTIONS (Recommendation 1)
   ======================================== */

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 40px;
    gap: 20px;
}

.title-section {
    flex: 1;
}

.header-actions {
    display: flex;
    gap: 12px;
    flex-shrink: 0;
}

.header-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.2s;
    background: white;
    color: var(--primary2, #0077cc);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

    .header-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    }

    .header-btn svg {
        flex-shrink: 0;
    }

.save-btn:hover {
    background: #28a745;
    color: white;
}

.saveas-btn:hover {
    background: #17a2b8;
    color: white;
}

.load-btn:hover {
    background: #007bff;
    color: white;
}

/* ========================================
   PROJECTS SIDEBAR (Recommendation 2)
   ======================================== */

.projects-sidebar {
    position: fixed;
    left: -320px;
    top: 0;
    bottom: 0;
    width: 320px;
    background: white;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.1);
    z-index: 1040;
    transition: left 0.3s ease;
    display: flex;
    flex-direction: column;
}

    .projects-sidebar.active {
        left: 0;
    }

.projects-sidebar-header {
    background: linear-gradient(135deg, var(--primary2, #0077cc) 0%, #005aa3 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

    .projects-sidebar-header h3 {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 700;
    }

.close-sidebar-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 6px;
    color: white;
    padding: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

    .close-sidebar-btn:hover {
        background: rgba(255, 255, 255, 0.3);
    }

.projects-list {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
}

.projects-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
    color: #6c757d;
}

.project-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

    .project-item:hover {
        background: white;
        border-color: var(--primary2, #0077cc);
        transform: translateX(4px);
        box-shadow: 0 2px 8px rgba(0, 119, 204, 0.15);
    }

.project-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 8px;
}

.project-item-title {
    font-weight: 600;
    color: var(--text2, #1a1a1a);
    font-size: 1rem;
    margin: 0;
    flex: 1;
}

.project-item-delete {
    background: transparent;
    border: none;
    color: #dc3545;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
}

    .project-item-delete:hover {
        opacity: 1;
        background: #fff5f5;
    }

.project-item-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.85rem;
    color: #6c757d;
}

    .project-item-meta svg {
        width: 14px;
        height: 14px;
    }

.projects-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    opacity: 0;
    transition: opacity 0.3s ease;
}

    .projects-overlay.active {
        display: block;
        opacity: 1;
    }

/* Empty state */
.projects-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.projects-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.projects-empty h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #495057;
}

.projects-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* Responsive */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .header-actions {
        justify-content: stretch;
    }

    .header-btn {
        flex: 1;
        justify-content: center;
    }

    .projects-sidebar {
        width: 280px;
        left: -280px;
    }
}

/* ========================================
   PROJECT ITEM WITH THUMBNAIL
   ======================================== */

.project-item {
    display: flex;
    gap: 12px;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 12px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

    .project-item:hover {
        background: white;
        border-color: var(--primary2, #0077cc);
        transform: translateX(4px);
        box-shadow: 0 2px 8px rgba(0, 119, 204, 0.15);
    }

.project-item-thumbnail {
    width: 160px; /* ← Was 80px */
    height: 50px; /* ← Was 60px */
    flex-shrink: 0;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
}

    .project-item-thumbnail img {
        width: 100%;
        height: 100%;
        object-fit: cover;
        position: absolute;
        top: 0;
        left: 0;
    }

.project-item-icon {
    font-size: 2rem;
    opacity: 0.8;
    z-index: 1;
}

.project-item-content {
    flex: 1;
    min-width: 0; /* Allows text truncation */
}

.project-item-header {
    display: flex;
    justify-content: space-between;
    align-items: start;
    margin-bottom: 6px;
    gap: 8px;
}

.project-item-title {
    font-weight: 600;
    color: var(--text2, #1a1a1a);
    font-size: 0.95rem;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex: 1;
}

.project-item-delete {
    background: transparent;
    border: none;
    color: #dc3545;
    padding: 2px 6px;
    border-radius: 4px;
    cursor: pointer;
    opacity: 0.7;
    transition: all 0.2s;
    flex-shrink: 0;
    font-size: 1rem;
}

    .project-item-delete:hover {
        opacity: 1;
        background: #fff5f5;
    }

.project-item-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: #6c757d;
}

    .project-item-meta svg {
        width: 12px;
        height: 12px;
        flex-shrink: 0;
    }

/* Projects loading and empty states */
.projects-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
    color: #6c757d;
}

.projects-empty {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
}

.projects-empty-icon {
    font-size: 3rem;
    margin-bottom: 16px;
    opacity: 0.5;
}

.projects-empty h4 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    color: #495057;
}

.projects-empty p {
    font-size: 0.9rem;
    margin: 0;
}

/* ========================================
   PROJECT ACTIONS CONTAINER - LEFT ALIGNED
   ======================================== */

.project-actions-container {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 16px;
    padding: 16px 32px;
    margin-bottom: 32px;
    box-shadow: 0 4px 20px rgba(0, 119, 204, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 119, 204, 0.1);
    position: relative;
    overflow: hidden;
}

    .project-actions-container::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-image: repeating-linear-gradient( 45deg, transparent, transparent 50px, rgba(0, 119, 204, 0.02) 50px, rgba(0, 119, 204, 0.02) 100px );
        pointer-events: none;
    }

.actions-inner {
    position: relative;
    z-index: 1;
    display: flex;
    justify-content: flex-start; /* LEFT ALIGNED */
    /*justify-content: center;*/ /* CENTER ALIGNED */
}

.actions-buttons {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}

.actions-divider {
    width: 1px;
    height: 28px;
    background: linear-gradient( to bottom, transparent, rgba(0, 119, 204, 0.3) 50%, transparent );
    margin: 0 6px;
    flex-shrink: 0;
}

/* Button Styles */
.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 18px;
    border: 2px solid transparent;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: white;
    color: var(--text2, #1a1a1a);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.05);
    position: relative;
    overflow: hidden;
    white-space: nowrap;
}

    .action-btn svg {
        flex-shrink: 0;
        transition: transform 0.3s ease;
    }

    .action-btn span {
        font-weight: 600;
    }

    /* Ripple effect */
    .action-btn::before {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(0, 119, 204, 0.1);
        transform: translate(-50%, -50%);
        transition: width 0.6s, height 0.6s;
    }

    .action-btn:active::before {
        width: 300px;
        height: 300px;
    }

    /* Hover effects */
    .action-btn:hover {
        transform: translateY(-2px);
        box-shadow: 0 8px 20px rgba(0, 119, 204, 0.15), 0 3px 6px rgba(0, 0, 0, 0.08);
    }

        .action-btn:hover svg {
            transform: scale(1.1);
        }

    .action-btn:active {
        transform: translateY(0);
    }

/* Save button - primary action */
.btn-save {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    border-color: #10b981;
}

    .btn-save:hover {
        background: linear-gradient(135deg, #059669 0%, #047857 100%);
        box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3), 0 3px 6px rgba(0, 0, 0, 0.08);
    }

/* New button */
.btn-new {
    background: white;
    border-color: #e2e8f0;
}

    .btn-new:hover {
        border-color: var(--primary2, #0077cc);
        color: var(--primary2, #0077cc);
    }

/* Load button */
.btn-load {
    background: white;
    border-color: #e2e8f0;
}

    .btn-load:hover {
        border-color: var(--primary2, #0077cc);
        color: var(--primary2, #0077cc);
    }

/* Save As button */
.btn-saveas {
    background: white;
    border-color: #e2e8f0;
}

    .btn-saveas:hover {
        border-color: #94a3b8;
        background: #f8fafc;
    }

/* Responsive Design */
@media (max-width: 768px) {
    .project-actions-container {
        padding: 12px 20px;
        border-radius: 12px;
    }

    .actions-inner {
        justify-content: center;
    }

    .actions-buttons {
        gap: 8px;
    }

    .action-btn {
        padding: 9px 14px;
        font-size: 0.85rem;
    }

        .action-btn svg {
            width: 16px;
            height: 16px;
        }
}

@media (max-width: 640px) {
    .actions-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .action-btn span {
        display: none;
    }

    .action-btn {
        padding: 10px;
        flex: 1;
    }

    .actions-divider {
        display: none;
    }
}

@media (max-width: 480px) {
    .actions-buttons {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 8px;
    }

    .action-btn {
        width: 100%;
    }

    .actions-divider {
        display: none;
    }
}
