/**
 * Document Maker Pro - Main Styles
 */

/* Gallery Styles */
.dm-gallery {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dm-gallery-filters {
    display: flex;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    align-items: center;
}

.dm-search input {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    min-width: 250px;
}

.dm-filters select {
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
}

.dm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 2rem;
}

.dm-template-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.dm-template-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.dm-template-image {
    height: 200px;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.dm-template-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dm-template-placeholder {
    color: #6b7280;
    font-size: 0.875rem;
}

.dm-template-info {
    padding: 1rem;
}

.dm-template-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.dm-template-info p {
    margin: 0 0 1rem 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.dm-template-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.dm-template-size,
.dm-template-category {
    background: #e5e7eb;
    color: #374151;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
}

.dm-template-actions {
    padding: 1rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    gap: 0.5rem;
}

/* My Documents Styles */
.dm-my-documents {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem;
}

.dm-my-documents-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.dm-my-documents-header h2 {
    margin: 0;
    font-size: 1.875rem;
    font-weight: 700;
    color: #111827;
}

.dm-my-documents-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
}

.dm-document-card {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    padding: 1.5rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: box-shadow 0.2s;
}

.dm-document-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.dm-document-info h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.dm-document-info p {
    margin: 0;
    color: #6b7280;
    font-size: 0.875rem;
}

.dm-document-actions {
    display: flex;
    gap: 0.5rem;
}

/* Pagination Styles */
.dm-pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.dm-page-btn {
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    border-radius: 0.375rem;
    cursor: pointer;
    transition: all 0.2s;
}

.dm-page-btn:hover {
    background: #f3f4f6;
    border-color: #9ca3af;
}

.dm-page-current {
    padding: 0.5rem 1rem;
    background: #3b82f6;
    color: white;
    border-radius: 0.375rem;
    font-weight: 500;
}

/* Loading Spinner */
.dm-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #e5e7eb;
    border-top: 4px solid #3b82f6;
    border-radius: 50%;
    animation: dm-spin 1s linear infinite;
    margin: 0 auto;
}

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

/* Editor Styles */
.dm-editor {
    height: 100vh;
    display: flex;
    flex-direction: column;
    background: #1a1a1a;
}

.dm-editor-header {
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
    padding: 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.dm-editor-title input {
    background: #404040;
    border: 1px solid #555;
    color: white;
    padding: 0.5rem;
    border-radius: 0.375rem;
    font-size: 1.125rem;
    font-weight: 600;
    min-width: 300px;
}

.dm-editor-main {
    flex: 1;
    display: flex;
    overflow: hidden;
}

.dm-editor-sidebar {
    width: 300px;
    background: #2d2d2d;
    border-right: 1px solid #404040;
    display: flex;
    flex-direction: column;
    color: white;
}

.dm-editor-panel {
    border-bottom: 1px solid #404040;
    padding: 1rem;
}

.dm-editor-panel h3 {
    margin: 0 0 1rem 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #d1d5db;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.dm-editor-canvas-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #404040;
}

.dm-editor-toolbar {
    background: #2d2d2d;
    border-bottom: 1px solid #404040;
    padding: 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    color: white;
}

.dm-tool-group {
    display: flex;
    gap: 0.25rem;
}

.dm-tool {
    width: 40px;
    height: 40px;
    border: 1px solid #555;
    background: #404040;
    border-radius: 0.375rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: white;
}

.dm-tool:hover {
    background: #555;
    border-color: #666;
}

.dm-tool.dm-tool-active {
    background: #3b82f6;
    border-color: #3b82f6;
}

.dm-editor-canvas-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: auto;
}

.dm-canvas {
    background: white;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    border-radius: 0.5rem;
}

.dm-editor-status {
    background: #2d2d2d;
    border-top: 1px solid #404040;
    padding: 0.5rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.875rem;
    color: #d1d5db;
}

/* Button Styles */
.dm-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    background: white;
    color: #374151;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    border: none;
}

.dm-btn:hover {
    background: #f9fafb;
    border-color: #9ca3af;
}

.dm-btn-primary {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
}

.dm-btn-primary:hover {
    background: #2563eb;
    border-color: #2563eb;
}

.dm-btn-success {
    background: #10b981;
    border-color: #10b981;
    color: white;
}

.dm-btn-success:hover {
    background: #059669;
    border-color: #059669;
}

.dm-btn-secondary {
    background: #6b7280;
    border-color: #6b7280;
    color: white;
}

.dm-btn-secondary:hover {
    background: #4b5563;
    border-color: #4b5563;
}

.dm-btn-danger {
    background: #ef4444;
    border-color: #ef4444;
    color: white;
}

.dm-btn-danger:hover {
    background: #dc2626;
    border-color: #dc2626;
}

.dm-btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
}

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

.dm-modal-content {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

.dm-modal-header {
    padding: 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dm-modal-header h3 {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
}

.dm-modal-close {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6b7280;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dm-modal-close:hover {
    color: #374151;
}

.dm-modal-body {
    padding: 1.5rem;
}

.dm-modal-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 0.75rem;
}

/* Form Styles */
.dm-form-group {
    margin-bottom: 1rem;
}

.dm-form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
}

.dm-form-group input,
.dm-form-group select,
.dm-form-group textarea {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #d1d5db;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    background: white;
}

.dm-form-group input:focus,
.dm-form-group select:focus,
.dm-form-group textarea:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Responsive Design */
@media (max-width: 768px) {
    .dm-gallery-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .dm-search input {
        min-width: auto;
    }
    
    .dm-gallery-grid {
        grid-template-columns: 1fr;
    }
    
    .dm-my-documents-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .dm-document-card {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .dm-document-actions {
        justify-content: center;
    }
    
    .dm-editor-sidebar {
        width: 250px;
    }
    
    .dm-editor-toolbar {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .dm-editor-sidebar {
        display: none;
    }
    
    .dm-editor-header {
        flex-direction: column;
        gap: 1rem;
        align-items: stretch;
    }
    
    .dm-editor-title input {
        min-width: auto;
    }
    
    .dm-editor-actions {
        justify-content: center;
    }
}
