/* Modern Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse-soft {
    0% {
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0.4);
    }

    70% {
        box-shadow: 0 0 0 10px rgba(66, 133, 244, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(66, 133, 244, 0);
    }
}

.animate-fade {
    animation: fadeInUp 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

svg {
    vertical-align: middle;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

.animate-spin {
    animation: spin 1s linear infinite;
}

/* Drop Area Modernized */
.drop-area {
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border: 2px dashed #cbd5e1;
    border-radius: 1.5rem;
    padding: 3rem 2rem;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.drop-area:hover {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.05);
}

.drop-area:hover i {
    animation: pulse-soft 2s infinite;
}

.drop-area.highlight {
    border-color: var(--primary-color);
    background-color: rgba(66, 133, 244, 0.03);
}

.drop-area.has-files {
    border-style: solid;
    border-color: var(--primary-color);
}

.drop-area i {
    font-size: 3.5rem;
    background: linear-gradient(135deg, var(--primary-color), #8b5cf6);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 1.5rem;
    display: inline-block;
    position: relative;
    z-index: 1;
}

.drop-area h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1e293b;
    margin-bottom: 0.5rem;
    position: relative;
    z-index: 1;
}

.drop-area p {
    color: #64748b;
    margin-bottom: 1.5rem;
    position: relative;
    z-index: 1;
}

.drop-area .btn {
    position: relative;
    z-index: 1;
}

/* Preview Items Grid */
.preview-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 1.25rem;
    margin-top: 1.5rem;
}

.preview-item {
    position: relative;
    background: white;
    border-radius: 1rem;
    padding: 0.75rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05);
    border: 1px solid #f1f5f9;
    transition: all 0.2s ease;
    animation: fadeInUp 0.4s ease-out backwards;
}

.preview-item:hover {
    transform: scale(1.05);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
}

.preview-item img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 0.75rem;
}

.preview-item .file-info {
    margin-top: 8px;
    font-size: 11px;
}

.preview-item .filename {
    font-weight: 600;
    color: #1e293b;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.preview-item .filesize {
    color: #94a3b8;
}

.preview-item .remove-btn {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 24px;
    height: 24px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    cursor: pointer;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    z-index: 10;
}

/* Option Cards Modernized */
.conversion-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 0.75rem;
    margin: 1.5rem 0;
}

.option-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 1rem;
    padding: 1.25rem 0.5rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
}

.option-card:hover {
    border-color: var(--primary-color);
    background: rgba(66, 133, 244, 0.02);
}

.option-card.selected {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: white;
    box-shadow: 0 10px 15px -3px rgba(66, 133, 244, 0.3);
    transform: translateY(-2px);
}

.option-card i {
    font-size: 1.5rem;
    color: var(--primary-color);
    transition: color 0.2s;
}

.option-card.selected i {
    color: white;
}

.option-card div {
    font-weight: 700;
    font-size: 0.9rem;
}

/* Quality slider modern */
.quality-control {
    background: #f8fafc;
    padding: 1.5rem;
    border-radius: 1.25rem;
    margin: 2rem 0;
}

.quality-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.quality-header label {
    font-weight: 700;
    color: #1e293b;
    margin: 0;
}

.quality-value {
    background: var(--primary-color);
    color: white;
    padding: 2px 8px;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 700;
}

input[type="range"] {
    appearance: none;
    -webkit-appearance: none;
    width: 100%;
    height: 8px;
    background: linear-gradient(to right, var(--primary-color) 0%, var(--primary-color) var(--value, 90%), #e2e8f0 var(--value, 90%), #e2e8f0 100%);
    border-radius: 10px;
    outline: none;
    transition: all 0.2s;
}

input[type="range"]::-webkit-slider-thumb {
    appearance: none;
    -webkit-appearance: none;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(66, 133, 244, 0.3);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 6px 15px rgba(66, 133, 244, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    cursor: pointer;
    border: 3px solid var(--primary-color);
    box-shadow: 0 4px 10px rgba(66, 133, 244, 0.3);
}

/* Converted items modern */
.converted-list {
    background: #ffffff;
    border-radius: 1.5rem;
    padding: 1.5rem;
    margin-top: 2.5rem;
    border: 1px solid #f1f5f9;
    box-shadow: 0 4px 20px -2px rgba(0, 0, 0, 0.03);
}

.converted-list-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.converted-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-bottom: 1px solid #f8fafc;
    transition: all 0.2s;
}

.converted-item:last-child {
    border-bottom: none;
}

.converted-item:hover {
    background: #f8fafc;
    transform: translateX(5px);
}

.converted-item-name {
    flex: 1;
    font-weight: 600;
    color: #1e293b;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.converted-item-size {
    background: #f1f5f9;
    padding: 4px 10px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    color: #64748b;
}

.converted-item-btn {
    background: #10b981 !important;
    border: none !important;
    color: white !important;
    padding: 8px 16px !important;
    border-radius: 8px !important;
    font-weight: 700 !important;
    font-size: 0.8rem !important;
    transition: all 0.2s !important;
    display: flex;
    align-items: center;
    gap: 6px;
}

.converted-item-btn:hover {
    background: #059669 !important;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3) !important;
}

.download-all {
    text-align: center;
    padding-top: 2rem;
}

.download-all .btn {
    width: 100%;
    max-width: 350px;
    border-radius: 1rem;
    height: 54px;
    font-weight: 800;
    font-size: 1rem;
    background: #1e293b;
    color: white;
    border: none;
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.download-all .btn:hover {
    background: #0f172a;
    transform: scale(1.02);
    box-shadow: 0 10px 20px -5px rgba(0, 0, 0, 0.2);
}

/* File Counter Badge */
.file-counter {
    background: var(--primary-color);
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 800;
    box-shadow: 0 4px 10px rgba(66, 133, 244, 0.3);
}

/* Utilities */
.hidden {
    display: none !important;
}

/* ICO specific */
.ico-size-selector {
    background: #f1f5f9;
    padding: 1rem;
    border-radius: 1rem;
    margin-top: 1rem;
}

.ico-size-options {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
}

.ico-size-option {
    background: white;
    border: 1px solid #e2e8f0;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.ico-size-option:hover {
    border-color: var(--primary-color);
}

.ico-size-option.selected {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* Notifications */
.notification {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    padding: 1rem 1.5rem;
    border-radius: 1rem;
    color: white;
    font-weight: 600;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.1);
    z-index: 9999;
    animation: fadeInUp 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}

.notification.success {
    background: #10b981;
}

.notification.info {
    background: var(--primary-color);
}

.notification.warning {
    background: #ef4444;
}

/* Help Modal Modern */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
}

.modal-overlay.active {
    opacity: 1;
    visibility: visible;
}

.modal {
    background: white;
    width: 90%;
    max-width: 600px;
    border-radius: 2rem;
    padding: 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform: scale(0.9);
    transition: transform 0.3s;
}

.modal-overlay.active .modal {
    transform: scale(1);
}

.modal-title {
    font-size: 1.75rem;
    font-weight: 800;
    color: #1e293b;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 15px;
}

.modal-title i {
    color: var(--primary-color);
}

.modal-body {
    color: #64748b;
    line-height: 1.7;
    font-size: 1rem;
}

.modal-body ul {
    list-style: none;
    padding: 0;
}

.modal-body li {
    padding: 10px 0;
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.modal-body li i {
    color: #10b981;
    margin-top: 5px;
}

.close-modal {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #f1f5f9;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    color: #64748b;
}

.close-modal:hover {
    background: #ef4444;
    color: white;
    transform: rotate(90deg);
}