/* ==========================================================================
   LEXOSIGN - STANDALONE TOOL PAGES
   Clean, focused UI for individual PDF tools
   ========================================================================== */

/* ===== TOOL PAGE CONTAINER ===== */
.tool-page {
    min-height: calc(100vh - 80px);
    background: linear-gradient(135deg, #0b1220 0%, #111827 45%, #1e293b 100%);
    padding: 2rem 1rem 4rem;
}

.tool-container {
    max-width: 700px;
    margin: 0 auto;
}

/* ===== TOOL HEADER ===== */
.tool-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.tool-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: inline-block;
    filter: drop-shadow(0 4px 12px rgba(244, 185, 66, 0.3));
    animation: toolIconFloat 3s ease-in-out infinite;
}

@keyframes toolIconFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-8px); }
}

.tool-header h1 {
    font-size: 2.5rem;
    font-weight: 800;
    color: #f8fafc;
    margin-bottom: 0.5rem;
    font-family: 'Merriweather', 'Georgia', serif;
}

.tool-header p {
    font-size: 1.125rem;
    color: #94a3b8;
    margin: 0;
}

/* ===== TOOL MAIN CARD ===== */
.tool-card {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border-radius: 20px;
    padding: 2.5rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(244, 185, 66, 0.2);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    position: relative;
    overflow: hidden;
}

.tool-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #D4AF37, #F4B942, #D4AF37);
}

/* ===== UPLOAD DROPZONE ===== */
.tool-upload-area {
    border: 2px dashed rgba(244, 185, 66, 0.4);
    border-radius: 16px;
    padding: 3rem 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(244, 185, 66, 0.03);
    margin-bottom: 1.5rem;
    position: relative;
}

.tool-upload-area:hover,
.tool-upload-area.dragover {
    border-color: #F4B942;
    background: rgba(244, 185, 66, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(244, 185, 66, 0.15);
}

.tool-upload-area.has-files {
    border-color: #10b981;
    background: rgba(16, 185, 129, 0.08);
}

.upload-icon {
    font-size: 3.5rem;
    margin-bottom: 1rem;
    display: block;
    transition: transform 0.3s ease;
}

.tool-upload-area:hover .upload-icon {
    transform: scale(1.1);
}

.tool-upload-area p {
    color: #94a3b8;
    font-size: 1rem;
    margin: 0;
}

.browse-link {
    color: #F4B942;
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
}

.browse-link:hover {
    color: #D4AF37;
}

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

/* ===== FILE LIST ===== */
.file-list {
    margin-bottom: 1.5rem;
}

.file-list:empty {
    display: none;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    padding: 0.875rem 1rem;
    margin-bottom: 0.5rem;
    transition: all 0.2s ease;
}

.file-item:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(244, 185, 66, 0.3);
}

.file-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
}

.file-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.file-details {
    flex: 1;
    min-width: 0;
}

.file-name {
    color: #f8fafc;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    color: #64748b;
    font-size: 0.8rem;
}

.file-remove {
    background: rgba(239, 68, 68, 0.15);
    border: none;
    color: #ef4444;
    width: 32px;
    height: 32px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.file-remove:hover {
    background: rgba(239, 68, 68, 0.3);
    transform: scale(1.1);
}

/* ===== TOOL OPTIONS ===== */
.tool-options {
    margin-bottom: 1.5rem;
}

.tool-options-title {
    color: #f8fafc;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-options-title::before {
    content: '';
    width: 4px;
    height: 16px;
    background: linear-gradient(180deg, #F4B942, #D4AF37);
    border-radius: 2px;
}

.tool-input {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #f8fafc;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

.tool-input:focus {
    outline: none;
    border-color: #F4B942;
    box-shadow: 0 0 0 3px rgba(244, 185, 66, 0.15);
    background: rgba(255, 255, 255, 0.08);
}

.tool-input::placeholder {
    color: #64748b;
}

.tool-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    color: #f8fafc;
    font-size: 0.95rem;
    cursor: pointer;
    transition: all 0.3s ease;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 1.25rem;
    padding-right: 2.5rem;
}

.tool-select:focus {
    outline: none;
    border-color: #F4B942;
    box-shadow: 0 0 0 3px rgba(244, 185, 66, 0.15);
}

.tool-select option {
    background: #1e293b;
    color: #f8fafc;
}

/* Option Group */
.option-group {
    margin-bottom: 1rem;
}

.option-group:last-child {
    margin-bottom: 0;
}

.option-label {
    display: block;
    color: #94a3b8;
    font-size: 0.85rem;
    margin-bottom: 0.5rem;
}

/* ===== PROCESS BUTTON ===== */
.btn-process {
    width: 100%;
    padding: 1.125rem 2rem;
    background: linear-gradient(135deg, #F4B942 0%, #D4AF37 100%);
    border: none;
    border-radius: 12px;
    color: #0f172a;
    font-weight: 700;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    box-shadow: 0 8px 20px rgba(244, 185, 66, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-process:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(244, 185, 66, 0.4);
    background: linear-gradient(135deg, #D4AF37 0%, #B8960C 100%);
}

.btn-process:active:not(:disabled) {
    transform: translateY(0);
}

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

.btn-process .btn-text {
    display: inline;
}

.btn-process .btn-loading {
    display: none;
}

.btn-process.loading .btn-text {
    display: none;
}

.btn-process.loading .btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.btn-process .spinner {
    width: 20px;
    height: 20px;
    border: 2px solid rgba(15, 23, 42, 0.3);
    border-top-color: #0f172a;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* ===== RESULT SECTION ===== */
.tool-result {
    background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.5rem;
    border: 1px solid rgba(16, 185, 129, 0.3);
    text-align: center;
    animation: resultSlideIn 0.4s ease;
}

@keyframes resultSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.result-success {
    margin-bottom: 1.5rem;
}

.success-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #10b981 0%, #34d399 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    font-size: 2rem;
    color: white;
    box-shadow: 0 8px 20px rgba(16, 185, 129, 0.3);
}

.result-success h3 {
    color: #d1fae5;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
}

.result-info {
    color: #a7f3d0;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

.result-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.btn-download,
.btn-canvas {
    flex: 1;
    min-width: 200px;
    padding: 1rem 1.5rem;
    border-radius: 10px;
    font-weight: 600;
    font-size: 1rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    cursor: pointer;
    border: none;
}

.btn-download {
    background: linear-gradient(135deg, #F4B942 0%, #D4AF37 100%);
    color: #0f172a;
    box-shadow: 0 6px 16px rgba(244, 185, 66, 0.3);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(244, 185, 66, 0.4);
}

.btn-canvas {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.btn-canvas:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-2px);
}

/* ===== TIPS SECTION ===== */
.tool-tips {
    background: rgba(244, 185, 66, 0.08);
    border-left: 4px solid #F4B942;
    border-radius: 0 12px 12px 0;
    padding: 1.25rem 1.5rem;
}

.tool-tips h3 {
    color: #F4B942;
    font-size: 0.95rem;
    font-weight: 700;
    margin: 0 0 0.75rem 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.tool-tips ul {
    margin: 0;
    padding: 0 0 0 1.25rem;
    color: #94a3b8;
    font-size: 0.9rem;
    line-height: 1.7;
}

.tool-tips li {
    margin-bottom: 0.25rem;
}

.tool-tips li:last-child {
    margin-bottom: 0;
}

/* ===== PROGRESS BAR ===== */
.progress-container {
    margin-bottom: 1.5rem;
}

.progress-container.hidden {
    display: none !important;
}

.progress-bar {
    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, #F4B942, #10b981);
    border-radius: 4px;
    transition: width 0.3s ease;
    width: 0%;
}

.progress-text {
    color: #94a3b8;
    font-size: 0.85rem;
    text-align: center;
}

/* ===== ERROR STATE ===== */
.tool-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 12px;
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: flex-start;
    gap: 1rem;
}

.error-icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.error-content {
    flex: 1;
}

.error-title {
    color: #fca5a5;
    font-weight: 600;
    margin: 0 0 0.25rem 0;
}

.error-message {
    color: #fca5a5;
    font-size: 0.9rem;
    margin: 0;
    opacity: 0.9;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .tool-page {
        padding: 1.5rem 1rem 3rem;
    }

    .tool-container {
        max-width: 100%;
    }

    .tool-header h1 {
        font-size: 2rem;
    }

    .tool-icon {
        font-size: 3rem;
    }

    .tool-card {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .tool-upload-area {
        padding: 2rem 1.5rem;
    }

    .upload-icon {
        font-size: 2.5rem;
    }

    .result-actions {
        flex-direction: column;
    }

    .btn-download,
    .btn-canvas {
        min-width: 100%;
    }
}

@media (max-width: 480px) {
    .tool-header h1 {
        font-size: 1.75rem;
    }

    .tool-header p {
        font-size: 1rem;
    }

    .tool-card {
        padding: 1.25rem;
    }

    .file-item {
        padding: 0.75rem;
    }

    .file-name {
        font-size: 0.85rem;
    }

    .btn-process {
        padding: 1rem 1.5rem;
        font-size: 1rem;
    }
}

/* ===== DRAG OVERLAY ===== */
.drag-overlay {
    position: fixed;
    inset: 0;
    background: rgba(244, 185, 66, 0.1);
    backdrop-filter: blur(4px);
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.drag-overlay.active {
    display: flex;
}

.drag-overlay-content {
    background: linear-gradient(135deg, #1e293b 0%, #334155 100%);
    border: 3px dashed #F4B942;
    border-radius: 24px;
    padding: 3rem 4rem;
    text-align: center;
    box-shadow: 0 24px 48px rgba(0, 0, 0, 0.4);
}

.drag-overlay-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
    animation: bounce 0.5s ease infinite alternate;
}

@keyframes bounce {
    from { transform: translateY(0); }
    to { transform: translateY(-10px); }
}

.drag-overlay-text {
    color: #f8fafc;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 0;
}

@media (max-width: 480px) {
    .drag-overlay-content {
        padding: 1.5rem 1.25rem;
        margin: 0 1rem;
    }
    .drag-overlay-icon {
        font-size: 3rem;
    }
    .drag-overlay-text {
        font-size: 1rem;
    }
}
