:root {
    --primary: #52B788;
    --primary-dark: #40916C;
    --primary-darker: #2D6A4F;
    --primary-light: #74C69D;
    --primary-lighter: #95D5B2;
    --primary-lightest: #D8F3DC;
    --primary-bg: #F0FFF4;
    --text-dark: #1B4332;
    --text: #2D6A4F;
    --text-light: #588C73;
    --white: #FFFFFF;
    --gray-50: #F8FAF9;
    --gray-100: #F0F4F2;
    --gray-200: #E2E8E5;
    --gray-300: #C8D5CE;
    --shadow-sm: 0 1px 3px rgba(45, 106, 79, 0.08);
    --shadow: 0 4px 16px rgba(45, 106, 79, 0.1);
    --shadow-lg: 0 8px 32px rgba(45, 106, 79, 0.15);
    --shadow-xl: 0 16px 48px rgba(45, 106, 79, 0.18);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--primary-bg);
    color: var(--text-dark);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ========== NAVBAR ========== */
.navbar-custom {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 100%);
    padding: 1rem 0;
    box-shadow: var(--shadow);
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-custom .navbar-brand {
    color: var(--white);
    font-weight: 700;
    font-size: 1.4rem;
    letter-spacing: -0.3px;
}

.navbar-custom .navbar-brand:hover {
    color: var(--primary-lightest);
}

.navbar-custom .nav-link {
    color: rgba(255, 255, 255, 0.8);
    font-weight: 500;
    font-size: 0.9rem;
    padding: 0.5rem 1rem !important;
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.navbar-custom .nav-link:hover,
.navbar-custom .nav-link.active {
    color: var(--white);
    background: rgba(255, 255, 255, 0.15);
}

.navbar-custom .navbar-toggler {
    border: none;
    padding: 0.5rem;
}

.navbar-custom .navbar-toggler-icon {
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 30 30'%3e%3cpath stroke='rgba%28255, 255, 255, 0.9%29' stroke-linecap='round' stroke-miterlimit='10' stroke-width='2' d='M4 7h22M4 15h22M4 23h22'/%3e%3c/svg%3e");
}

/* ========== HERO SECTION ========== */
.hero-section {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 50%, var(--primary) 100%);
    padding: 5rem 0 4rem;
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.hero-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255,255,255,0.05) 0%, transparent 70%);
    border-radius: 50%;
}

.hero-section h1 {
    font-size: 3rem;
    font-weight: 800;
    letter-spacing: -1px;
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.hero-section p {
    font-size: 1.15rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

/* ========== TOOL CARDS (HOMEPAGE) ========== */
.tools-section {
    padding: 4rem 0 5rem;
    margin-top: -3rem;
    position: relative;
    z-index: 2;
}

.tool-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 1px solid transparent;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
}

.tool-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: var(--primary-lighter);
    color: inherit;
}

.tool-card .icon-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2rem;
    transition: var(--transition);
}

.tool-card:hover .icon-wrap {
    transform: scale(1.1);
}

.tool-card.unlock .icon-wrap {
    background: linear-gradient(135deg, #D8F3DC, #B7E4C7);
    color: var(--primary-dark);
}

.tool-card.compress .icon-wrap {
    background: linear-gradient(135deg, #C7F9CC, #A7E8BD);
    color: #2D6A4F;
}

.tool-card.convert .icon-wrap {
    background: linear-gradient(135deg, #B7E4C7, #95D5B2);
    color: #1B4332;
}

.tool-card.merger .icon-wrap {
    background: linear-gradient(135deg, #A7E8BD, #80ED99);
    color: #2D6A4F;
}

.tool-card h3 {
    font-weight: 700;
    font-size: 1.3rem;
    margin-bottom: 0.75rem;
    color: var(--text-dark);
}

.tool-card p {
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.6;
    flex-grow: 1;
}

.tool-card .badge-formats {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    justify-content: center;
    margin-top: 1.25rem;
}

.tool-card .badge-formats span {
    background: var(--primary-lightest);
    color: var(--primary-dark);
    padding: 0.25rem 0.65rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ========== TOOL PAGE ========== */
.tool-page-header {
    background: linear-gradient(135deg, var(--primary-darker) 0%, var(--primary-dark) 100%);
    padding: 3rem 0;
    color: var(--white);
    text-align: center;
}

.tool-page-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    margin-bottom: 0.5rem;
}

.tool-page-header p {
    opacity: 0.85;
    font-size: 1.05rem;
}

.tool-content {
    padding: 3rem 0 5rem;
    flex-grow: 1;
}

/* ========== UPLOAD ZONE ========== */
.upload-zone {
    background: var(--white);
    border: 2px dashed var(--primary-lighter);
    border-radius: var(--radius-lg);
    padding: 3.5rem 2rem;
    text-align: center;
    transition: var(--transition);
    cursor: pointer;
    position: relative;
}

.upload-zone:hover,
.upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-lightest);
    box-shadow: var(--shadow);
}

.upload-zone .upload-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
}

.upload-zone h4 {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.upload-zone p {
    color: var(--text-light);
    font-size: 0.9rem;
}

.upload-zone .btn-browse {
    background: var(--primary);
    color: var(--white);
    border: none;
    padding: 0.6rem 2rem;
    border-radius: 50px;
    font-weight: 600;
    margin-top: 1rem;
    transition: var(--transition);
    display: inline-block;
}

.upload-zone .btn-browse:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

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

.file-item {
    background: var(--white);
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1rem 1.25rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.75rem;
    transition: var(--transition);
}

.file-item:hover {
    box-shadow: var(--shadow-sm);
}

.file-item .file-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}

.file-icon.pdf { background: #FFF0F0; color: #E53E3E; }
.file-icon.doc { background: #EBF4FF; color: #3182CE; }
.file-icon.img { background: #FEFCBF; color: #D69E2E; }
.file-icon.xls { background: #F0FFF4; color: #38A169; }
.file-icon.ppt { background: #FFF5F5; color: #E53E3E; }
.file-icon.zip { background: #FAF5FF; color: #805AD5; }
.file-icon.default { background: var(--gray-100); color: var(--text-light); }

.file-item .file-info {
    flex-grow: 1;
    min-width: 0;
}

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

.file-item .file-size {
    font-size: 0.8rem;
    color: var(--text-light);
}

.file-item .btn-remove {
    background: none;
    border: none;
    color: var(--gray-300);
    font-size: 1.1rem;
    cursor: pointer;
    padding: 0.3rem;
    transition: var(--transition);
    flex-shrink: 0;
}

.file-item .btn-remove:hover {
    color: #E53E3E;
}

/* ========== OPTIONS PANEL ========== */
.options-panel {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    margin-top: 1.5rem;
}

.options-panel h5 {
    font-weight: 700;
    margin-bottom: 1.25rem;
    color: var(--text-dark);
}

.options-panel label {
    font-weight: 500;
    font-size: 0.9rem;
    color: var(--text);
    margin-bottom: 0.4rem;
}

.form-select-custom,
.form-control-custom {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
    transition: var(--transition);
    width: 100%;
    background: var(--white);
}

.form-select-custom:focus,
.form-control-custom:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
    outline: none;
}

/* ========== BUTTONS ========== */
.btn-primary-custom {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    letter-spacing: 0.3px;
}

.btn-primary-custom:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(82, 183, 136, 0.4);
    color: var(--white);
    background: linear-gradient(135deg, var(--primary-dark) 0%, var(--primary-darker) 100%);
}

.btn-primary-custom:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary-custom {
    background: var(--primary-lightest);
    color: var(--primary-dark);
    border: none;
    padding: 0.7rem 1.5rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    transition: var(--transition);
}

.btn-secondary-custom:hover {
    background: var(--primary-lighter);
    color: var(--primary-darker);
}

/* ========== PROGRESS & RESULT ========== */
.progress-section {
    display: none;
    margin-top: 2rem;
}

.progress-section.active {
    display: block;
    animation: fadeSlideIn 0.4s ease;
}

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

.progress-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 2rem 2.5rem;
    box-shadow: var(--shadow);
    border: 1px solid var(--gray-200);
}

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

.progress-header .progress-label {
    font-weight: 600;
    font-size: 0.95rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.progress-header .progress-label i {
    animation: spin 1.5s linear infinite;
    color: var(--primary);
}

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

.progress-header .progress-percent {
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--primary);
    font-variant-numeric: tabular-nums;
    min-width: 60px;
    text-align: right;
    transition: color 0.3s ease;
}

.progress-header .progress-percent.done {
    color: var(--primary-dark);
}

.progress-bar-custom {
    height: 12px;
    border-radius: 6px;
    background: var(--gray-200);
    overflow: hidden;
    position: relative;
}

.progress-bar-custom .bar {
    height: 100%;
    background: linear-gradient(90deg, var(--primary-light), var(--primary), var(--primary-dark));
    background-size: 200% 100%;
    border-radius: 6px;
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    width: 0%;
    position: relative;
}

.progress-bar-custom .bar.animating {
    animation: shimmer 2s ease infinite;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.progress-bar-custom .bar::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: barGlow 1.5s ease infinite;
}

@keyframes barGlow {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.progress-bar-custom .bar.complete::after {
    animation: none;
}

.progress-detail {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 0.75rem;
}

.progress-text {
    font-size: 0.85rem;
    color: var(--text-light);
    font-weight: 500;
}

.progress-speed {
    font-size: 0.8rem;
    color: var(--gray-300);
    font-variant-numeric: tabular-nums;
}

.progress-steps {
    margin-top: 1.25rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    display: flex;
    gap: 0.5rem;
}

.progress-step {
    flex: 1;
    text-align: center;
    padding: 0.5rem;
    border-radius: var(--radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--gray-300);
    background: var(--gray-50);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.3rem;
}

.progress-step i {
    font-size: 1rem;
}

.progress-step.active {
    color: var(--primary);
    background: var(--primary-lightest);
}

.progress-step.done {
    color: var(--primary-dark);
    background: var(--primary-lightest);
}

.progress-step.done i::before {
    content: "\f00c";
}

.result-section {
    display: none;
    margin-top: 2rem;
}

.result-section.active {
    display: block;
}

.result-card {
    background: linear-gradient(135deg, var(--primary-lightest), var(--white));
    border: 1px solid var(--primary-lighter);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
}

.result-card .success-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--primary);
    color: var(--white);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
    margin: 0 auto 1rem;
}

.result-card h4 {
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 0.5rem;
}

.result-card .result-info {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-bottom: 1.5rem;
}

.btn-download {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: var(--white);
    border: none;
    padding: 0.85rem 2.5rem;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1rem;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
}

.btn-download:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(82, 183, 136, 0.4);
    color: var(--white);
}

/* ========== FEATURES SECTION ========== */
.features-section {
    padding: 4rem 0;
    background: var(--white);
}

.feature-item {
    text-align: center;
    padding: 2rem 1.5rem;
}

.feature-item .feature-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--primary-lightest);
    color: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.4rem;
    margin: 0 auto 1rem;
}

.feature-item h5 {
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.feature-item p {
    color: var(--text-light);
    font-size: 0.9rem;
}

/* ========== FOOTER ========== */
.footer-custom {
    background: var(--primary-darker);
    color: rgba(255, 255, 255, 0.9);
    padding: 2rem 0;
    margin-top: auto;
}

/* ========== ALERTS ========== */
.alert-custom {
    border-radius: var(--radius-sm);
    border: none;
    font-size: 0.9rem;
    padding: 1rem 1.25rem;
}

.alert-danger-custom {
    background: #FFF5F5;
    color: #C53030;
    border: 1px solid #FED7D7;
}

.alert-success-custom {
    background: var(--primary-lightest);
    color: var(--primary-darker);
    border: 1px solid var(--primary-lighter);
}

/* ========== LOADING SPINNER ========== */
.spinner-overlay {
    display: none;
}

.result-section {
    animation: fadeSlideIn 0.5s ease;
}

.result-card .success-icon {
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
    0% { transform: scale(0); opacity: 0; }
    80% { transform: scale(1.1); }
    100% { transform: scale(1); opacity: 1; }
}

/* ========== PASSWORD INPUT ========== */
.password-input-group {
    position: relative;
}

.password-input-group input {
    padding-right: 3rem;
}

.password-input-group .toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .hero-section {
        padding: 3rem 0 2.5rem;
    }
    .hero-section h1 {
        font-size: 2rem;
    }
    .tool-content {
        padding: 2rem 0 3rem;
    }
    .upload-zone {
        padding: 2rem 1.5rem;
    }
}

/* ========== SORTABLE (for merger) ========== */
.sortable-ghost {
    opacity: 0.4;
    background: var(--primary-lightest);
}

.sortable-drag {
    box-shadow: var(--shadow-lg);
}

.drag-handle {
    cursor: grab;
    color: var(--gray-300);
    padding: 0 0.5rem;
}

.drag-handle:active {
    cursor: grabbing;
}

/* ========== CONVERT GRID ========== */
.convert-options {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
    margin-top: 1rem;
}

.convert-option {
    background: var(--gray-50);
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 1rem;
    text-align: center;
    cursor: pointer;
    transition: var(--transition);
}

.convert-option:hover {
    border-color: var(--primary-light);
    background: var(--primary-lightest);
}

.convert-option.selected {
    border-color: var(--primary);
    background: var(--primary-lightest);
    box-shadow: 0 0 0 3px rgba(82, 183, 136, 0.15);
}

.convert-option i {
    font-size: 1.5rem;
    display: block;
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.convert-option span {
    font-weight: 600;
    font-size: 0.8rem;
    color: var(--text-dark);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}
