/* Landing Page Styles */

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 0;
    position: relative;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo-img {
    height: 50px;
    width: auto;
}

.header h1 {
    color: #2c3e50;
    font-size: 2.5rem;
    margin: 0;
    font-weight: 600;
}

.subtitle {
    color: #7f8c8d;
    font-size: 1.2rem;
    margin: 0;
    font-weight: 300;
}

/* Edit Mode Toggle */
.edit-mode-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
}

.btn-sm {
    padding: 8px 16px;
    font-size: 0.9rem;
}

/* Special Code Section */
.special-code-section {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.special-code-card {
    background: white;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 400px;
    width: 90%;
}

.special-code-card h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.special-code-card p {
    color: #7f8c8d;
    margin-bottom: 25px;
    line-height: 1.5;
}

.code-input-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

#special-code-input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

#special-code-input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

/* Loading State */
.loading {
    text-align: center;
    padding: 60px 20px;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading p {
    color: #7f8c8d;
    font-size: 1.1rem;
}

/* Error State */
.error {
    text-align: center;
    padding: 60px 20px;
    background: #fff5f5;
    border: 1px solid #fed7d7;
    border-radius: 12px;
    margin: 20px 0;
}

.error h2 {
    color: #e53e3e;
    margin-bottom: 15px;
}

.error p {
    color: #c53030;
    margin-bottom: 25px;
}

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

/* Edit Mode Styles */
.edit-mode .category-section {
    position: relative;
    border: 2px dashed #bdc3c7;
    background: #f8fafc;
}

.edit-mode .category-section:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.edit-mode .project-card {
    position: relative;
    border: 2px dashed #e1e8ed;
}

.edit-mode .project-card:hover {
    border-color: #3498db;
    background: #f0f8ff;
}

.edit-mode .project-card::before {
    content: '✏️';
    position: absolute;
    top: 5px;
    right: 5px;
    font-size: 0.8rem;
    opacity: 0.7;
}

.edit-mode .category-section::before {
    content: '📁';
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: 1rem;
    opacity: 0.7;
}

.edit-controls {
    position: absolute;
    top: 5px;
    right: 5px;
    display: flex;
    gap: 5px;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.edit-mode .category-section:hover .edit-controls,
.edit-mode .project-card:hover .edit-controls {
    opacity: 1;
}

.edit-btn {
    background: #3498db;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.edit-btn:hover {
    background: #2980b9;
}

.delete-btn {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 4px;
    padding: 4px 8px;
    font-size: 0.7rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.delete-btn:hover {
    background: #c0392b;
}

.category-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    border: 1px solid #e1e8ed;
}

.category-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #f1f3f4;
    position: relative;
    padding-left: 40px; /* Make room for drag handle */
}

.category-color {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    flex-shrink: 0;
}

.category-title {
    font-size: 1.4rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.projects-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.project-card {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    border: 2px solid transparent;
    border-radius: 8px;
    transition: all 0.2s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.project-card:hover {
    border-color: #3498db;
    background: #f8fafc;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.15);
}

.project-image {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    background: #f1f3f4;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 1.5rem;
    color: #7f8c8d;
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.project-info {
    flex: 1;
}

.project-name {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.project-description {
    font-size: 0.9rem;
    color: #7f8c8d;
    margin: 0;
    line-height: 1.4;
}

.project-arrow {
    color: #bdc3c7;
    font-size: 1.2rem;
    transition: all 0.2s ease;
}

.project-card:hover .project-arrow {
    color: #3498db;
    transform: translateX(3px);
}

/* Generic Option */
.generic-option {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e1e8ed;
}

.generic-card {
    text-align: center;
    background: #f8fafc;
    padding: 30px;
    border-radius: 12px;
    border: 2px dashed #bdc3c7;
}

.generic-card h2 {
    color: #2c3e50;
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.generic-card p {
    color: #7f8c8d;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* Buttons */
.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.btn-secondary {
    background: #95a5a6;
    color: white;
}

.btn-secondary:hover {
    background: #7f8c8d;
}

.btn-outline {
    background: transparent;
    color: #3498db;
    border: 2px solid #3498db;
}

.btn-outline:hover {
    background: #3498db;
    color: white;
}

/* Footer */
.footer {
    margin-top: auto;
    text-align: center;
    padding: 30px 0;
    border-top: 1px solid #e1e8ed;
    color: #7f8c8d;
}

.footer p {
    margin: 5px 0;
}

/* Modal Styles */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    padding: 20px;
}

.modal-content {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    max-width: 800px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
}

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

.modal-header h2 {
    margin: 0;
    color: #2c3e50;
    font-size: 1.5rem;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #7f8c8d;
    cursor: pointer;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background: #f1f3f4;
    color: #2c3e50;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 15px;
    padding: 20px 25px;
    border-top: 1px solid #e1e8ed;
    background: #f8fafc;
    border-radius: 0 0 12px 12px;
}

/* Form Styles */
.form-group {
    margin-bottom: 25px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
}

.form-group input,
.form-group textarea {
    width: 100%;
    min-width: auto;
    max-width: none;
    padding: 12px 16px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 80px;
}

.form-group small {
    display: block;
    margin-top: 5px;
    color: #7f8c8d;
    font-size: 0.85rem;
}

/* Color Input Group */
.color-input-group {
    display: flex;
    align-items: center;
    gap: 15px;
}

.color-input-group input[type="color"] {
    width: 60px;
    height: 40px;
    padding: 0;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    background: none;
}

.color-input-group input[type="color"]:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.color-preview {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 2px solid #e1e8ed;
    flex-shrink: 0;
}

/* Empty Category Message */
.empty-category-message {
    padding: 40px 20px;
    text-align: center;
}

.empty-state {
    color: #7f8c8d;
}

.empty-state .empty-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 15px;
}

.empty-state p {
    margin: 0 0 10px 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.empty-state small {
    margin: 0;
    font-size: 0.9rem;
    color: #95a5a6;
}

/* Image Upload */
.image-upload-area {
    border: 2px dashed #bdc3c7;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    background: #f8fafc;
}

.image-upload-area:hover {
    border-color: #3498db;
    background: #e3f2fd;
}

.image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.upload-icon {
    font-size: 2rem;
    color: #7f8c8d;
}

.upload-text {
    color: #7f8c8d;
    font-size: 1rem;
}

#project-image-preview {
    max-width: 100%;
    max-height: 200px;
    border-radius: 8px;
    margin: 0 auto;
}

/* Options Grid */
.options-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-top: 15px;
}

.options-column {
    background: #f8fafc;
    border: 1px solid #e1e8ed;
    border-radius: 8px;
    padding: 15px;
}

.options-column h4 {
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-size: 1rem;
    font-weight: 600;
    text-align: center;
    padding-bottom: 10px;
    border-bottom: 1px solid #e1e8ed;
}

.checkbox-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.checkbox-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 0;
}

.checkbox-item input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-item label {
    margin: 0;
    font-weight: normal;
    color: #2c3e50;
    font-size: 0.9rem;
    cursor: pointer;
    flex: 1;
    width: max-content
}

/* Alert Notifications */
.alert {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-weight: 500;
    animation: slideIn 0.3s ease-out;
}

.alert-success {
    background-color: #D1FAE5;
    color: #065F46;
    border: 1px solid #A7F3D0;
}

.alert-error {
    background-color: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    .header h1 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1rem;
    }
    
    .services-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-section {
        padding: 20px;
    }
    
    .project-card {
        padding: 12px;
    }
    
    .project-name {
        font-size: 1rem;
    }
    
    .project-description {
        font-size: 0.85rem;
    }
    
    .special-code-card {
        padding: 30px 20px;
    }
    
    .code-input-group {
        flex-direction: column;
    }
}

@media (max-width: 480px) {
    .logo {
        flex-direction: column;
        gap: 10px;
    }
    
    .logo-img {
        height: 40px;
    }
    
    .header h1 {
        font-size: 1.8rem;
    }
    
    .project-card {
        flex-direction: column;
        text-align: center;
        gap: 10px;
    }
    
    .project-arrow {
        transform: rotate(90deg);
    }
    
    .project-card:hover .project-arrow {
        transform: rotate(90deg) translateY(3px);
    }
    
    /* Modal responsive */
    .modal-content {
        margin: 10px;
        max-height: 95vh;
    }
    
    .options-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-header,
    .modal-footer {
        padding: 15px 20px;
    }
}

/* Drag and Drop Styles */
.drag-handle {
    cursor: grab;
    color: #666;
    font-size: 16px;
    padding: 5px;
    margin-right: 10px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
}

.drag-handle:hover {
    color: #333;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.drag-handle:active {
    cursor: grabbing;
}

.category-drag-handle {
    cursor: grab;
    color: #666;
    font-size: 16px;
    padding: 5px;
    margin-right: 10px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
}

.category-drag-handle:hover {
    color: #333;
    background-color: rgba(0, 0, 0, 0.1);
    border-radius: 3px;
}

.category-drag-handle:active {
    cursor: grabbing;
}

.project-card.sortable-ghost {
    opacity: 0.4;
    background-color: #f0f0f0;
}

.project-card.sortable-chosen {
    transform: rotate(2deg);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.project-card.sortable-drag {
    transform: rotate(5deg);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

.category-section.sortable-ghost {
    opacity: 0.4;
    background-color: #f0f0f0;
    border: 2px dashed #ccc;
}

.category-section.sortable-chosen {
    transform: scale(1.02);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.category-section.sortable-drag {
    transform: scale(1.05);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
}

/* Admin Controls */
.admin-controls {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.container.edit-mode .admin-controls {
    display: flex;
    gap: 5px;
}

.admin-controls button {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.admin-controls button:hover {
    background: #fff;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.admin-controls .btn-edit {
    color: #007bff;
}

.admin-controls .btn-delete {
    color: #dc3545;
}

.admin-controls .btn-delete:hover {
    background: #dc3545;
    color: white;
}

/* Category Admin Controls */
.category-admin-controls {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
}

.container.edit-mode .category-admin-controls {
    display: flex;
    gap: 5px;
}

.category-admin-controls button {
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid #ddd;
    border-radius: 3px;
    padding: 5px 8px;
    cursor: pointer;
    font-size: 12px;
    color: #666;
    transition: all 0.2s;
}

.category-admin-controls button:hover {
    background: #fff;
    color: #333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-admin-controls .btn-add-project {
    color: #28a745;
}

.category-admin-controls .btn-delete-category {
    color: #dc3545;
}

.category-admin-controls .btn-delete-category:hover {
    background: #dc3545;
    color: white;
}

/* Add New Category Button */
.add-category-btn {
    display: none;
    margin: 20px auto;
    padding: 15px 30px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    transition: all 0.2s;
}

.container.edit-mode .add-category-btn {
    display: block;
}

.add-category-btn:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

/* Delete Confirmation Modal */
.delete-confirmation-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.delete-confirmation-modal.show {
    display: flex;
}

.delete-confirmation-content {
    background: white;
    padding: 30px;
    border-radius: 8px;
    max-width: 400px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
}

.delete-confirmation-content h3 {
    margin: 0 0 15px 0;
    color: #dc3545;
}

.delete-confirmation-content p {
    margin: 0 0 20px 0;
    color: #666;
}

.delete-confirmation-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.delete-confirmation-buttons button {
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s;
}

.delete-confirmation-buttons .btn-cancel {
    background: #6c757d;
    color: white;
}

.delete-confirmation-buttons .btn-cancel:hover {
    background: #5a6268;
}

.delete-confirmation-buttons .btn-confirm {
    background: #dc3545;
    color: white;
}

.delete-confirmation-buttons .btn-confirm:hover {
    background: #c82333;
}
