/*
All-in-One PDF Tools - Frontend Styles
Version: 1.0.0
*/

/* Reset */
.aiopdf-container * {
    box-sizing: border-box;
}

/* Main Container */
.aiopdf-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
}

/* Card Layout */
.aiopdf-card {
    background: #ffffff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.06);
    margin-bottom: 25px;
}

/* Title */
.aiopdf-title {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 10px;
    text-align: center;
}

/* Subtitle */
.aiopdf-subtitle {
    text-align: center;
    color: #666;
    margin-bottom: 25px;
}

/* Input */
.aiopdf-input {
    width: 100%;
    padding: 14px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 15px;
    margin-bottom: 15px;
}

.aiopdf-input:focus {
    outline: none;
    border-color: var(--aiopdf-primary);
}

/* Button */
.aiopdf-btn {
    background: var(--aiopdf-primary);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: 6px;
    font-size: 15px;
    cursor: pointer;
    width: 100%;
    font-weight: 600;
    transition: 0.2s;
}

.aiopdf-btn:hover {
    background: #005f8d;
}

/* Secondary Button */
.aiopdf-btn-secondary {
    background: #f1f1f1;
    color: #333;
}

.aiopdf-btn-secondary:hover {
    background: #e1e1e1;
}

/* Options Row */
.aiopdf-options {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 15px;
}

.aiopdf-option {
    background: #f7f7f7;
    padding: 8px 12px;
    border-radius: 5px;
    font-size: 13px;
}

/* Loader */
.aiopdf-loader {
    display: none;
    text-align: center;
    padding: 20px;
}

.aiopdf-loader:after {
    content: "";
    width: 35px;
    height: 35px;
    border: 4px solid #ddd;
    border-top-color: var(--aiopdf-primary);
    border-radius: 50%;
    display: inline-block;
    animation: aiopdf-spin 1s linear infinite;
}

@keyframes aiopdf-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Related Tools Grid */
.aiopdf-related {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 15px;
}

.aiopdf-related-card {
    background: #fff;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    box-shadow: 0 1px 6px rgba(0,0,0,0.05);
    transition: 0.2s;
}

.aiopdf-related-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 14px rgba(0,0,0,0.08);
}

.aiopdf-related-card a {
    text-decoration: none;
    color: #333;
    font-weight: 600;
}

/* Download Button */
.aiopdf-download {
    display: none;
    margin-top: 15px;
}

/* Ad Space */
.aiopdf-ad {
    background: #f8f8f8;
    border: 1px dashed #ddd;
    text-align: center;
    padding: 20px;
    margin: 20px 0;
    border-radius: 6px;
}

/* How it Works */
.aiopdf-steps {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    margin-top: 25px;
}

.aiopdf-step {
    width: 32%;
    background: #fafafa;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
}

.aiopdf-step-number {
    font-size: 20px;
    font-weight: 700;
    color: var(--aiopdf-primary);
    margin-bottom: 8px;
}

/* Mobile Responsive */
@media (max-width: 768px) {

    .aiopdf-step {
        width: 100%;
        margin-bottom: 10px;
    }

    .aiopdf-title {
        font-size: 22px;
    }

    .aiopdf-container {
        padding: 15px;
    }

}

    .aiopdf-file-preview{
        display:flex;
        align-items:center;
        padding:20px;
        border:1px solid #ddd;
        border-radius:10px;
        margin-top:15px;
    }

    .aiopdf-file-details{
        flex:1;
    }

    #aiopdf-file-name{
        font-weight:bold;
        margin-bottom:5px;
    }

    #aiopdf-file-size{
        color:#666;
        font-size:14px;
    }

    .aiopdf-pdf-preview-wrapper{
        width:220px;
        border:1px solid #ddd;
        border-radius:10px;
        overflow:hidden;
        background:#fff;
        margin-right:20px;
    }

    #aiopdf-pdf-preview{
        width:100%;
        height:auto;
        display:block;
    }

/*
|--------------------------------------------------------------------------
| Download Button Center
|--------------------------------------------------------------------------
*/

#aiopdf-compress-download{

    margin-top: 20px;

    text-align: center;

}

#aiopdf-compress-stats{

    margin-top: 25px;

}

.aiopdf-stats-card{

    background: #f5f7fb;

    padding: 20px;

    border-radius: 14px;

    text-align: center;

}

.aiopdf-stat-item{

    margin: 10px 0;

    font-size: 16px;

}

.aiopdf-image-preview{
    display:flex;
    flex-wrap:wrap;
    gap:15px;
    margin-top:20px;
}

.aiopdf-thumb{
    width:120px;
    height:150px;
    border:2px solid #ddd;
    border-radius:10px;
    overflow:hidden;
    cursor:move;
    position:relative;
    background:#fff;
}

.aiopdf-thumb img{
    width:100%;
    height:100%;
    object-fit:cover;
}

.aiopdf-thumb span{
    position:absolute;
    top:5px;
    right:5px;
    background:#000;
    color:#fff;
    width:24px;
    height:24px;
    border-radius:50%;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:12px;
}

.aiopdf-thumb.dragging{
    opacity:0.5;
}

.aiopdf-remove-btn{
    position:absolute;
    top:5px;
    left:5px;
    width:24px;
    height:24px;
    border:none;
    border-radius:50%;
    background:#ff3b30;
    color:#fff;
    font-size:18px;
    line-height:1;
    cursor:pointer;
    z-index:10;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:0;
}

.aiopdf-remove-btn:hover{
    opacity:0.9;
}

.aiopdf-download{
    margin-top:20px;
    text-align:center;
}

.aiopdf-success{
    margin-bottom:15px;
    font-weight:600;
}

.aiopdf-options{
    display:flex;
    gap:20px;
    flex-wrap:wrap;
    margin-bottom:20px;
}

.aiopdf-option{
    display:flex;
    flex-direction:column;
    gap:5px;
}

.aiopdf-page-preview{
    position:relative;
    overflow:hidden;
    border:1px solid #ddd;
    background:#fff;

    display:flex;
    align-items:center;
    justify-content:center;

    box-sizing:border-box;
}

.aiopdf-page-preview img{
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
    margin:0;
    padding:0;
}

.aiopdf-thumb{
    display:flex;
    flex-direction:column;
    align-items:center;
}
/* PDF PREVIEW CONTAINER */
#aiopdf-pdf-preview{
    display:flex;
    flex-wrap:wrap;
    gap:15px;
    margin-top:20px;
    justify-content:flex-start;
}

/* PDF CARD */
#aiopdf-pdf-preview .aiopdf-thumb{
    width:140px;
    position:relative;
    text-align:center;
    overflow:visible;
    cursor:grab;
}

/* PDF PAGE PREVIEW */
#aiopdf-pdf-preview .aiopdf-page-preview{
    width:140px;
    height:180px;
    border-bottom:0px solid #ddd;
    border-top: 0px solid #ddd;
    border-radius:8px;
    overflow:hidden;
    background:#fff;
    display:flex;
    justify-content:center;
    align-items:center;
}

/* PDF ICON TEXT */
#aiopdf-pdf-preview .aiopdf-page-preview span{
    font-size:32px;
    font-weight:700;
    color:#e53935;
}

/* FILE NAME */
#aiopdf-pdf-preview .aiopdf-thumb > span{
    display:block;
    margin-top:8px;
    font-size:13px;
    word-break:break-word;
    line-height:1.4;
}

/* REMOVE BUTTON */
#aiopdf-pdf-preview .aiopdf-remove-btn{
    position:absolute;
    top:-10px;
    right:-10px;
    width:28px;
    height:28px;
    border:none;
    border-radius:50%;
    background:#ff4d4f;
    color:#fff;
    font-size:18px;
    line-height:28px;
    cursor:pointer;
    z-index:999;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
}

#aiopdf-pdf-preview .aiopdf-thumb > span:last-child{
    display:block;
    margin-top:8px;
    font-size:12px;
    line-height:1.4;
    word-break:break-word;
}

/* REMOVE BUTTON HOVER */
#aiopdf-pdf-preview .aiopdf-remove-btn:hover{
    opacity:0.9;
}

/* MOBILE */
@media (max-width:768px){

    #aiopdf-pdf-preview .aiopdf-thumb{
        width:110px;
    }

    #aiopdf-pdf-preview .aiopdf-page-preview{
        width:110px;
        height:150px;
    }

    #aiopdf-pdf-preview .aiopdf-remove-btn{
        right:-8px;
        top:-8px;
    }

}

/* DRAGGING ITEM */
.aiopdf-thumb.dragging{
    opacity:.5;
    cursor:grabbing;
}

/* NORMAL ITEM */
.aiopdf-thumb{
    cursor:grab;
    transition:transform .2s ease;
}

/* HOVER EFFECT */
.aiopdf-thumb:hover{
    transform:translateY(-2px);
}

.aiopdf-pdf-canvas{
    width:100%;
    height:100%;
    object-fit:contain;
    display:block;
}

/* SERIAL NUMBER BADGE */
.aiopdf-page-number{
    position:absolute;
    top:8px;
    right:8px;
    left:auto;

    width:28px;
    height:28px;

    border-radius:50%;
    background:#000;
    color:#fff;

    display:flex;
    align-items:center;
    justify-content:center;

    font-size:14px;
    font-weight:600;

    z-index:20;
}

.aiopdf-file-name{
    margin-top:3px;
    text-align:center;
    font-size:12px;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
    max-width:140px;
    padding:0 8px 6px 8px;
}

.aiopdf-paper-selector{
    display:flex;
    gap:15px;
    margin:20px 0;
    flex-wrap:wrap;
    justify-content:center;
}

.aiopdf-paper-thumb{
    cursor:pointer;
    text-align:center;
}

.aiopdf-paper-thumb input{
    display:none;
}

.aiopdf-paper-preview{
    background:#fff;
    border:2px solid #ddd;
    border-radius:8px;
    box-shadow:0 2px 6px rgba(0,0,0,.08);
    margin-bottom:8px;
    transition:all .2s ease;
}

.aiopdf-paper-preview.a4{
    width:60px;
    height:85px;
}

.aiopdf-paper-preview.letter{
    width:65px;
    height:84px;
}

.aiopdf-paper-preview.legal{
    width:60px;
    height:100px;
}

.aiopdf-paper-preview.a3{
    width:85px;
    height:120px;
}

.aiopdf-paper-thumb.active .aiopdf-paper-preview{
    border-color:#2271b1;
    transform:scale(1.05);
}

.aiopdf-paper-thumb span,
.aiopdf-margin-thumb span{
    display:block;
    width:100%;
    margin-top:6px;
    text-align:center;
    font-size:13px;
    line-height:1.2;
}

.aiopdf-margin-selector{
    display:flex;
    gap:15px;
    flex-wrap:wrap;
    justify-content:center;
    margin:25px 0;
}

.aiopdf-margin-thumb{
    cursor:pointer;
    text-align:center;
}

.aiopdf-margin-thumb input{
    display:none;
}

.aiopdf-margin-preview{
    width:70px;
    height:90px;
    background:#fff;
    border:2px solid #ddd;
    border-radius:8px;
    position:relative;
    margin-bottom:8px;
    transition:all .2s ease;
}

.aiopdf-margin-preview .page{
    position:absolute;
    background:#e9ecef;
}

.aiopdf-margin-preview.none .page{
    top:2px;
    left:2px;
    right:2px;
    bottom:2px;
}

.aiopdf-margin-preview.small .page{
    top:8px;
    left:8px;
    right:8px;
    bottom:8px;
}

.aiopdf-margin-preview.medium .page{
    top:14px;
    left:14px;
    right:14px;
    bottom:14px;
}

.aiopdf-margin-preview.large .page{
    top:20px;
    left:20px;
    right:20px;
    bottom:20px;
}

.aiopdf-margin-thumb.active .aiopdf-margin-preview{
    border-color:#2271b1;
    transform:scale(1.05);
}

.aiopdf-margin-thumb span{
    display:block;
    font-size:14px;
    font-weight:600;
}

.aiopdf-paper-selector,
.aiopdf-margin-selector{
    display:flex;
    justify-content:center;
    gap:15px;
    flex-wrap:wrap;
}

.aiopdf-paper-thumb,
.aiopdf-margin-thumb{
    flex:none;
    width:90px;
    text-align:center;
    display:flex;
    flex-direction:column;
    align-items:center;
}

@media (max-width: 768px){

    .aiopdf-paper-selector,
    .aiopdf-margin-selector{
        gap:6px;
        flex-wrap:nowrap;
    }

    .aiopdf-paper-preview.a4{
        width:40px;
        height:57px;
    }

    .aiopdf-paper-preview.letter{
        width:43px;
        height:56px;
    }

    .aiopdf-paper-preview.legal{
        width:40px;
        height:67px;
    }

    .aiopdf-paper-preview.a3{
        width:57px;
        height:80px;
    }

    .aiopdf-margin-preview{
        width:50px;
        height:65px;
    }

    .aiopdf-paper-thumb span,
    .aiopdf-margin-thumb span{
        font-size:12px;
    }
}

@media (max-width: 768px){

    .aiopdf-paper-thumb,
    .aiopdf-margin-thumb{
        flex:1 1 25%;
        width:auto;
    }

}

.aiopdf-orientation-selector{
    display:flex;
    justify-content:center;
    gap:15px;
    margin:15px 0 20px;
}

.aiopdf-orientation-thumb{
    cursor:pointer;
    width:90px;
    text-align:center;
    display:flex;
    flex-direction:column;
    align-items:center;
}

.aiopdf-orientation-thumb input{
    display:none;
}

.aiopdf-orientation-preview{
    border:2px solid #ddd;
    border-radius:8px;
    background:#fff;
    box-shadow:0 2px 6px rgba(0,0,0,.08);
    transition:all .2s ease;
}

.aiopdf-orientation-preview.portrait{
    width:55px;
    height:75px;
}

.aiopdf-orientation-preview.landscape{
    width:75px;
    height:55px;
}

.aiopdf-orientation-thumb.active .aiopdf-orientation-preview{
    border-color:#2271b1;
    transform:scale(1.05);
}

.aiopdf-orientation-thumb span{
    margin-top:6px;
    font-size:13px;
    font-weight:600;
}

#aiopdf-options-container{
    max-height:0;
    opacity:0;
    overflow:hidden;
    transition:
        max-height .4s ease,
        opacity .3s ease,
        margin-top .3s ease;

    margin-top:0;
}

#aiopdf-options-container.show{
    max-height:1000px;
    opacity:1;
    margin-top:20px;
}

.aiopdf-btn:disabled{
    opacity:.6;
    cursor:not-allowed;
}

.aiopdf-thumb-row{
    display:flex;
    justify-content:center;
    gap:30px;
    flex-wrap:wrap;
}

.aiopdf-thumb-2{
    display:flex;
    flex-direction:column;
    align-items:center;
    cursor:pointer;
    text-align:center;
}

.aiopdf-thumb-2 input{
    display:none;
}

.aiopdf-screen-icon{
    border:2px solid #d1d5db;
    border-radius:8px;
    background:#f8f9fa;
    margin-bottom:6px;
    transition:all .2s ease;
}

.aiopdf-screen-1920{
    width:70px;
    height:45px;
}

.aiopdf-screen-1440{
    width:60px;
    height:45px;
}

.aiopdf-screen-768{
    width:40px;
    height:45px;
}

.aiopdf-screen-320{
    width:22px;
    height:45px;
}

.aiopdf-thumb-2 input:checked + .aiopdf-screen-icon{
    border-color:#2271b1;
    transform:scale(1.05);
}

.aiopdf-thumb-2 span{
    font-size:13px;
    font-weight:500;
}

@media (max-width: 768px){

    .aiopdf-thumb-row{
        gap:8px;
    }

    .aiopdf-screen-1920{
        width:50px;
        height:32px;
    }

    .aiopdf-screen-1440{
        width:42px;
        height:32px;
    }

    .aiopdf-screen-768{
        width:28px;
        height:32px;
    }

    .aiopdf-screen-320{
        width:16px;
        height:32px;
    }

    .aiopdf-thumb-2 span{
        font-size:11px;
    }
}

.aiopdf-pdf-thumb{
    width:120px;
    height:150px;
    margin:0 auto 15px;
    background:#fff;
    border:2px solid #ddd;
    border-radius:8px;
    display:flex;
    align-items:center;
    justify-content:center;
    position:relative;
    box-shadow:0 2px 8px rgba(0,0,0,0.08);
}

.aiopdf-pdf-icon{
    font-size:60px;
}

.aiopdf-lock-icon{
    position:absolute;
    bottom:10px;
    right:10px;
    font-size:28px;
}

#aiopdf-status{
    text-align:center;
    margin-top:10px;
    font-size:15px;
    font-weight:500;
}

.aiopdf-analyzing{
    display:flex;
    align-items:center;
    justify-content:center;
    gap:8px;
}

.aiopdf-analyzing .spinner{
    width:16px;
    height:16px;
    border:2px solid #ddd;
    border-top-color:#2271b1;
    border-radius:50%;
    animation:aiopdf-spin .8s linear infinite;
}

@keyframes aiopdf-spin{
    to{
        transform:rotate(360deg);
    }
}

#aiopdf-unlock-btn{
    display:flex;
    align-items:center;
    justify-content:center;
    text-align:center;
}