/**
 * Font Manager Styles
 */

/* Font Button Styles - Matches shared-button-style */
.font-manager-btn {
    /* Base styles matching shared-button-style */
    background-color: black;
    border: 2px solid white;
    color: white;
    cursor: pointer;
    border-radius: 50%;
    transition: all 0.3s ease;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    position: relative;
}

.font-manager-btn:hover {
    background-color: #333;
    border-color: white;
}

.font-manager-btn:active {
    background-color: white;
    color: black;
}

/* Font button status states */
.font-manager-btn.font-missing {
    background-color: #dc3545;
    border-color: white;
    color: white;
    animation: pulse-red 2s infinite;
}

.font-manager-btn.font-missing:hover {
    background-color: #c82333;
    border-color: white;
    color: white;
}

.font-manager-btn.font-complete {
    border-color: #28a745;
    color: #28a745;
}

.font-manager-btn.font-complete:hover {
    background-color: #28a745;
    color: white;
}

@keyframes pulse-red {
    0% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(220, 53, 69, 0); }
    100% { box-shadow: 0 0 0 0 rgba(220, 53, 69, 0); }
}

/* Font Modal Styles */
.font-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.75);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 99999;
    overflow: auto;
    padding: 20px;
    box-sizing: border-box;
}

.font-modal-content {
    background: white;
    border-radius: 12px;
    width: 100%;
    max-width: 700px;
    max-height: 85vh;
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.4);
    animation: modalSlideIn 0.3s ease-out;
    margin: auto;
    position: relative;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.font-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid #e9ecef;
    background: #f8f9fa;
}

.font-modal-header h3 {
    margin: 0;
    color: #333;
    font-size: 20px;
}

.font-modal-close {
    font-size: 28px;
    cursor: pointer;
    color: #6c757d;
    line-height: 1;
    padding: 0 5px;
}

.font-modal-close:hover {
    color: #dc3545;
}

.font-modal-body {
    padding: 24px;
    max-height: calc(85vh - 140px);
    overflow-y: auto;
    overflow-x: hidden;
}

.font-section {
    margin-bottom: 30px;
}

.font-section h4 {
    margin: 0 0 10px 0;
    color: #495057;
    font-size: 16px;
    font-weight: 600;
}

.font-instructions {
    margin: 0 0 15px 0;
    color: #6c757d;
    font-size: 14px;
    line-height: 1.4;
    font-style: italic;
}

.font-list {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    background: #f8f9fa;
    min-height: 60px;
}

.font-item {
    display: flex;
    flex-direction: column;
    padding: 12px 15px;
    margin: 8px 0;
    border-radius: 8px;
    background: white;
    border: 1px solid #e9ecef;
    transition: all 0.2s ease;
}

.font-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.15);
}

.font-header {
    display: flex;
    align-items: center;
    width: 100%;
}

.font-number {
    font-weight: bold;
    color: #495057;
    margin-right: 8px;
    min-width: 20px;
}

.font-name-display {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 15px;
}

.font-status-text {
    font-size: 12px;
    color: #6c757d;
    font-style: italic;
    margin-left: 8px;
}

/* Font Details Section */
.font-details {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #6c757d;
}

.font-source {
    font-style: italic;
}

.font-actions {
    margin-top: 12px;
    display: flex;
    gap: 8px;
    align-items: center;
}

.font-action-btn {
    background: #e9ecef;
    color: #6c757d;
    border: none;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    cursor: not-allowed;
    font-weight: 500;
}

/* Airtable Fonts Section */
#airtable-fonts-section {
    border: 2px solid #17a2b8;
    border-radius: 8px;
    padding: 20px;
    background: linear-gradient(135deg, #f0f9ff 0%, #e0f7ff 100%);
}

#airtable-fonts-section h4 {
    color: #0c5460;
    display: flex;
    align-items: center;
    gap: 8px;
}

#airtable-fonts-section h4::before {
    content: "☁️";
    font-size: 18px;
}

#airtable-fonts-list .font-item {
    border: 1px solid #b3d9e6;
    background: white;
}

#airtable-fonts-list .font-item:hover {
    border-color: #17a2b8;
    box-shadow: 0 2px 8px rgba(23, 162, 184, 0.15);
}

.font-search-hint {
    margin-top: 8px;
    padding: 8px 12px;
    background: #f8f9fa;
    border-radius: 4px;
    font-size: 12px;
    color: #495057;
    border-left: 3px solid #dc3545;
}

.font-upload-section {
    margin-top: 12px;
    padding: 8px 0;
    border-top: 1px solid #e9ecef;
}

.font-upload-btn-individual {
    background: #007bff;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.font-upload-btn-individual:hover {
    background: #0056b3;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 123, 255, 0.3);
}

.font-upload-btn-individual:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 123, 255, 0.3);
}

/* Airtable Font Download Buttons */
.font-download-btn-individual, .font-download-btn-airtable {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.font-download-btn-individual:hover, .font-download-btn-airtable:hover {
    background: #218838;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(40, 167, 69, 0.3);
}

.font-download-btn-individual:active, .font-download-btn-airtable:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(40, 167, 69, 0.3);
}

.font-download-btn-individual:disabled, .font-download-btn-airtable:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.font-download-section {
    margin-top: 12px;
    padding: 8px 0;
    border-top: 1px solid #e9ecef;
}

.font-file-input {
    display: none !important;
}

.font-status {
    margin-right: 10px;
    font-size: 16px;
}

.font-name {
    flex: 1;
    font-weight: 500;
    color: #333;
}

.font-size {
    color: #6c757d;
    font-size: 12px;
    margin-left: 10px;
}

.font-remove-btn {
    background: #dc3545;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.font-remove-btn:hover {
    background: #c82333;
}

.font-date {
    color: #6c757d;
    font-size: 11px;
    margin-left: 8px;
    font-style: italic;
}

.font-unlink-btn {
    background: #6f42c1;
    color: white;
    border: none;
    border-radius: 4px;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 12px;
    margin-left: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.font-unlink-btn:hover {
    background: #5a2d91;
}

.font-item.font-missing {
    border-left: 4px solid #dc3545;
}

.font-item.font-available {
    border-left: 4px solid #28a745;
}

.font-item.font-uploaded {
    border-left: 4px solid #007bff;
}

.font-item.font-persisted {
    border-left: 4px solid #6f42c1;
    background: #f8f9ff;
}

.font-item.font-linked {
    border-left: 4px solid #20c997;
    background: #f0fff4;
}

.font-item.font-airtable {
    border-left: 4px solid #17a2b8;
    background: #f0f9ff;
}

.no-fonts {
    color: #6c757d;
    font-style: italic;
    text-align: center;
    margin: 20px 0;
}

.loading-fonts {
    color: #007bff;
    font-style: italic;
    text-align: center;
    margin: 20px 0;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

/* Font Upload Area */
.font-upload-area {
    text-align: center;
    padding: 20px;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    margin-bottom: 20px;
    background: #f8f9fa;
}

.font-upload-button {
    background: #007bff;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 10px 20px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: background 0.2s ease;
}

.font-upload-button:hover {
    background: #0056b3;
}

.font-upload-hint {
    margin: 10px 0 0 0;
    color: #6c757d;
    font-size: 12px;
}

/* Modal Footer */
.font-modal-footer {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding: 20px 24px;
    border-top: 1px solid #e9ecef;
    background: #f8f9fa;
}

.font-save-btn, .font-cancel-btn, .font-browse-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.2s ease;
}

.font-browse-btn {
    background: #17a2b8;
    color: white;
}

.font-browse-btn:hover {
    background: #138496;
}

.font-save-btn {
    background: #28a745;
    color: white;
}

.font-save-btn:hover {
    background: #218838;
}

.font-cancel-btn {
    background: #6c757d;
    color: white;
}

.font-cancel-btn:hover {
    background: #5a6268;
}

/* Responsive Design */
@media (max-width: 768px) {
    .font-modal-content {
        width: 95%;
        margin: 20px;
    }
    
    .font-modal-body {
        padding: 16px;
    }
    
    .font-modal-header,
    .font-modal-footer {
        padding: 16px;
    }
    
    .font-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .font-size {
        margin-left: 0;
    }
    
    .font-details {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .font-modal-footer {
        flex-direction: column;
    }
    
    .font-browse-btn {
        order: -1;
    }
}
