/**
 * Frontend styles for PDF Unlock Plugin
 */

/* Main container */
.pdf-unlock-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Header section */
.pdf-unlock-header {
    text-align: center;
    margin-bottom: 30px;
}

.pdf-unlock-title {
    color: #2c3e50;
    font-size: 28px;
    font-weight: 600;
    margin: 0 0 10px 0;
}

.pdf-unlock-description {
    color: #7f8c8d;
    font-size: 16px;
    margin: 0;
    line-height: 1.5;
}

/* Features grid */
.pdf-unlock-features {
    margin-bottom: 40px;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.feature-item {
    text-align: center;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 10px;
}

.feature-item h4 {
    color: #2c3e50;
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.feature-item p {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
    line-height: 1.4;
}

/* Form styles */
.pdf-unlock-form {
    margin-bottom: 30px;
}

/* Upload section */
.upload-section {
    margin-bottom: 25px;
}

.file-upload-area {
    border: 2px dashed #3498db;
    border-radius: 8px;
    background: #f7f9fc;
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
    overflow: hidden;
}

.file-upload-area:hover {
    border-color: #2980b9;
    background: #ebf3fd;
}

.file-upload-area.drag-over {
    border-color: #27ae60;
    background: #e8f5e8;
}

.upload-content {
    padding: 40px 20px;
    text-align: center;
}

.upload-icon {
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.7;
}

.upload-content h4 {
    color: #2c3e50;
    font-size: 18px;
    font-weight: 600;
    margin: 0 0 8px 0;
}

.upload-content p {
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

.upload-content input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

/* File info display */
.file-info {
    background: #e8f5e8;
    border: 1px solid #27ae60;
    border-radius: 8px;
    padding: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.file-details {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.file-name {
    font-weight: 600;
    color: #2c3e50;
}

.file-size {
    font-size: 12px;
    color: #7f8c8d;
}

.remove-file {
    background: #e74c3c;
    color: white;
    border: none;
    border-radius: 50%;
    width: 24px;
    height: 24px;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}

/* Password section */
.password-section {
    margin-bottom: 25px;
}

.password-section label {
    display: block;
    color: #2c3e50;
    font-weight: 600;
    margin-bottom: 8px;
}

.password-section input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

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

.help-text {
    display: block;
    color: #7f8c8d;
    font-size: 12px;
    margin-top: 5px;
}

/* Confirmation section */
.confirmation-section {
    margin-bottom: 25px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    line-height: 1.4;
}

.checkbox-container input[type="checkbox"] {
    margin: 0;
    transform: scale(1.2);
}

/* Submit section */
.submit-section {
    text-align: center;
    margin-bottom: 30px;
}

.unlock-button {
    background: linear-gradient(135deg, #3498db, #2980b9);
    color: white;
    border: none;
    padding: 15px 40px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 160px;
    justify-content: center;
}

.unlock-button:hover:not(:disabled) {
    background: linear-gradient(135deg, #2980b9, #21618c);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(52, 152, 219, 0.3);
}

.unlock-button:disabled {
    background: #95a5a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.button-loader {
    display: none !important;
}

.unlock-button.loading .button-text {
    display: none;
}

.unlock-button.loading .button-loader {
    display: inline-block !important;
}

/* Spinner animation */
.spinner {
    animation: spin 2s linear infinite;
    width: 20px;
    height: 20px;
}

.spinner .path {
    stroke: currentColor;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

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

@keyframes dash {
    0% { stroke-dasharray: 1, 150; stroke-dashoffset: 0; }
    50% { stroke-dasharray: 90, 150; stroke-dashoffset: -35; }
    100% { stroke-dasharray: 90, 150; stroke-dashoffset: -124; }
}

/* Progress section */
.progress-section {
    margin-bottom: 30px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #ecf0f1;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #3498db, #2980b9);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    text-align: center;
    color: #7f8c8d;
    font-size: 14px;
    margin: 0;
}

/* Result sections */
.result-section {
    text-align: center;
}

.success-message, .error-message {
    padding: 30px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.success-message {
    background: #d5edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.error-message {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.success-icon, .error-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.success-message h4, .error-message h4 {
    margin: 0 0 10px 0;
    font-size: 20px;
}

.success-message p, .error-message p {
    margin: 0 0 20px 0;
    line-height: 1.5;
}

/* Download actions */
.download-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
}

.download-button {
    background: linear-gradient(135deg, #27ae60, #229954);
    color: white;
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    transition: all 0.3s ease;
    display: inline-block;
}

.download-button:hover {
    background: linear-gradient(135deg, #229954, #1e7e34);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(39, 174, 96, 0.3);
    color: white;
    text-decoration: none;
}

.secondary-button {
    background: #6c757d;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 6px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.secondary-button:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* Privacy notice */
.privacy-notice {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #3498db;
}

.privacy-notice h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 16px;
}

.privacy-notice ul {
    margin: 0;
    padding-left: 20px;
}

.privacy-notice li {
    color: #7f8c8d;
    font-size: 14px;
    margin-bottom: 8px;
    line-height: 1.4;
}

/* Style variations */

/* Compact style */
.pdf-unlock-style-compact {
    max-width: 500px;
    padding: 15px;
}

.pdf-unlock-style-compact .pdf-unlock-features {
    display: none;
}

.pdf-unlock-style-compact .feature-grid {
    grid-template-columns: 1fr;
    gap: 10px;
}

.pdf-unlock-style-compact .upload-content {
    padding: 25px 15px;
}

/* Minimal style */
.pdf-unlock-style-minimal {
    box-shadow: none;
    border: 1px solid #e1e8ed;
    background: #fafbfc;
}

.pdf-unlock-style-minimal .pdf-unlock-features {
    display: none;
}

.pdf-unlock-style-minimal .privacy-notice {
    display: none;
}

/* Mobile responsive */
@media (max-width: 768px) {
    .pdf-unlock-container {
        margin: 10px;
        padding: 15px;
    }
    
    .pdf-unlock-title {
        font-size: 24px;
    }
    
    .feature-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .upload-content {
        padding: 30px 15px;
    }
    
    .upload-content h4 {
        font-size: 16px;
    }
    
    .download-actions {
        flex-direction: column;
        align-items: center;
    }
    
    .download-button, .secondary-button {
        width: 100%;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .pdf-unlock-container {
        margin: 5px;
        padding: 10px;
    }
    
    .unlock-button {
        width: 100%;
        padding: 15px;
    }
    
    .checkbox-container {
        font-size: 14px;
    }
}