/**
 * WPApps Doc Studio Plus - Styles
 */

/* Container */
.wpapps-doc-container {
    position: relative;
    margin: 20px 0;
}

/* Upload Area */
.wpapps-doc-upload {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.wpapps-doc-upload:hover {
    border-color: #2271b1;
    background: #f0f6fc;
}

/* Dropzone */
.wpapps-doc-dropzone {
    position: relative;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.wpapps-doc-dropzone.dragover {
    border-color: #2271b1;
    background: #e6f2ff;
}

.wpapps-doc-dropzone-icon {
    font-size: 48px;
    color: #8c8f94;
    margin-bottom: 16px;
}

.wpapps-doc-dropzone-text {
    font-size: 16px;
    color: #50575e;
    margin-bottom: 8px;
}

.wpapps-doc-dropzone-subtext {
    font-size: 14px;
    color: #8c8f94;
}

/* File Input */
.wpapps-doc-input {
    display: none;
}

.wpapps-doc-browse-button {
    display: inline-block;
    padding: 8px 16px;
    background: #2271b1;
    color: white;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 16px;
    transition: background 0.3s ease;
}

.wpapps-doc-browse-button:hover {
    background: #1e5a8e;
}

/* Loading */
.wpapps-doc-loading {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 100;
    border-radius: 8px;
}

.wpapps-doc-spinner {
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #2271b1;
    border-radius: 50%;
    animation: wpapps-doc-spin 1s linear infinite;
}

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

.wpapps-doc-loading-text {
    margin-top: 16px;
    font-size: 14px;
    color: #50575e;
}

/* Progress Bar */
.wpapps-doc-progress {
    width: 200px;
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 16px;
    overflow: hidden;
}

.wpapps-doc-progress-bar {
    height: 100%;
    background: #2271b1;
    transition: width 0.3s ease;
    width: 0;
}

/* Error Messages */
.wpapps-doc-error {
    position: absolute;
    top: 20px;
    right: 20px;
    background: #dc3232;
    color: white;
    padding: 12px 16px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: 400px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
    z-index: 200;
}

.wpapps-doc-error-icon {
    font-size: 18px;
}

.wpapps-doc-error-close {
    margin-left: auto;
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.8;
    transition: opacity 0.2s;
}

.wpapps-doc-error-close:hover {
    opacity: 1;
}

/* Preview */
.wpapps-doc-preview {
    margin-top: 30px;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    background: white;
    max-height: 600px;
    overflow-y: auto;
}

.wpapps-doc-preview-header {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    padding-bottom: 16px;
    border-bottom: 1px solid #eee;
}

.wpapps-doc-preview-content {
    font-size: 14px;
    line-height: 1.6;
    color: #333;
}

.wpapps-doc-preview-content p {
    margin: 0 0 16px;
}

.wpapps-doc-preview-content p:last-child {
    margin-bottom: 0;
}

/* File Info */
.wpapps-doc-file-info {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px;
    background: #f0f0f1;
    border-radius: 4px;
    margin-bottom: 16px;
    font-size: 14px;
}

.wpapps-doc-file-icon {
    font-size: 24px;
    color: #50575e;
}

.wpapps-doc-file-details {
    flex: 1;
}

.wpapps-doc-file-name {
    font-weight: 600;
    color: #1e1e1e;
}

.wpapps-doc-file-meta {
    font-size: 12px;
    color: #8c8f94;
    margin-top: 2px;
}

/* Highlight */
.wpapps-doc-preview mark {
    background: #ffeb3b;
    padding: 2px 4px;
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 768px) {
    .wpapps-doc-upload {
        padding: 30px 20px;
    }
    
    .wpapps-doc-dropzone-icon {
        font-size: 36px;
    }
    
    .wpapps-doc-dropzone-text {
        font-size: 14px;
    }
    
    .wpapps-doc-error {
        position: fixed;
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    .wpapps-doc-preview {
        max-height: 400px;
    }
}