/* Text to PDF Converter - Frontend Styles */

.ttpdf-shortcode-container {
    max-width: 1000px;
    margin: 30px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.ttpdf-shortcode-header {
    text-align: center;
    margin-bottom: 30px;
}

.ttpdf-shortcode-header h2 {
    font-size: 32px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0 0 10px 0;
}

.ttpdf-shortcode-header p {
    font-size: 16px;
    color: #666;
    margin: 0;
}

.ttpdf-editor-container {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

/* Toolbar Styles */
.ttpdf-toolbar {
    padding: 20px;
    background: #f8f9fa;
    border-bottom: 1px solid #e0e0e0;
}

.ttpdf-toolbar h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    font-weight: 600;
    color: #1a1a1a;
}

.ttpdf-toolbar-buttons {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.ttpdf-btn {
    padding: 10px 16px;
    border: 1px solid #d0d0d0;
    background: #fff;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 15px;
    font-weight: 500;
    color: #333;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
}

.ttpdf-btn:hover {
    background: #f0f0f0;
    border-color: #999;
}

.ttpdf-btn:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.3);
}

.ttpdf-format-btn.active {
    background: #4299e1;
    border-color: #4299e1;
    color: #fff;
}

.ttpdf-select {
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    cursor: pointer;
    color: #333;
}

.ttpdf-select:focus {
    border-color: #4299e1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.3);
}

.ttpdf-input {
    height: 40px;
    padding: 8px 12px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    background: #fff;
    font-size: 14px;
    color: #333;
    width: 100%;
}

.ttpdf-input:focus {
    border-color: #4299e1;
    outline: none;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.3);
}

.separator {
    color: #d0d0d0;
    margin: 0 5px;
    font-size: 20px;
}

.ttpdf-toolbar label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

#ttpdf-text-color {
    width: 50px;
    height: 40px;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    cursor: pointer;
}

/* Editor Styles */
.ttpdf-editor-wrapper {
    padding: 30px;
    min-height: 450px;
    background: #fff;
}

#ttpdf-editor {
    min-height: 400px;
    padding: 25px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    background: #fafafa;
    font-size: 16px;
    line-height: 1.8;
    font-family: Georgia, "Times New Roman", serif;
    outline: none;
    overflow-y: auto;
    transition: all 0.2s ease;
}

#ttpdf-editor:focus {
    border-color: #4299e1;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(66, 153, 225, 0.1);
}

#ttpdf-editor p {
    margin: 0 0 1em 0;
}

#ttpdf-editor:empty:before {
    content: "Start typing here...";
    color: #999;
    font-style: italic;
}

/* PDF Options */
.ttpdf-options {
    padding: 20px 30px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.ttpdf-options h3 {
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.ttpdf-options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 15px;
}

.ttpdf-options label {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
}

.ttpdf-options label span {
    font-weight: 600;
}

/* Actions Section */
.ttpdf-actions {
    padding: 20px 30px;
    background: #fff;
    border-top: 1px solid #e0e0e0;
    display: flex;
    justify-content: flex-end;
    gap: 15px;
}

.ttpdf-btn-primary {
    background: #4299e1;
    border-color: #4299e1;
    color: #fff;
    padding: 12px 30px;
    font-weight: 600;
    font-size: 16px;
}

.ttpdf-btn-primary:hover {
    background: #3182ce;
    border-color: #3182ce;
}

.ttpdf-btn-secondary {
    background: #fff;
    border-color: #d0d0d0;
    color: #333;
    padding: 12px 24px;
    font-size: 16px;
}

.ttpdf-btn-secondary:hover {
    background: #f7f7f7;
    border-color: #999;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .ttpdf-shortcode-container {
        padding: 0 15px;
        margin: 20px auto;
    }

    .ttpdf-shortcode-header h2 {
        font-size: 24px;
    }

    .ttpdf-shortcode-header p {
        font-size: 14px;
    }

    .ttpdf-toolbar {
        padding: 15px;
    }

    .ttpdf-toolbar h3 {
        font-size: 16px;
    }

    .ttpdf-toolbar-buttons {
        gap: 8px;
    }

    .ttpdf-btn,
    .ttpdf-select,
    #ttpdf-text-color {
        height: 36px;
        min-width: 36px;
        font-size: 14px;
    }

    .ttpdf-editor-wrapper {
        padding: 20px 15px;
        min-height: 350px;
    }

    #ttpdf-editor {
        min-height: 300px;
        padding: 20px;
        font-size: 15px;
    }

    .ttpdf-options {
        padding: 15px;
    }

    .ttpdf-options-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .ttpdf-actions {
        padding: 15px;
        flex-direction: column-reverse;
        gap: 10px;
    }

    .ttpdf-actions .ttpdf-btn {
        width: 100%;
    }

    .separator {
        display: none;
    }
}

@media screen and (max-width: 480px) {
    .ttpdf-toolbar-buttons {
        justify-content: center;
    }

    .ttpdf-btn {
        padding: 8px 12px;
        font-size: 13px;
    }

    #ttpdf-editor {
        font-size: 14px;
        padding: 15px;
    }
}

/* Loading State */
.ttpdf-loading {
    position: relative;
    opacity: 0.6;
    pointer-events: none;
}

.ttpdf-loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #4299e1;
    border-radius: 50%;
    animation: ttpdf-spin 1s linear infinite;
}

@keyframes ttpdf-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Success Message */
.ttpdf-success-message {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #48bb78;
    color: #fff;
    padding: 15px 25px;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    animation: ttpdf-slideIn 0.3s ease;
}

@keyframes ttpdf-slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}
