:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #4b5563;
    --background-color: #f1f5f9;
    --section-background: #ffffff;
    --border-color: #e2e8f0;
    --text-color: #1e293b;
    --success-color: #059669;
    --success-hover: #047857;
    --delete-color: #dc2626;
    --delete-hover: #b91c1c;
}

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

body {
    font-family: 'Poppins', sans-serif;
    line-height: 1.6;
    background-color: var(--background-color);
    color: var(--text-color);
}

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 0 1rem;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--primary-color);
    font-weight: 700;
    font-size: 2.5rem;
}

h2 {
    margin-bottom: 1rem;
    color: var(--secondary-color);
    font-weight: 600;
}

h3 {
    color: var(--primary-color);
    font-weight: 600;
}

.subtitle {
    text-align: center;
    margin-bottom: 2rem;
    color: var(--secondary-color);
}

.subtitle p {
    margin: 0;
    font-size: 0.95rem;
}

.subtitle .note {
    font-size: 0.85rem;
    color: var(--secondary-color);
    opacity: 0.8;
}

.section {
    background: var(--section-background);
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 1.5rem;
}

textarea {
    width: 100%;
    min-height: 150px;
    padding: 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    resize: vertical;
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.3s ease;
}

textarea:focus {
    outline: none;
    border-color: var(--primary-color);
}

.placeholder-section {
    background: var(--section-background);
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    margin-bottom: 1rem;
    border: 2px solid var(--border-color);
}

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

.section-content {
    display: grid;
    gap: 1.5rem;
}

.input-group {
    margin-bottom: 1rem;
}

.input-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: var(--secondary-color);
}

.input-group input[type="text"],
.input-group input[type="number"],
.input-group input[type="file"] {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    transition: border-color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--primary-color);
}

button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-family: inherit;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

button:hover {
    transform: translateY(-2px);
}

.btn-add {
    background-color: var(--primary-color);
    color: white;
    margin: 1rem 0;
    width: 100%;
    font-size: 1rem;
}

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

.btn-run {
    background-color: var(--success-color);
    color: white;
    width: 100%;
    margin: 1rem 0;
    font-size: 1rem;
}

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

.btn-secondary {
    background-color: var(--secondary-color);
    color: white;
    margin-right: 0.5rem;
}

.btn-delete {
    background-color: var(--delete-color);
    color: white;
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
}

.btn-delete:hover {
    background-color: var(--delete-hover);
}

.btn-clear {
    background-color: var(--delete-color);
    color: white;
    margin-right: 0.5rem;
}

.btn-clear:hover {
    background-color: var(--delete-hover);
}

.output-controls {
    display: flex;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    background: var(--section-background);
    border-radius: 8px;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

.download-container {
    display: flex;
    gap: 0.5rem;
    flex-grow: 1;
}

#fileName {
    flex-grow: 1;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
}

.radio-group {
    margin-bottom: 1rem;
    display: flex;
    gap: 2rem;
}

.radio-group label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    font-weight: 500;
}

.radio-group input[type="radio"] {
    width: 1.2rem;
    height: 1.2rem;
    cursor: pointer;
}

.placeholder-value {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-family: inherit;
    margin-bottom: 1rem;
}

.placeholder-value::placeholder {
    color: #94a3b8;
}

/* Update the process status styles */
.process-status {
    display: none;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0;
    padding: 1rem;
    border-radius: 8px;
    background: var(--section-background);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.process-status.active {
    background: var(--primary-color);
    color: white;
}

.process-status.error {
    display: flex !important; /* Force display when error */
    background: #fee2e2;
    color: var(--delete-color);
}

/* Update loader styles */
.loader {
    width: 24px;
    height: 24px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Make animation more visible */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-text {
    font-weight: 500;
    margin: 0 0.5rem;
}

.process-time {
    font-weight: 500;
    color: var(--secondary-color);
}

/* When in active state, adjust process time color */
.process-status.active .process-time {
    color: rgba(255, 255, 255, 0.9);
}

/* Error alert styles */
.error-alert {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    background: var(--delete-color);
    color: white;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    animation: slideIn 0.3s ease-out;
    z-index: 1000;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

/* General responsive adjustments */
@media screen and (max-width: 768px) {
    .container {
        margin: 1rem auto;
        padding: 0 0.75rem;
    }

    h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }

    .subtitle p {
        font-size: 0.85rem;
        padding: 0 1rem;
    }

    .section {
        padding: 1.25rem;
        margin-bottom: 1rem;
    }

    textarea {
        min-height: 120px;
        font-size: 0.9rem;
    }
}

/* Mobile-specific adjustments */
@media screen and (max-width: 480px) {
    h1 {
        font-size: 1.5rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    .placeholder-section {
        padding: 1rem;
    }

    .section-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: stretch;
    }

    .section-header h3 {
        text-align: center;
    }

    .section-header .btn-delete {
        width: 100%;
    }

    .radio-group {
        grid-template-columns: 1fr;
    }

    .output-controls {
        flex-direction: column;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .btn-secondary {
        width: 100%;
        margin-right: 0;
    }

    .download-container {
        flex-direction: column;
    }

    #fileName {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    .process-status {
        flex-direction: column;
        text-align: center;
        padding: 0.75rem;
    }

    .input-group input[type="text"],
    .input-group input[type="number"],
    .input-group input[type="file"] {
        padding: 0.5rem;
        font-size: 0.9rem;
    }

    button {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* Tablet-specific adjustments */
@media screen and (min-width: 481px) and (max-width: 768px) {
    .output-controls {
        flex-wrap: wrap;
    }

    .btn-secondary {
        flex: 1 1 auto;
    }

    .download-container {
        flex: 1 1 100%;
        margin-top: 0.75rem;
    }
}

/* Ensure minimum touch target size for mobile */
@media (hover: none) and (pointer: coarse) {
    button,
    input[type="radio"],
    input[type="file"] {
        min-height: 44px;
    }

    .radio-group label {
        padding: 0.5rem 0;
    }
}

/* Add these new styles for the theme switch */
.theme-switch {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 1000;
}

.theme-switch input {
    display: none;
}

.switch {
    cursor: pointer;
    padding: 0.5rem;
    background: var(--section-background);
    border-radius: 50px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 45px;
    height: 45px;
    transition: all 0.3s ease;
}

.switch:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.sun, .moon {
    width: 20px;
    height: 20px;
    color: var(--text-color);
    transition: all 0.3s ease;
}

.sun svg, .moon svg {
    width: 100%;
    height: 100%;
}

/* Show/hide sun/moon based on theme */
.moon {
    display: none;
}

[data-theme="dark"] .sun {
    display: none;
}

[data-theme="dark"] .moon {
    display: block;
}

/* Update the dark theme variables */
[data-theme="dark"] {
    --background-color: #1a1a1a;
    --section-background: #2d2d2d;
    --text-color: #ffffff;
    --border-color: #404040;
    --primary-color: #3b82f6;
    --primary-hover: #2563eb;
    --secondary-color: #9ca3af;
}

/* Remove the old dark mode media query */
@media (prefers-color-scheme: dark) {
    /* Remove this entire block */
}

/* Add these after the existing input styles */
.startfrom-input, .range-input {
    border-top: 1px solid var(--border-color);
    padding-top: 1rem;
}

.range-input .input-group:first-child {
    margin-bottom: 0.5rem;
}

/* Update radio group for mobile devices */
@media screen and (max-width: 768px) {
    .radio-group {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }
}

@media screen and (max-width: 480px) {
    .radio-group {
        grid-template-columns: 1fr;
    }
}

/* Add these styles for the line numbers */
.output-container {
    position: relative;
    display: flex;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    overflow: hidden;
}

.output-container textarea {
    flex: 1;
    border: none;
    border-radius: 0;
    padding-left: 0.5rem;
    resize: vertical;
    font-family: monospace;
    line-height: 1.5;
    min-height: 150px;
}

.line-numbers {
    padding: 1rem 0.5rem;
    background-color: var(--background-color);
    color: var(--secondary-color);
    text-align: right;
    font-family: monospace;
    font-size: 0.95rem;
    line-height: 1.5;
    border-right: 1px solid var(--border-color);
    user-select: none;
    overflow: hidden;
}

/* Dark mode adjustments for line numbers */
[data-theme="dark"] .line-numbers {
    background-color: #242424;
}

/* Ensure line numbers are properly styled on mobile */
@media screen and (max-width: 480px) {
    .line-numbers {
        padding: 1rem 0.25rem;
        font-size: 0.85rem;
        min-width: 2rem;
    }
}

/* Auto Lines Toggle Switch Styles */
.auto-lines-toggle {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
}

.switch-label {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.auto-lines-checkbox {
    display: none;
}

.switch-slider {
    position: relative;
    width: 48px;
    height: 24px;
    background-color: var(--border-color);
    border-radius: 12px;
    margin-right: 10px;
    transition: background-color 0.3s;
}

.switch-slider:before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.3s;
}

.auto-lines-checkbox:checked + .switch-slider {
    background-color: var(--primary-color);
}

.auto-lines-checkbox:checked + .switch-slider:before {
    transform: translateX(24px);
}

.switch-text {
    font-weight: 500;
    color: var(--text-color);
}

/* Mobile adjustments for auto lines toggle */
@media screen and (max-width: 480px) {
    .auto-lines-toggle {
        margin-top: 0.75rem;
        padding-top: 0.75rem;
    }

    .switch-slider {
        width: 40px;
        height: 20px;
    }

    .switch-slider:before {
        width: 16px;
        height: 16px;
    }

    .auto-lines-checkbox:checked + .switch-slider:before {
        transform: translateX(20px);
    }
} 