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

:root {
    --primary: #2563eb;
    --primary-dark: #1e40af;
    --success: #16a34a;
    --danger: #dc2626;
    --dark: #111827;
    --text: #374151;
    --light: #f3f4f6;
    --white: #ffffff;
    --border: #d1d5db;
    --shadow: rgba(0, 0, 0, 0.08);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
    padding: 20px;
    color: var(--text);
}

.container {
    max-width: 800px;
    margin: 0 auto;
}

.header {
    text-align: center;
    background: var(--white);
    padding: 40px 20px;
    border-radius: 10px;
    margin-bottom: 30px;
    box-shadow: 0 2px 8px var(--shadow);
}

.header h1 {
    font-size: 32px;
    color: var(--dark);
    margin-bottom: 10px;
}

.header h1 i {
    color: var(--primary);
    margin-right: 10px;
}

.header p {
    font-size: 16px;
    color: var(--text);
}

.main-content {
    background: var(--white);
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 8px var(--shadow);
    margin-bottom: 30px;
}

.tools-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tool-item {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 25px;
    background: var(--light);
    border: 2px solid var(--border);
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s;
}

.tool-item:hover {
    border-color: var(--primary);
    background: var(--white);
    transform: translateX(5px);
}

.tool-item i {
    font-size: 36px;
    color: var(--primary);
    min-width: 40px;
}

.tool-item h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 5px;
}

.tool-item p {
    font-size: 14px;
    color: var(--text);
    margin: 0;
}

.footer {
    text-align: center;
    background: var(--white);
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 8px var(--shadow);
}

.footer p {
    margin: 0;
    font-size: 14px;
    color: var(--text);
}

@media (max-width: 600px) {
    .header h1 {
        font-size: 24px;
    }
    
    .tool-item {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }
    
    .tool-item i {
        font-size: 32px;
    }
}

.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 25px;
    background: var(--light);
    padding: 4px;
    border-radius: 8px;
}

.tab-btn {
    flex: 1;
    padding: 12px 20px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--text);
}

.tab-btn:hover {
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary);
}

.tab-btn.active {
    background: var(--primary);
    color: var(--white);
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.upload-area {
    border: 2px dashed var(--border);
    border-radius: 10px;
    padding: 50px 30px;
    text-align: center;
    transition: all 0.2s;
    cursor: pointer;
    background: var(--light);
}

.upload-area:hover,
.upload-area.drag-over {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.upload-area i {
    font-size: 40px;
    color: var(--primary);
    margin-bottom: 15px;
    display: block;
}

.upload-area:hover i {
    color: var(--primary);
}

.upload-area h3 {
    font-size: 18px;
    margin-bottom: 8px;
    color: var(--dark);
    font-weight: 600;
}

.upload-area p {
    color: var(--text);
    margin: 8px 0;
    font-size: 14px;
}

.file-info {
    font-size: 13px;
    margin-top: 15px;
    color: var(--text);
}

.url-input-section {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    background: var(--light);
    border-radius: 10px;
}

.url-input-section i {
    font-size: 20px;
    color: var(--primary);
}

.url-input-section input {
    flex: 1;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
}

.url-input-section input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn-success {
    background: var(--success);
    color: var(--white);
}

.btn-success:hover:not(:disabled) {
    background: #15803d;
}

.btn-secondary {
    background: #6b7280;
    color: var(--white);
}

.btn-secondary:hover:not(:disabled) {
    background: #4b5563;
}

.btn-download {
    background: var(--primary);
    color: var(--white);
    padding: 12px 24px;
    font-size: 15px;
}

.btn-download:hover:not(:disabled) {
    background: var(--primary-dark);
}

.btn i {
    font-size: 13px;
}

.btn-sm {
    padding: 8px 14px;
    font-size: 13px;
}

.progress-section {
    margin: 25px 0;
    padding: 25px;
    background: var(--light);
    border-radius: 10px;
}

.progress-item {
    margin-bottom: 15px;
}

.progress-label {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-weight: 600;
    font-size: 14px;
}

.progress-label .spinner {
    display: inline-block;
    margin-right: 8px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.progress-bar {
    height: 8px;
    background: var(--white);
    border-radius: 4px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.progress-fill {
    height: 100%;
    background: var(--primary);
    width: 0%;
    transition: width 0.3s ease;
}

.options-section {
    margin: 25px 0;
    padding: 25px;
    background: var(--light);
    border-radius: 10px;
}

.options-section h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: var(--dark);
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;
    margin-bottom: 25px;
}

.option-card {
    position: relative;
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.option-card label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--white);
}

.option-card label i {
    font-size: 28px;
    color: var(--primary);
    margin-bottom: 10px;
}

.option-card label span {
    font-weight: 600;
    margin-bottom: 4px;
    font-size: 14px;
    color: var(--dark);
}

.option-card label small {
    color: var(--text);
    font-size: 12px;
}

.option-card input:checked + label {
    border-color: var(--primary);
    background: rgba(37, 99, 235, 0.05);
}

.action-buttons {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.file-stats {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.file-stats p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text);
}

.compression-stats {
    background: var(--white);
    padding: 20px;
    border-radius: 8px;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.compression-stats p {
    margin: 8px 0;
    font-size: 14px;
    color: var(--text);
}

.compression-stats .savings {
    color: var(--success);
    font-size: 16px;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}

/* Word Counter Styles */
.text-input-section {
    margin-bottom: 30px;
}

.text-input-section textarea {
    width: 100%;
    min-height: 300px;
    padding: 20px;
    border: 2px solid var(--border);
    border-radius: 10px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    background: var(--white);
}

.text-input-section textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
    border: 1px solid var(--border);
}

.stat-card i {
    font-size: 32px;
    color: var(--primary);
}

.stat-info {
    display: flex;
    flex-direction: column;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--dark);
}

.stat-label {
    font-size: 12px;
    color: var(--text);
    margin-top: 2px;
}

/* Pomodoro Timer Styles */
.timer-section {
    text-align: center;
    margin-bottom: 40px;
}

.timer-display {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.timer-circle {
    position: relative;
    width: 280px;
    height: 280px;
}

.timer-svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.timer-bg {
    fill: none;
    stroke: var(--border);
    stroke-width: 8;
}

.timer-progress {
    fill: none;
    stroke: var(--primary);
    stroke-width: 8;
    stroke-linecap: round;
    transition: stroke-dashoffset 1s linear;
}

.timer-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
}

.timer-mode {
    font-size: 16px;
    color: var(--text);
    margin-bottom: 10px;
    font-weight: 600;
}

.timer-time {
    font-size: 56px;
    font-weight: 700;
    color: var(--dark);
    font-family: 'Courier New', monospace;
}

.timer-session {
    font-size: 14px;
    color: var(--text);
    margin-top: 10px;
}

.timer-controls {
    display: flex;
    gap: 15px;
    justify-content: center;
    align-items: center;
}

.btn-lg {
    padding: 12px 28px;
    font-size: 16px;
}

.timer-settings {
    background: var(--light);
    padding: 25px;
    border-radius: 10px;
    margin-bottom: 30px;
}

.timer-settings h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.setting-item {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.setting-item label {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
}

.setting-item input[type="number"] {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
}

.setting-item input[type="number"]:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.stats-section {
    background: var(--light);
    padding: 25px;
    border-radius: 10px;
}

.stats-section h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

/* Image to PDF Styles */
.images-preview {
    margin: 30px 0;
}

.images-preview h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 15px;
    margin-bottom: 25px;
}

.image-card {
    position: relative;
    border: 2px solid var(--border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--white);
    aspect-ratio: 1;
}

.image-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.image-info {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 8px;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6), transparent);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.image-number {
    background: var(--primary);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.btn-remove {
    background: var(--danger);
    color: var(--white);
    border: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-remove:hover {
    transform: scale(1.1);
}

/* PDF Merger Styles */
.pdf-list {
    margin: 30px 0;
}

.pdf-list h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.pdf-item {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 15px;
}

.pdf-number {
    background: var(--primary);
    color: var(--white);
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    flex-shrink: 0;
}

.pdf-name {
    flex: 1;
    font-size: 14px;
    color: var(--dark);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.split-options {
    margin: 30px 0;
}

.split-options h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.split-options p {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 20px;
}

.split-methods {
    background: var(--light);
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
}

.split-methods h3 {
    font-size: 16px;
    margin-bottom: 15px;
}

#customRangeInput label {
    display: block;
    font-size: 14px;
    color: var(--text);
    margin-bottom: 8px;
    font-weight: 600;
}

#customRangeInput input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
}

#customRangeInput input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Text Tool Container */
.text-tool-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

.text-input-panel,
.text-output-panel {
    display: flex;
    flex-direction: column;
}

.text-input-panel h3,
.text-output-panel h3 {
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.text-input-panel textarea,
.text-output-panel textarea {
    flex: 1;
    min-height: 300px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: var(--white);
}

.text-input-panel textarea:focus,
.text-output-panel textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.input-stats,
.output-stats {
    display: flex;
    gap: 20px;
    margin-top: 10px;
    font-size: 13px;
    color: var(--text);
}

.input-stats span,
.output-stats span {
    display: flex;
    align-items: center;
    gap: 6px;
}

.tool-controls {
    background: var(--light);
    padding: 25px;
    border-radius: 10px;
}

.control-group {
    margin-bottom: 25px;
}

.control-group label {
    display: block;
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
    margin-bottom: 15px;
}

@media (max-width: 768px) {
    .text-tool-container {
        grid-template-columns: 1fr;
    }
}

/* Grammar Checker Styles */
.results-section {
    margin: 30px 0;
}

.results-section h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.issue-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-left: 4px solid var(--primary);
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
}

.issue-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.issue-type {
    background: var(--primary);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

.issue-number {
    font-size: 12px;
    color: var(--text);
    font-weight: 600;
}

.issue-message {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 10px;
}

.issue-correction {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px;
    background: var(--light);
    border-radius: 6px;
}

.issue-correction .original {
    color: var(--danger);
    text-decoration: line-through;
    font-weight: 600;
}

.issue-correction .corrected {
    color: var(--success);
    font-weight: 600;
}

.issue-correction i {
    color: var(--text);
    font-size: 12px;
}

.no-issues {
    text-align: center;
    padding: 40px 20px;
    background: var(--light);
    border-radius: 10px;
    color: var(--success);
    font-size: 18px;
    font-weight: 600;
}

.no-issues i {
    font-size: 48px;
    display: block;
    margin-bottom: 15px;
}

.corrected-section {
    margin-top: 30px;
}

.corrected-section h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.corrected-section textarea {
    width: 100%;
    min-height: 200px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    background: var(--white);
    margin-bottom: 15px;
}

/* OCR Tool Styles */
#imagePreview {
    max-width: 100%;
    max-height: 400px;
    border: 2px solid var(--border);
    border-radius: 10px;
    margin-bottom: 20px;
    display: block;
    margin-left: auto;
    margin-right: auto;
}

#extractedText {
    width: 100%;
    min-height: 250px;
    padding: 15px;
    border: 2px solid var(--border);
    border-radius: 8px;
    font-size: 14px;
    font-family: 'Courier New', monospace;
    resize: vertical;
    background: var(--white);
    margin-bottom: 20px;
}

/* Text to Handwriting Styles */
.handwriting-options {
    background: var(--light);
    padding: 25px;
    border-radius: 10px;
    margin: 30px 0;
}

.handwriting-options h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.options-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.option-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.option-group label {
    font-size: 14px;
    color: var(--text);
    font-weight: 600;
}

.option-group select {
    padding: 10px 15px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-size: 14px;
    background: var(--white);
    cursor: pointer;
}

.option-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.handwriting-preview {
    min-height: 400px;
    border: 2px solid var(--border);
    border-radius: 10px;
    margin-bottom: 25px;
    overflow: auto;
    box-shadow: 0 4px 12px var(--shadow);
}

.paper-white {
    background: #ffffff;
}

.paper-lined {
    background: 
        linear-gradient(transparent 0px, transparent 39px, #e5e7eb 39px, #e5e7eb 40px),
        #ffffff;
    background-size: 100% 40px;
}

.paper-grid {
    background: 
        linear-gradient(#e5e7eb 1px, transparent 1px),
        linear-gradient(90deg, #e5e7eb 1px, transparent 1px),
        #ffffff;
    background-size: 20px 20px;
}

.paper-yellow {
    background: #fffbeb;
    background-image: 
        linear-gradient(transparent 0px, transparent 39px, #fbbf24 39px, #fbbf24 40px);
    background-size: 100% 40px;
}

.download-options {
    margin-top: 30px;
}

.download-options h3 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
}

@media (max-width: 768px) {
    .options-row {
        grid-template-columns: 1fr;
    }
}

.preview-section {
    margin: 25px 0;
    padding: 25px;
    background: var(--light);
    border-radius: 10px;
}

.preview-section h3 {
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: var(--dark);
}

.preview-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
}

.preview-controls span {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
}

#previewCanvas {
    max-width: 100%;
    border: 1px solid var(--border);
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    background: var(--white);
    box-shadow: 0 2px 8px var(--shadow);
}

.download-section {
    text-align: center;
    padding: 35px 25px;
    background: var(--light);
    border-radius: 10px;
}

.success-message {
    margin-bottom: 25px;
}

.success-message i {
    font-size: 56px;
    color: var(--success);
    margin-bottom: 12px;
}

.success-message h3 {
    font-size: 20px;
    color: var(--dark);
    font-weight: 600;
}

.footer {
    text-align: center;
    margin-top: 30px;
    padding: 20px;
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 2px 8px var(--shadow);
}

.footer p {
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text);
}

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

/* Loading Spinner */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-overlay.active {
    display: flex;
}

.spinner-container {
    background: var(--white);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
}

.spinner-large {
    font-size: 48px;
    color: var(--primary);
    animation: spin 1s linear infinite;
}

.spinner-container p {
    margin-top: 15px;
    font-weight: 600;
    color: var(--dark);
}

/* Back Button */
.back-btn {
    position: fixed;
    top: 20px;
    left: 20px;
    padding: 10px 20px;
    background: var(--white);
    color: var(--primary);
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    box-shadow: 0 2px 8px var(--shadow);
    transition: all 0.2s;
    z-index: 1000;
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.back-btn:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateX(-3px);
}

/* Homepage Styles */
.tools-intro {
    text-align: center;
    margin-bottom: 40px;
}

.tools-intro h2 {
    font-size: 28px;
    color: var(--dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.tools-intro p {
    font-size: 16px;
    color: var(--text);
}

.tools-grid-featured {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-bottom: 50px;
}

.tool-card-large {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 15px;
    padding: 40px 30px;
    text-decoration: none;
    transition: all 0.3s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    box-shadow: 0 4px 12px var(--shadow);
}

.tool-card-large:hover {
    border-color: var(--primary);
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.2);
}

.tool-icon-large {
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary), #1e40af);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
}

.tool-icon-large i {
    font-size: 40px;
    color: var(--white);
}

.tool-card-large h3 {
    font-size: 24px;
    color: var(--dark);
    margin-bottom: 12px;
}

.tool-card-large p {
    font-size: 15px;
    color: var(--text);
    line-height: 1.6;
}

.tool-card-large .tool-badge {
    position: absolute;
    top: 15px;
    right: 15px;
}

.tools-grid {
    display: flex;
    flex-direction: column;
    gap: 40px;
}

.tool-category h3 {
    font-size: 20px;
    color: var(--dark);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border);
}

.category-tools {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
}

.tool-card {
    background: var(--white);
    border: 2px solid var(--border);
    border-radius: 10px;
    padding: 25px 20px;
    text-decoration: none;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
}

.tool-card:hover {
    border-color: var(--primary);
    transform: translateY(-5px);
    box-shadow: 0 5px 15px var(--shadow);
}

.tool-icon {
    width: 60px;
    height: 60px;
    background: rgba(37, 99, 235, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
}

.tool-icon i {
    font-size: 28px;
    color: var(--primary);
}

.tool-card h4 {
    font-size: 18px;
    color: var(--dark);
    margin-bottom: 8px;
}

.tool-card p {
    font-size: 14px;
    color: var(--text);
    line-height: 1.5;
}

.tool-badge {
    position: absolute;
    top: 10px;
    right: 10px;
    background: var(--primary);
    color: var(--white);
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 600;
}

.tool-badge:nth-of-type(2) {
    background: var(--success);
}

.features-section {
    margin-top: 50px;
    padding: 30px;
    background: var(--light);
    border-radius: 10px;
}

.features-section h3 {
    font-size: 22px;
    color: var(--dark);
    margin-bottom: 25px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

.feature-card {
    background: var(--white);
    padding: 25px 20px;
    border-radius: 10px;
    text-align: center;
}

.feature-card i {
    font-size: 36px;
    color: var(--primary);
    margin-bottom: 12px;
}

.feature-card h4 {
    font-size: 16px;
    color: var(--dark);
    margin-bottom: 8px;
}

.feature-card p {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
}

.copyright {
    margin-top: 10px;
    font-size: 12px;
    opacity: 0.8;
}

/* Stats Banner */
.stats-banner {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 20px;
    margin-top: 40px;
    padding: 30px;
    background: linear-gradient(135deg, var(--primary), #1e40af);
    border-radius: 12px;
}

.stat-item {
    text-align: center;
    color: var(--white);
}

.stat-number {
    font-size: 48px;
    font-weight: 700;
    margin-bottom: 8px;
}

.stat-text {
    font-size: 14px;
    opacity: 0.9;
}

@media (max-width: 480px) {
    .stats-banner {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px;
    }
    
    .stat-number {
        font-size: 36px;
    }
    
    .stat-text {
        font-size: 12px;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 20px 15px;
        margin-bottom: 20px;
    }

    .logo h1 {
        font-size: 22px;
    }

    .logo i {
        font-size: 28px;
    }

    .tagline {
        font-size: 13px;
    }

    .main-content {
        padding: 20px;
    }

    .tools-intro h2 {
        font-size: 22px;
        flex-direction: column;
        gap: 8px;
    }

    .tools-intro p {
        font-size: 14px;
    }

    .tool-category h3 {
        font-size: 18px;
    }

    .category-tools {
        grid-template-columns: 1fr;
    }

    .features-grid {
        grid-template-columns: 1fr;
    }

    .back-btn {
        top: 10px;
        left: 10px;
        padding: 8px 16px;
        font-size: 13px;
    }

    .tabs {
        gap: 6px;
    }

    .tab-btn {
        padding: 10px 15px;
        font-size: 13px;
    }

    .upload-area {
        padding: 40px 20px;
    }

    .upload-area i {
        font-size: 40px;
    }

    .upload-area h3 {
        font-size: 16px;
    }

    .url-input-section {
        flex-direction: column;
        padding: 15px;
    }

    .url-input-section input {
        width: 100%;
    }

    .options-grid {
        grid-template-columns: 1fr;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .preview-controls {
        gap: 10px;
    }

    .btn-download {
        padding: 14px 28px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 8px;
    }

    .header {
        padding: 18px 12px;
        margin-bottom: 15px;
    }

    .logo {
        gap: 8px;
    }

    .logo h1 {
        font-size: 20px;
    }

    .logo i {
        font-size: 24px;
    }

    .tagline {
        font-size: 12px;
    }

    .main-content {
        padding: 15px;
    }

    .tools-intro h2 {
        font-size: 20px;
    }

    .tools-intro p {
        font-size: 13px;
    }

    .tool-category h3 {
        font-size: 16px;
    }

    .tool-card {
        padding: 20px 15px;
    }

    .tool-icon {
        width: 50px;
        height: 50px;
    }

    .tool-icon i {
        font-size: 24px;
    }

    .tool-card h4 {
        font-size: 16px;
    }

    .tool-card p {
        font-size: 13px;
    }

    .features-section {
        padding: 20px 15px;
    }

    .features-section h3 {
        font-size: 18px;
    }

    .feature-card {
        padding: 20px 15px;
    }

    .feature-card i {
        font-size: 30px;
    }

    .tab-btn {
        padding: 10px 12px;
        font-size: 12px;
        gap: 6px;
    }

    .upload-area {
        padding: 35px 15px;
    }

    .upload-area i {
        font-size: 36px;
    }

    .upload-area h3 {
        font-size: 15px;
    }

    .upload-area p {
        font-size: 13px;
    }

    .options-section,
    .preview-section,
    .download-section,
    .progress-section {
        padding: 20px 15px;
    }

    .option-card label {
        padding: 18px 12px;
    }

    .option-card label i {
        font-size: 24px;
    }

    .option-card label span {
        font-size: 13px;
    }

    .btn {
        padding: 11px 20px;
        font-size: 13px;
    }

    .btn-download {
        padding: 13px 24px;
        font-size: 14px;
    }

    .success-message i {
        font-size: 48px;
    }

    .success-message h3 {
        font-size: 18px;
    }

    .footer {
        padding: 15px;
        margin-top: 20px;
    }

    .footer p {
        font-size: 12px;
        flex-direction: column;
        gap: 4px;
    }
}
