:root {
    --primary: #4361ee;
    --primary-dark: #3a56d4;
    --secondary: #3f37c9;
    --success: #4cc9f0;
    --danger: #f72585;
    --warning: #f8961e;
    --info: #4895ef;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --white: #ffffff;
    --black: #000000;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f5f7fa;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.headerp {
    text-align: center;
    margin-bottom: 1rem;
    margin-top: 0.5rem;
    background-color: var(--white);
    border-radius: 0.75rem;
    box-shadow: var(--shadow-sm);
    padding: 1rem 0.1rem;
}

.headerp h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--primary);
}

.headerp h1 i {
    margin-right: 10px;
}

.headerp .subtitle {
    font-size: 0.9rem;
    color: var(--gray);
}

.tool-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .tool-container {
        grid-template-columns: 1fr;
    }
}

.panel {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--light-gray);
}

.panel-title {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.panel-title i {
    margin-right: 10px;
    color: var(--primary);
}

.panel-actions {
    display: flex;
    gap: 10px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 16px;
    border-radius: 6px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    font-size: 0.9rem;
}

.btn i {
    margin-right: 8px;
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.85rem;
}

.btn-primary {
    background-color: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background-color: var(--primary-dark);
}

.btn-secondary {
    background-color: var(--light-gray);
    color: var(--dark);
}

.btn-secondary:hover {
    background-color: #d1d7e0;
}

.btn-danger {
    background-color: var(--danger);
    color: var(--white);
}

.btn-danger:hover {
    background-color: #e5177b;
}

.upload-section {
    padding: 30px 20px;
    text-align: center;
}

.upload-option {
    border: 2px dashed var(--light-gray);
    border-radius: 8px;
    padding: 30px;
    cursor: pointer;
    transition: all 0.2s ease;
    position: relative;
}

.upload-option:hover {
    border-color: var(--primary);
}

.upload-icon {
    font-size: 2.5rem;
    color: var(--primary);
    margin-bottom: 15px;
}

.upload-text {
    font-size: 1.1rem;
    font-weight: 500;
    margin-bottom: 5px;
}

.upload-subtext {
    font-size: 0.9rem;
    color: var(--gray);
    margin-bottom: 15px;
}

#fileInput {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    opacity: 0;
    cursor: pointer;
}

.uploaded-files {
    border-top: 1px solid var(--light-gray);
}

.uploaded-files-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--light-gray);
}

.uploaded-files-title {
    font-weight: 500;
}

.uploaded-files-count {
    background-color: var(--primary);
    color: var(--white);
    padding: 3px 8px;
    border-radius: 20px;
    font-size: 0.8rem;
}

.uploaded-files-list {
    padding: 15px;
    min-height: 150px;
    max-height: 300px;
    overflow-y: auto;
}

.empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 150px;
    color: var(--gray);
    text-align: center;
}

.empty-state i {
    font-size: 2.5rem;
    margin-bottom: 10px;
    color: var(--light-gray);
}

.file-item {
    display: flex;
    align-items: center;
    padding: 10px;
    border-radius: 6px;
    margin-bottom: 8px;
    background-color: var(--light);
    transition: all 0.2s ease;
    border: 2px solid transparent;
}

.file-item.selected {
    border-color: var(--primary);
    background-color: rgba(67, 97, 238, 0.1);
}

.file-item:last-child {
    margin-bottom: 0;
}

.file-thumbnail {
    width: 50px;
    height: 50px;
    object-fit: cover;
    border-radius: 4px;
    margin-right: 10px;
}

.file-info {
    flex: 1;
    min-width: 0;
}

.file-name {
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.file-size {
    font-size: 0.8rem;
    color: var(--gray);
}

.file-actions {
    display: flex;
    gap: 5px;
}

.file-action-btn {
    background: none;
    border: none;
    color: var(--gray);
    cursor: pointer;
    font-size: 0.9rem;
    padding: 5px;
}

.file-action-btn:hover {
    color: var(--danger);
}

.preview-container {
    padding: 20px;
    text-align: center;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#previewImage {
    max-width: 100%;
    max-height: 300px;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.resize-options {
    padding: 0 20px 20px;
}

.format-control {
    margin-bottom: 20px;
}

.format-control label {
    display: flex;
    align-items: center;
    margin-bottom: 8px;
    font-weight: 500;
}

.format-control label i {
    margin-right: 8px;
    color: var(--primary);
}

.format-control select {
    width: 100%;
    padding: 10px;
    border-radius: 6px;
    border: 1px solid var(--light-gray);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease;
}

.format-control select:focus {
    outline: none;
    border-color: var(--primary);
}

.quality-control {
    margin-bottom: 20px;
}

.control-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.control-label {
    display: flex;
    align-items: center;
    font-weight: 500;
}

.control-label i {
    margin-right: 8px;
    color: var(--primary);
}

.control-value {
    font-size: 0.9rem;
    color: var(--gray);
}

.slider-container {
    padding: 0 10px;
}

.slider {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: var(--light-gray);
    outline: none;
    -webkit-appearance: none;
}

.slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--primary);
    cursor: pointer;
}

.controls {
    display: flex;
    justify-content: space-between;
    padding: 0 20px 20px;
    gap: 15px;
}

.controls .btn {
    flex: 1;
}

.results-container {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 30px;
    overflow: hidden;
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--light-gray);
}

.results-title {
    display: flex;
    align-items: center;
    font-weight: 600;
}

.results-title i {
    margin-right: 10px;
    color: var(--primary);
}

.results-count {
    font-size: 0.9rem;
    color: var(--gray);
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
    padding: 20px;
}

.result-item {
    border: 1px solid var(--light-gray);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s ease;
}

.result-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.result-thumbnail {
    width: 100%;
    height: 120px;
    object-fit: cover;
    border-bottom: 1px solid var(--light-gray);
}

.result-info {
    padding: 12px;
}

.result-name {
    font-weight: 500;
    margin-bottom: 5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.9rem;
}

.result-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.75rem;
    color: var(--gray);
}

.result-actions {
    display: flex;
    justify-content: center;
    padding: 10px;
    border-top: 1px solid var(--light-gray);
}

.result-actions .btn {
    padding: 5px 10px;
    font-size: 0.8rem;
}

.results-footer {
    display: flex;
    justify-content: center;
    padding: 15px 20px;
    border-top: 1px solid var(--light-gray);
    gap: 15px;
}

.blog-container {
    background-color: var(--white);
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    padding: 30px;
    margin-bottom: 30px;
}

.blog-container h2 {
    margin-bottom: 20px;
    color: var(--primary);
}

.blog-container h2 i {
    margin-right: 10px;
}

.blog-container h3 {
    margin: 25px 0 15px;
    color: var(--dark);
}

.blog-container p {
    margin-bottom: 15px;
}

.blog-container ul {
    margin-bottom: 20px;
    padding-left: 20px;
}

.blog-container li {
    margin-bottom: 8px;
}

.note-box {
    background-color: #eef2ff;
    border-left: 4px solid var(--primary);
    padding: 15px;
    margin: 20px 0;
    border-radius: 0 4px 4px 0;
}

.note-box i {
    color: var(--primary);
    margin-right: 10px;
}

.loading {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 20px;
    text-align: center;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 15px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.progress-bar {
    width: 100%;
    height: 6px;
    background-color: var(--light-gray);
    border-radius: 3px;
    margin-top: 10px;
    overflow: hidden;
}

.progress {
    height: 100%;
    background-color: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 10px;

    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 300px;
}

.toast {
    padding: 12px 20px;
    border-radius: 6px;
    background-color: var(--dark);
    color: var(--white);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: space-between;
    transform: translateX(150%);
    transition: transform 0.3s ease;


}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: #2ecc71;
}

.toast.error {
    background-color: var(--danger);
}

.toast.warning {
    background-color: var(--warning);
}

.toast i {
    margin-right: 10px;
}

.toast-close {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    margin-left: 15px;
    font-size: 1.1rem;
}


/* Responsive adjustments */
@media (max-width: 768px) {
    .headerp h1 {
        font-size: 1.5rem;
    }
    
    .results-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
    
    .controls {
        flex-direction: column;
    }
    
    .results-footer {
        flex-direction: column;
    }
}
