/* === CSS chung cho các công cụ PDF === */
.tool-container {
    --primary-color: #0A84FF;
    --success-color: #30D158;
    --danger-color: #FF453A;
    --background-color: #1a1a2e;
    --container-bg: rgba(30, 30, 40, 0.6);
    --text-color: #f0f0f0;
    --text-color-muted: rgba(235, 235, 245, 0.6);
    font-family: 'Inter', sans-serif;
    padding: 1.5rem;
    height: 100%;
    overflow-y: auto;
}

.tool-container main,
.tool-container .container {
    background: var(--container-bg);
    backdrop-filter: blur(30px);
    -webkit-backdrop-filter: blur(30px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 1.5rem;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    width: 100%;
    max-width: 900px;
    padding: 2rem 2.5rem;
    margin: 0 auto;
}

.tool-container h1 {
    color: #fff;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 2.25rem;
    font-weight: 700;
}

.tool-container .subtitle {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--text-color-muted);
}

.tool-container .select-zone {
    border: 2px dashed rgba(255, 255, 255, 0.2);
    border-radius: 1rem;
    padding: 3rem;
    text-align: center;
    cursor: pointer;
    transition: background-color 0.3s, border-color 0.3s;
}

.tool-container .select-zone:hover,
.tool-container .select-zone.dragover {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: var(--primary-color);
}

.tool-container .select-zone p {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: rgba(255, 255, 255, 0.7);
}

.tool-container .btn {
    background-color: var(--primary-color);
    color: white;
    padding: 12px 25px;
    border: none;
    border-radius: 0.75rem;
    cursor: pointer;
    font-size: 1em;
    font-weight: 600;
    transition: all 0.2s;
    box-shadow: 0 4px 15px rgba(0, 122, 255, 0.3);
    width: 100%;
}

.tool-container .btn:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 122, 255, 0.4);
}

.tool-container .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: none;
}

.tool-container .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

.tool-container .btn:disabled {
    background-color: rgba(120, 120, 128, 0.36);
    color: var(--text-color-muted);
    cursor: not-allowed;
    box-shadow: none;
}

.tool-container .btn:disabled:hover {
    transform: none;
}

.tool-container input[type="file"] {
    display: none;
}

.tool-container input[type="password"],
.tool-container input[type="number"],
.tool-container input[type="text"],
.tool-container input[type="color"],
.tool-container select {
    width: 100%;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 0.75rem;
    color: #fff;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    margin-bottom: 1rem;
}

.tool-container .file-info {
    background: rgba(0, 0, 0, 0.2);
    padding: 1rem;
    border-radius: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.tool-container .file-info div {
    display: flex;
    justify-content: space-between;
}

.tool-container .file-info span:first-child {
    color: var(--text-color-muted);
}

.tool-container .loader {
    border: 4px solid rgba(255, 255, 255, 0.2);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

.tool-container #processing-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 9999;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: #fff;
    text-align: center;
}

.tool-container .sticky-footer {
    position: sticky;
    bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    padding: 1rem;
    z-index: 100;
}

.tool-container .card-main:hover .page-actions {
    opacity: 1;
}

.tool-container .page-actions {
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 1rem;
    padding: 5px 10px;
    opacity: 0;
    transition: opacity 0.2s;
    z-index: 10;
}

.tool-container .action-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.tool-container .action-btn:hover {
    color: var(--primary-color);
}

.tool-container .card-main.marked-for-deletion {
    opacity: 0.5;
    border: 2px solid var(--danger-color);
}

.tool-container .card-main {
    position: relative;
}

.tool-container .card-preview canvas {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    display: block;
    transition: transform 0.3s ease;
}

.tool-container .tab-nav {
    display: flex;
    background: rgba(0, 0, 0, 0.2);
    border-radius: 0.75rem;
    padding: 4px;
    margin-bottom: 1rem;
}

.tool-container .tab-button {
    flex: 1;
    padding: 0.5rem;
    border: none;
    background: transparent;
    color: var(--text-color-muted);
    font-weight: 500;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-container .tab-button.active {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}