/**
 * Noble Bio Templates - Styles (Noble Atlas CI)
 * Colors: Gold #dbc16d, Emerald #01221c
 * Typography: Inter (Body), Playfair Display (Headlines)
 */

/* Noble Atlas CI Variables */
:root {
    --noble-gold: #dbc16d;
    --noble-gold-hover: #e5cb7f;
    --noble-emerald: #01221c;
    --noble-emerald-light: #0a3a30;
}

/* ============================================================================
   Trigger Button (Versteckt - wird nicht mehr verwendet)
   ========================================================================= */

.noble-bio-template-trigger {
    display: none !important; /* Button komplett ausblenden */
}

/* ============================================================================
   Template Selector Wrapper
   ========================================================================= */

.noble-bio-templates-wrapper {
    background: transparent;
    padding: 0;
    margin: 20px 0;
}

.noble-bio-templates-header {
    margin-bottom: 25px;
    border-left: 4px solid var(--noble-gold);
    padding-left: 15px;
}

.noble-bio-templates-header h3 {
    margin: 0 0 8px 0;
    font-size: 20px;
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--noble-gold);
    font-weight: 600;
}

.noble-bio-templates-header .description {
    margin: 0;
    color: #d4d4d4;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

/* ============================================================================
   Template Grid
   ========================================================================= */

.noble-bio-templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.noble-bio-template-card {
    background: rgba(1, 34, 28, 0.3);
    border: 2px solid rgba(219, 193, 109, 0.3);
    border-radius: 8px;
    padding: 18px;
    transition: all 0.3s;
    cursor: pointer;
    position: relative;
}

.noble-bio-template-card:hover {
    border-color: var(--noble-gold);
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(219, 193, 109, 0.25);
    background: rgba(1, 34, 28, 0.5);
}

.template-card-header {
    margin-bottom: 12px;
}

.template-icon {
    display: none !important; /* Icons ausblenden */
}

.template-name {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--noble-gold);
}

.template-description {
    color: #d4d4d4;
    font-size: 13px;
    line-height: 1.5;
    margin: 8px 0 15px 0;
    min-height: 35px;
    font-family: 'Inter', sans-serif;
}

.noble-bio-preview-template {
    width: 100%;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--noble-gold), var(--noble-gold-hover));
    color: #01221c;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.noble-bio-preview-template:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(219, 193, 109, 0.4);
}

/* ============================================================================
   Preview Modal
   ========================================================================= */

.noble-bio-preview-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.preview-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(1, 34, 28, 0.92);
    backdrop-filter: blur(8px);
}

.preview-modal-content {
    position: relative;
    background: linear-gradient(135deg, #1a1a1a 0%, #0d0d0d 100%);
    border: 2px solid var(--noble-gold);
    border-radius: 12px;
    max-width: 700px;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(219, 193, 109, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

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

.preview-modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 25px 30px;
    border-bottom: 2px solid rgba(219, 193, 109, 0.2);
}

.preview-template-name {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    font-family: 'Playfair Display', Georgia, serif;
    color: var(--noble-gold);
}

.preview-modal-close {
    background: rgba(219, 193, 109, 0.1);
    border: 2px solid rgba(219, 193, 109, 0.3);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 24px;
    color: var(--noble-gold);
    transition: all 0.2s;
}

.preview-modal-close:hover {
    background: rgba(219, 193, 109, 0.2);
    border-color: var(--noble-gold);
}

.preview-modal-body {
    padding: 30px;
    overflow-y: auto;
    flex: 1;
}

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

.preview-spinner {
    width: 50px;
    height: 50px;
    margin: 0 auto 20px;
    border: 4px solid rgba(219, 193, 109, 0.2);
    border-top-color: var(--noble-gold);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.preview-loading p {
    color: #d4d4d4;
    font-size: 15px;
    font-family: 'Inter', sans-serif;
}

/* Preview Text */
.preview-text-content {
    background: rgba(26, 26, 26, 0.95);
    padding: 20px;
    border-radius: 8px;
    border: 2px solid rgba(219, 193, 109, 0.3);
    border-left: 4px solid var(--noble-gold);
    line-height: 1.8;
    color: #ffffff;
    font-size: 15px;
    margin-bottom: 15px;
    white-space: pre-wrap;
    font-family: 'Inter', sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.preview-meta {
    text-align: right;
    color: #d4d4d4;
    font-size: 13px;
}

.preview-word-count strong {
    color: var(--noble-gold);
    font-size: 16px;
    font-weight: 700;
}

/* Edit Mode */
.preview-edit-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid rgba(219, 193, 109, 0.3);
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.7;
    font-family: 'Inter', sans-serif;
    resize: vertical;
    min-height: 200px;
    transition: all 0.2s;
    background: rgba(1, 34, 28, 0.3);
    color: #ffffff;
}

.preview-edit-textarea:focus {
    outline: none;
    border-color: var(--noble-gold);
    box-shadow: 0 0 0 3px rgba(219, 193, 109, 0.2);
}

.preview-edit-container label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    color: var(--noble-gold);
    font-family: 'Playfair Display', Georgia, serif;
}

.preview-edit-word-count {
    text-align: right;
    margin-top: 8px;
    color: #d4d4d4;
    font-size: 13px;
}

.preview-edit-word-count strong {
    color: var(--noble-gold);
    font-size: 16px;
    font-weight: 700;
}

/* Error State */
.preview-error {
    text-align: center;
    padding: 40px 20px;
}

.error-message {
    color: #ef4444;
    font-size: 15px;
    padding: 15px;
    background: #fef2f2;
    border-radius: 8px;
    border-left: 4px solid #ef4444;
}

/* Modal Footer */
.preview-modal-footer {
    padding: 20px 30px;
    border-top: 2px solid rgba(219, 193, 109, 0.2);
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.preview-modal-footer .button {
    padding: 12px 24px;
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    border: none;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.preview-modal-footer .button-secondary {
    background: rgba(219, 193, 109, 0.1);
    color: var(--noble-gold);
    border: 2px solid rgba(219, 193, 109, 0.3);
}

.preview-modal-footer .button-secondary:hover {
    background: rgba(219, 193, 109, 0.2);
    border-color: var(--noble-gold);
}

.preview-modal-footer .button-primary {
    background: linear-gradient(135deg, var(--noble-gold), var(--noble-gold-hover));
    color: #01221c;
}

.preview-modal-footer .button-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(219, 193, 109, 0.4);
}

.preview-modal-footer .button-primary:disabled {
    background: #4a4a4a;
    color: #888;
    cursor: not-allowed;
    transform: none;
}

/* ============================================================================
   Notification Toast
   ========================================================================= */

.noble-bio-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #1a1a1a;
    border: 2px solid var(--noble-gold);
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(219, 193, 109, 0.3);
    z-index: 10000000;
    animation: slideInRight 0.3s ease-out;
    min-width: 300px;
}

@keyframes slideInRight {
    from {
        transform: translateX(400px);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.noble-bio-notification.success {
    border-left: 4px solid var(--noble-gold);
}

.noble-bio-notification.error {
    border-left: 4px solid #ef4444;
}

.noble-bio-notification p {
    margin: 0;
    color: #ffffff;
    font-size: 14px;
    font-family: 'Inter', sans-serif;
}

/* ============================================================================
   Responsive
   ========================================================================= */

@media (max-width: 768px) {
    .noble-bio-templates-wrapper {
        padding: 20px;
    }
    
    .noble-bio-templates-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .preview-modal-content {
        max-width: 100%;
        max-height: 95vh;
        margin: 10px;
    }
    
    .preview-modal-header,
    .preview-modal-body,
    .preview-modal-footer {
        padding: 20px;
    }
    
    .preview-modal-footer {
        flex-direction: column;
    }
    
    .preview-modal-footer .button {
        width: 100%;
    }
    
    .noble-bio-notification {
        left: 20px;
        right: 20px;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .noble-bio-templates-header h3 {
        font-size: 20px;
    }
    
    .noble-bio-template-card {
        padding: 15px;
    }
    
    .template-icon {
        font-size: 28px;
    }
    
    .template-name {
        font-size: 15px;
    }
    
    .template-description {
        font-size: 13px;
        min-height: auto;
    }
}

/* ============================================================================
   Print Styles
   ========================================================================= */

@media print {
    .noble-bio-template-trigger,
    .noble-bio-preview-modal {
        display: none !important;
    }
}

