/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* Header */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    position: relative;
}

.home-link {
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    text-decoration: none;
    font-weight: 500;
    padding: 10px 15px;
    border-radius: 8px;
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
}

.home-link:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateX(-2px);
    color: white;
    text-decoration: none;
}

.home-link i {
    font-size: 1rem;
}

.logo-link {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    text-decoration: none;
    color: inherit;
}

.logo-link:hover {
    text-decoration: none;
    color: inherit;
}

.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin-bottom: 10px;
}

.logo i {
    font-size: 2.5rem;
    color: #ff6b6b;
}

.logo h1 {
    font-size: 2.5rem;
    font-weight: 700;
}

/* Mobile responsive for header */
@media (max-width: 768px) {
    .header-top {
        flex-direction: column;
        gap: 15px;
    }
    
    .logo-link {
        position: static;
        transform: none;
    }
    
    .home-link {
        align-self: flex-start;
    }
    
    .logo h1 {
        font-size: 2rem;
    }
    
    .logo i {
        font-size: 2rem;
    }
}

.subtitle {
    font-size: 1.1rem;
    opacity: 0.9;
    font-weight: 300;
}

/* Plan Selection */
.plan-selection {
    display: flex;
    gap: 20px;
    justify-content: center;
    margin: 20px 0;
    flex-wrap: wrap;
}

.plan-btn {
    padding: 15px 30px;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 250px;
    justify-content: center;
}

.free-btn {
    background: #28a745;
    color: white;
    border: 2px solid #28a745;
}

.free-btn:hover {
    background: #218838;
    border-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.pro-btn {
    background: #ffd700;
    color: #333;
    border: 2px solid #ffd700;
}

.pro-btn:hover {
    background: #ffed4e;
    border-color: #ffed4e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 215, 0, 0.3);
}

.upgrade-btn {
    background: #6f42c1;
    color: white;
    border: 2px solid #6f42c1;
}

.upgrade-btn:hover {
    background: #5a32a3;
    border-color: #5a32a3;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(111, 66, 193, 0.3);
}

/* Usage Display */
.usage-display {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.usage-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
}

.usage-plan {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    color: #FFD700;
}

.usage-plan i {
    font-size: 1.1rem;
}

.usage-stats {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.usage-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.usage-label {
    font-size: 0.8rem;
    opacity: 0.8;
}

.usage-value {
    font-weight: 600;
    font-size: 1rem;
}

/* Upgrade Section */
.upgrade-section {
    margin-top: 15px;
    text-align: center;
}

.upgrade-btn {
    background: linear-gradient(135deg, #ff6b6b, #ff8e8e);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.upgrade-btn:hover {
    background: linear-gradient(135deg, #ff5252, #ff7979);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(255, 107, 107, 0.3);
}

@media (max-width: 768px) {
    .usage-info {
        flex-direction: column;
        text-align: center;
    }
    
    .usage-stats {
        justify-content: center;
    }
}

/* Main content */
.main-content {
    background: white;
    border-radius: 20px;
    padding: 40px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    margin-bottom: 30px;
}

/* Converter section */
.converter-section {
    margin-bottom: 40px;
}

.instructions {
    margin-bottom: 30px;
}

.instruction-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 20px;
}

.instruction-card i {
    font-size: 2.5rem;
    margin-bottom: 15px;
}

.instruction-card h3 {
    margin: 0 0 10px 0;
    font-size: 1.5rem;
}

.instruction-card p {
    margin: 0;
    opacity: 0.9;
}

.steps-guide {
    display: grid;
    gap: 20px;
    margin-bottom: 30px;
}

.step-guide {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    background: #f8f9fa;
    padding: 20px;
    border-radius: 12px;
    border: 2px solid #e9ecef;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #667eea;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-content h4 {
    margin: 0 0 5px 0;
    color: #495057;
    font-size: 1.1rem;
}

.step-content p {
    margin: 0;
    color: #6c757d;
    font-size: 0.9rem;
}

.step-content kbd {
    background: #495057;
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.8rem;
    font-family: monospace;
}

.alternative-section {
    background: #fff3cd;
    padding: 25px;
    border-radius: 15px;
    border: 2px solid #ffeaa7;
    margin-top: 20px;
}

.alternative-section h4 {
    margin: 0 0 10px 0;
    color: #856404;
    font-size: 1.2rem;
}

.alternative-section p {
    margin: 0 0 15px 0;
    color: #856404;
}

.extension-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.extension-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.convert-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.convert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(102, 126, 234, 0.3);
}

.convert-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Process section */
.process-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 40px;
    border: 2px solid #e9ecef;
}

.process-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
}

.process-header h3 {
    color: #495057;
    font-size: 1.3rem;
}

.process-id {
    background: #667eea;
    color: white;
    padding: 5px 15px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

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

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

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #667eea, #764ba2);
    width: 0%;
    transition: width 0.5s ease;
}

.progress-text {
    text-align: center;
    color: #6c757d;
    font-weight: 500;
}

/* Process steps */
.process-steps {
    display: grid;
    gap: 15px;
    margin-bottom: 30px;
}

.step {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 20px;
    background: white;
    border-radius: 12px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
}

.step.active {
    border-color: #667eea;
    background: #f8f9ff;
}

.step.completed {
    border-color: #28a745;
    background: #f8fff9;
}

.step.failed {
    border-color: #dc3545;
    background: #fff8f8;
}

.step-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #6c757d;
    transition: all 0.3s ease;
}

.step.active .step-icon {
    background: #667eea;
    color: white;
}

.step.completed .step-icon {
    background: #28a745;
    color: white;
}

.step.failed .step-icon {
    background: #dc3545;
    color: white;
}

.step-content {
    flex: 1;
}

.step-content h4 {
    margin-bottom: 5px;
    color: #495057;
}

.step-content p {
    color: #6c757d;
    font-size: 0.9rem;
}

.step-status {
    font-size: 1.2rem;
    color: #6c757d;
}

.step.active .step-status {
    color: #667eea;
}

.step.completed .step-status {
    color: #28a745;
}

.step.failed .step-status {
    color: #dc3545;
}

/* Process actions */
.process-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.download-btn {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.download-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.3);
}

.new-conversion-btn {
    background: #6c757d;
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.new-conversion-btn:hover {
    background: #5a6268;
    transform: translateY(-2px);
}

/* History section */
.history-section {
    background: #f8f9fa;
    border-radius: 15px;
    padding: 30px;
    border: 2px solid #e9ecef;
}

.history-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.history-header h3 {
    color: #495057;
    font-size: 1.3rem;
}

.history-controls {
    display: flex;
    gap: 10px;
    align-items: center;
}

.refresh-btn, .clear-btn {
    background: #667eea;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.refresh-btn:hover {
    background: #5a6fd8;
    transform: rotate(180deg);
}

.clear-btn {
    background: #dc3545;
}

.clear-btn:hover {
    background: #c82333;
    transform: scale(1.1);
}


.history-list {
    max-height: 400px;
    overflow-y: auto;
}

.history-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: white;
    border-radius: 10px;
    margin-bottom: 10px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
}

.history-item:hover {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.history-info {
    flex: 1;
}

.history-title {
    font-weight: 600;
    color: #495057;
    margin-bottom: 4px;
    font-size: 0.95rem;
}

.history-url {
    color: #6c757d;
    font-size: 0.85rem;
    word-break: break-all;
    margin-bottom: 4px;
}

.history-date {
    color: #adb5bd;
    font-size: 0.75rem;
}

.history-note {
    text-align: center;
    padding: 15px;
    color: #6c757d;
    font-size: 0.9rem;
    background: #fff;
    border-radius: 8px;
    margin-top: 10px;
    border: 1px solid #e9ecef;
}

.history-note i {
    margin-right: 8px;
}

.history-status {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
}

.history-status.pending {
    background: #fff3cd;
    color: #856404;
}

.history-status.processing {
    background: #d1ecf1;
    color: #0c5460;
}

.history-status.completed {
    background: #d4edda;
    color: #155724;
}

.history-status.failed {
    background: #f8d7da;
    color: #721c24;
}

.history-actions {
    display: flex;
    gap: 8px;
}

.history-btn {
    background: #667eea;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
}

.history-btn:hover {
    background: #5a6fd8;
}

.history-btn.download {
    background: #28a745;
}

.history-btn.download:hover {
    background: #218838;
}

.loading-history {
    text-align: center;
    padding: 40px;
    color: #6c757d;
}

.loading-history i {
    font-size: 1.5rem;
    margin-bottom: 10px;
}

/* Footer */
.footer {
    text-align: center;
    color: white;
    opacity: 0.8;
    font-size: 0.9rem;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    background-color: white;
    margin: 15% auto;
    padding: 0;
    border-radius: 15px;
    width: 90%;
    max-width: 500px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
}

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

.modal-header h3 {
    margin: 0;
    color: #495057;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: #6c757d;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: #f8f9fa;
    color: #495057;
}

.modal-body {
    padding: 25px;
}

.modal-footer {
    padding: 20px 25px;
    border-top: 1px solid #e9ecef;
    text-align: right;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
}

.btn-primary {
    background: #667eea;
    color: white;
}

.btn-primary:hover {
    background: #5a6fd8;
}

/* Responsive design */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .main-content {
        padding: 20px;
    }
    
    .input-group {
        flex-direction: column;
    }
    
    .convert-btn {
        width: 100%;
        justify-content: center;
    }
    
    .process-actions {
        flex-direction: column;
    }
    
    .history-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .history-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

/* Animations */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.step.active .step-icon {
    animation: pulse 2s infinite;
}

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

.fa-spin {
    animation: spin 1s linear infinite;
}

/* Extension Section Styles */
.extension-section {
    margin-top: 20px;
    padding: 20px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.extension-instructions {
    margin-top: 20px;
}

.extension-instructions h5 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 8px;
}

.install-steps, .usage-steps {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-bottom: 20px;
}

.install-step, .usage-step {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 8px;
    border-left: 3px solid #4CAF50;
    margin-bottom: 8px;
}

.step-num {
    background: #4CAF50;
    color: white;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.step-icon {
    background: #2196F3;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.step-text {
    color: #333;
    line-height: 1.4;
}

.step-text strong {
    color: #FFD700;
    font-weight: 600;
}

.step-text code {
    background: rgba(0, 0, 0, 0.3);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9rem;
}

.tips-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(255, 193, 7, 0.2);
    border-radius: 8px;
    border: 1px solid rgba(255, 193, 7, 0.5);
}

.tips-section h5 {
    color: #FFD700;
    margin-bottom: 10px;
    font-size: 1rem;
}

.tips-list {
    list-style: none;
    padding: 0;
}

.tips-list li {
    color: #333;
    margin-bottom: 8px;
    padding-left: 20px;
    position: relative;
    line-height: 1.4;
}

.tips-list li:before {
    content: "✓";
    position: absolute;
    left: 0;
    color: #4CAF50;
    font-weight: bold;
}

/* Mobile responsive for extension instructions */
@media (max-width: 768px) {
    .extension-instructions {
        padding: 15px;
    }
    
    .install-step, .usage-step {
        flex-direction: column;
        text-align: center;
        gap: 8px;
    }
    
    .step-num, .step-icon {
        align-self: center;
    }
}
