/* ==================== MODAL STYLES ==================== */

/* Modal Overlay */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal-overlay.active {
    opacity: 1;
}

/* Modal Container */
.modal-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    min-width: 400px;
    max-width: 500px;
    transform: scale(0.9) translateY(-20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}

.modal-container.active {
    transform: scale(1) translateY(0);
}

/* Modal Header */
.modal-header {
    padding: 24px 24px 20px 24px;
    border-bottom: 1px solid #e0e0e0;
}

.modal-icon {
    display: none; /* Remove all icons for clean, professional look */
}

.modal-title {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* Modal Body */
.modal-body {
    padding: 20px 24px;
}

.modal-message {
    font-size: 14px;
    color: #5a6c7d;
    line-height: 1.6;
    margin: 0;
}

.modal-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

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

/* Modal Footer */
.modal-footer {
    padding: 16px 24px 24px 24px;
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

/* Modal Buttons - Clean, Professional, Consistent Design */
.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 90px;
    font-family: inherit;
}

.modal-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

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

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

.modal-btn-secondary {
    background: #ecf0f1;
    color: #2c3e50;
}

.modal-btn-secondary:hover {
    background: #d5dbdb;
}

.modal-btn-danger {
    background: #e74c3c;
    color: white;
}

.modal-btn-danger:hover {
    background: #c0392b;
}

.modal-btn-success {
    background: #27ae60;
    color: white;
}

.modal-btn-success:hover {
    background: #229954;
}

/* Responsive */
@media (max-width: 600px) {
    .modal-container {
        min-width: 90%;
        max-width: 90%;
    }
    
    .modal-footer {
        flex-direction: column;
    }
    
    .modal-btn {
        width: 100%;
    }
}

/* ==================== REPLACE COMPONENT MODAL ==================== */

.replace-modal {
    max-width: 600px;
    min-width: 500px;
}

.replace-type-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    max-height: 400px;
    overflow-y: auto;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
}

.replace-type-option {
    padding: 12px 16px;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 50px;
}

.replace-type-option:hover {
    border-color: #3498db;
    background: #f0f8ff;
    transform: translateY(-1px);
}

.replace-type-option.selected {
    border-color: #3498db;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
}

.replace-type-option.current-type {
    border-color: #95a5a6;
    background: #ecf0f1;
    cursor: not-allowed;
    opacity: 0.7;
}

.replace-type-label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.current-badge {
    font-size: 10px;
    font-weight: 700;
    color: #7f8c8d;
    background: #e0e0e0;
    padding: 4px 8px;
    border-radius: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.replace-type-grid::-webkit-scrollbar {
    width: 6px;
}

.replace-type-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.replace-type-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.replace-type-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* ==================== PAGE SIZE MODAL ==================== */

.page-size-modal {
    max-width: 600px;
}

.diagram-size-info {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    border-left: 4px solid #3498db;
}

.diagram-size-info p {
    margin: 5px 0;
    color: #2c3e50;
    font-size: 14px;
}

.recommended-size {
    color: #3498db;
    font-weight: 700;
}

.warning-text {
    color: #e67e22;
    font-weight: 600;
    margin-top: 10px !important;
}

.page-size-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.page-size-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

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

.page-size-option.recommended {
    border-color: #3498db;
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    position: relative;
}

.page-size-option.recommended::before {
    content: '⭐ RECOMMENDED';
    position: absolute;
    top: -10px;
    right: 10px;
    background: #3498db;
    color: white;
    padding: 3px 10px;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.page-size-option input[type="radio"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    flex-shrink: 0;
}

.option-content {
    flex: 1;
}

.option-title {
    font-size: 16px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 4px;
}

.option-subtitle {
    font-size: 13px;
    color: #7f8c8d;
    margin-bottom: 6px;
}

.scale-info {
    font-size: 12px;
    color: #e67e22;
    font-weight: 600;
    margin-top: 6px;
}

.scale-info.scale-fits {
    color: #27ae60;
}

/* ==================== EXPORT INFO MODAL ==================== */

.export-info-modal {
    max-width: 650px;
}

.modal-description {
    color: #7f8c8d;
    margin-bottom: 20px;
    font-size: 14px;
}

.export-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.form-label {
    font-size: 13px;
    font-weight: 600;
    color: #2c3e50;
}

.form-input {
    padding: 10px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

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

.form-input::placeholder {
    color: #bdc3c7;
}

.logo-upload-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.btn-upload {
    padding: 10px 20px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-upload:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 152, 219, 0.3);
}

.logo-filename {
    font-size: 13px;
    color: #7f8c8d;
    font-style: italic;
}

.logo-preview {
    margin-top: 10px;
    text-align: center;
}

/* ==================== DIAGRAM BROWSER MODAL ==================== */

.modal-container.diagram-browser-modal {
    width: 550px;
    max-width: none;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
}

.diagram-browser-modal .modal-body {
    overflow-y: auto;
    max-height: calc(85vh - 200px);
}

.diagram-search {
    margin-bottom: 15px;
}

.diagram-search-input {
    width: 100%;
    padding: 12px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    transition: all 0.2s ease;
}

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

.diagram-list {
    max-height: 400px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.diagram-item {
    display: flex;
    align-items: stretch;
    padding: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background: white;
    transition: all 0.2s ease;
    overflow: hidden;
    min-height: 110px;
}

.diagram-item:hover {
    border-color: #3498db;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.diagram-item-main {
    flex: 1;
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.diagram-item-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 15px;
}

.diagram-item-title {
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
    flex: 1;
}

.diagram-item-date {
    font-size: 12px;
    color: #95a5a6;
    white-space: nowrap;
}

.diagram-item-stats {
    display: flex;
    gap: 8px;
}

.diagram-stat-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    background: #ecf0f1;
    color: #7f8c8d;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.diagram-item-actions {
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
}

.btn-load-diagram {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 0 24px;
    background: linear-gradient(135deg, #3498db 0%, #2980b9 100%);
    color: white;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 100px;
}

.btn-load-diagram:hover {
    background: linear-gradient(135deg, #2980b9 0%, #2471a3 100%);
}

.btn-load-diagram .btn-icon {
    font-size: 18px;
    font-weight: bold;
}

.btn-delete-diagram {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 24px;
    background: #e8ebed;
    color: #95a5a6;
    border: none;
    border-top: 1px solid #e0e0e0;
    font-size: 24px;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    line-height: 1;
}

.btn-delete-diagram:hover {
    background: #e74c3c;
    color: white;
}

.btn-delete-diagram span {
    transform: rotate(0deg);
    transition: transform 0.2s ease;
}

.btn-delete-diagram:hover span {
    transform: rotate(90deg);
}

.loading-state {
    text-align: center;
    padding: 40px 20px;
    color: #7f8c8d;
}

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

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

.empty-state-hint {
    font-size: 13px;
    color: #bdc3c7;
    margin-top: 10px;
}

/* ==================== EXPORT FORMAT MODAL ==================== */

.export-format-modal {
    max-width: 600px;
}

.export-format-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.export-format-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 24px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    background: white;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.export-format-option:hover:not(.disabled) {
    border-color: #3498db;
    background: #f0f8ff;
    transform: translateY(-4px);
    box-shadow: 0 6px 20px rgba(52, 152, 219, 0.2);
}

.export-format-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
}

.export-format-option.disabled:hover {
    transform: none;
    box-shadow: none;
}

.format-icon {
    font-size: 48px;
    margin-bottom: 12px;
}

.format-name {
    font-size: 18px;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 6px;
}

.format-description {
    font-size: 12px;
    color: #7f8c8d;
    text-align: center;
}

.coming-soon-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #e67e22;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.new-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #27ae60;
    color: white;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

@media (max-width: 600px) {
    .export-format-grid {
        grid-template-columns: 1fr;
    }
}

/* ==================== EXPORT TOAST NOTIFICATIONS ==================== */

.export-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: white;
    padding: 16px 24px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    font-weight: 500;
    z-index: 100000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.export-toast.show {
    opacity: 1;
    transform: translateY(0);
}

/* Loading Toast */
.export-toast-loading {
    background: #2196F3;
    color: white;
}

.export-toast-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Success Toast */
.export-toast-success {
    background: #4CAF50;
    color: white;
}

.export-toast-icon {
    width: 24px;
    height: 24px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: bold;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .export-toast {
        bottom: 20px;
        right: 20px;
        left: 20px;
        max-width: calc(100% - 40px);
    }
}

