/**
 * PDF Tools - Dark Mode Styling
 * Inspired by ilovepdf.com
 */

/* ===== Main Container ===== */
.pdf-tools-main {
    min-height: calc(100vh - 200px);
}

.tools-section {
    padding: 3rem 0;
}

/* ===== Tools Grid ===== */
.tools-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* ===== Tool Card ===== */
.tool-card {
    background: var(--bg-card, #1a1a1a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-primary, #ffffff);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #00D4FF 0%, #7B2CBF 100%);
    transform: scaleX(0);
    transition: transform 0.3s ease;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    border-color: rgba(0, 212, 255, 0.3);
}

.tool-card:hover::before {
    transform: scaleX(1);
}

.tool-card .tool-icon {
    width: 80px;
    height: 80px;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.tool-card:hover .tool-icon {
    transform: scale(1.1) rotate(5deg);
}

.tool-card h3 {
    margin: 0 0 0.75rem 0;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--text-primary, #ffffff);
}

.tool-card p {
    margin: 0 0 1rem 0;
    color: var(--text-secondary, #b0b0b0);
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.tool-card .tool-arrow {
    font-size: 1.5rem;
    color: var(--accent-blue, #00D4FF);
    transition: transform 0.3s ease;
    margin-top: auto;
}

.tool-card:hover .tool-arrow {
    transform: translateX(8px);
}

/* ===== Tool Page Styles ===== */
.pdf-tool-page {
    min-height: calc(100vh - 200px);
    padding: 3rem 0;
}

.tool-container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.tool-header {
    text-align: center;
    margin-bottom: 3rem;
}

.tool-header h1 {
    font-size: 2.5rem;
    margin: 0 0 1rem 0;
    background: linear-gradient(135deg, #00D4FF 0%, #7B2CBF 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tool-header p {
    color: var(--text-secondary, #b0b0b0);
    font-size: 1.1rem;
}

/* ===== Upload Area ===== */
.upload-area {
    background: var(--bg-card, #1a1a1a);
    border: 2px dashed rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s ease;
    margin-bottom: 2rem;
}

.upload-area.dragover {
    border-color: var(--accent-blue, #00D4FF);
    background: rgba(0, 212, 255, 0.05);
    transform: scale(1.02);
}

.upload-area-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: var(--accent-blue, #00D4FF);
}

.upload-area h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.5rem;
    color: var(--text-primary, #ffffff);
}

.upload-area p {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary, #b0b0b0);
}

.upload-btn {
    display: inline-block;
    background: linear-gradient(135deg, #00D4FF 0%, #7B2CBF 100%);
    color: #ffffff;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.upload-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
}

.upload-btn input[type="file"] {
    display: none;
}

/* ===== File List ===== */
.file-list {
    margin-top: 2rem;
}

.file-item {
    background: var(--bg-card, #1a1a1a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 1rem 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.file-item:hover {
    border-color: rgba(0, 212, 255, 0.3);
    transform: translateX(4px);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex: 1;
}

.file-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #00D4FF 0%, #7B2CBF 100%);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-weight: 600;
}

.file-details {
    flex: 1;
}

.file-name {
    font-weight: 600;
    color: var(--text-primary, #ffffff);
    margin: 0 0 0.25rem 0;
}

.file-size {
    font-size: 0.875rem;
    color: var(--text-secondary, #b0b0b0);
    margin: 0;
}

.file-actions {
    display: flex;
    gap: 0.5rem;
}

.btn-remove {
    background: rgba(255, 77, 77, 0.1);
    color: #ff4d4d;
    border: 1px solid rgba(255, 77, 77, 0.3);
    padding: 0.5rem 1rem;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.875rem;
}

.btn-remove:hover {
    background: rgba(255, 77, 77, 0.2);
    border-color: #ff4d4d;
}

/* ===== Process Button ===== */
.process-section {
    margin-top: 2rem;
    text-align: center;
}

.btn-process {
    background: linear-gradient(135deg, #00D4FF 0%, #7B2CBF 100%);
    color: #ffffff;
    padding: 1rem 3rem;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 200px;
}

.btn-process:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 212, 255, 0.3);
}

.btn-process:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* ===== Progress Bar ===== */
.progress-container {
    margin-top: 2rem;
    display: none;
}

.progress-container.active {
    display: block;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 0.5rem;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #00D4FF 0%, #7B2CBF 100%);
    width: 0%;
    transition: width 0.3s ease;
    border-radius: 4px;
}

.progress-text {
    text-align: center;
    color: var(--text-secondary, #b0b0b0);
    font-size: 0.875rem;
}

/* ===== Result Section ===== */
.result-section {
    margin-top: 2rem;
    display: none;
}

.result-section.active {
    display: block;
}

.result-card {
    background: var(--bg-card, #1a1a1a);
    border: 1px solid rgba(0, 212, 255, 0.3);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.result-icon {
    font-size: 4rem;
    color: #4ade80;
    margin-bottom: 1rem;
}

.result-card h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary, #ffffff);
    font-size: 1.5rem;
}

.result-card p {
    margin: 0 0 1.5rem 0;
    color: var(--text-secondary, #b0b0b0);
}

.btn-download {
    background: linear-gradient(135deg, #4ade80 0%, #22c55e 100%);
    color: #ffffff;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(74, 222, 128, 0.3);
}

/* ===== Error Message ===== */
.error-message {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.3);
    border-radius: 8px;
    padding: 1rem;
    margin-top: 1rem;
    color: #ff4d4d;
    display: none;
}

.error-message.active {
    display: block;
}

/* ===== Additional Options (for Split PDF) ===== */
.options-section {
    background: var(--bg-card, #1a1a1a);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 2rem;
}

.options-section h3 {
    margin: 0 0 1rem 0;
    color: var(--text-primary, #ffffff);
    font-size: 1.25rem;
}

.option-group {
    margin-bottom: 1rem;
}

.option-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-secondary, #b0b0b0);
    font-size: 0.9rem;
}

.option-group input,
.option-group select {
    width: 100%;
    padding: 0.75rem;
    background: var(--bg-secondary, #1f1f1f);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 6px;
    color: var(--text-primary, #ffffff);
    font-size: 1rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23ffffff' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
}

.option-group input:focus,
.option-group select:focus {
    outline: none;
    border-color: var(--accent-blue, #00D4FF);
    background-color: var(--bg-secondary, #1f1f1f);
}

.option-group select option {
    background: var(--bg-secondary, #1f1f1f);
    color: var(--text-primary, #ffffff);
    padding: 0.5rem;
}

/* Ensure select dropdown works in all browsers */
.option-group select::-ms-expand {
    display: none;
}

.option-group select {
    cursor: pointer;
}

.option-group select:hover {
    border-color: rgba(255, 255, 255, 0.2);
}

.option-group select:active,
.option-group select:focus {
    background-color: var(--bg-secondary, #1f1f1f);
    color: var(--text-primary, #ffffff);
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
    .tools-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .tool-header h1 {
        font-size: 2rem;
    }
    
    .upload-area {
        padding: 2rem 1rem;
    }
    
    .file-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .file-actions {
        width: 100%;
        justify-content: flex-end;
    }
}

