@font-face {
    font-family: 'Vazirmatn';
    src: url('https://fonts.googleapis.com/css2?family=Vazirmatn:wght@400;500;700&display=swap') format('woff2');
}

:root {
    --primary-color: #4A90E2;
    --secondary-color: #50E3C2;
    --background-color: #F4F7F9;
    --container-bg: #FFFFFF;
    --text-color: #333;
    --light-text-color: #777;
    --border-color: #EAEAEA;
    --success-color: #28a745;
    --error-color: #dc3545;
    --shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
}

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

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

.container {
    max-width: 1000px;
    margin: 2rem auto;
    padding: 2rem;
    background-color: var(--container-bg);
    border-radius: 12px;
    box-shadow: var(--shadow);
}

.main-header {
    text-align: center;
    margin-bottom: 3rem;
}

.main-header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.main-header p {
    font-size: 1.1rem;
    color: var(--light-text-color);
}

.actions-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.action-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.5rem;
    text-align: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.action-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow);
}

.action-card h3 {
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.action-card p {
    color: var(--light-text-color);
    margin-bottom: 1.5rem;
    min-height: 40px;
}

.file-input {
    display: none;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: center;
    width: 100%;
}

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

.btn-primary:hover {
    background-color: #357ABD;
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--primary-color);
}

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

/* Editor Modal */
.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
}

.editor-container {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 800px;
    height: 85vh;
    background: white;
    z-index: 1000;
    border-radius: 15px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    padding: 20px;
    display: flex;
    flex-direction: column;
}

.editor-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border-color);
}

.editor-header h2 {
    font-size: 1.5rem;
    color: var(--text-color);
}

.close-editor {
    background: transparent;
    border: none;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
}

#subtitleEditor {
    width: 100%;
    flex-grow: 1;
    padding: 15px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 16px;
    line-height: 1.7;
    resize: none;
    font-family: 'Vazirmatn', monospace;
    background: #fafafa;
}

.editor-actions {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    padding-top: 1rem;
    flex-wrap: wrap;
}

.btn-editor {
    background-color: #6c757d;
    color: white;
    width: auto;
}
.btn-editor:hover {
    background-color: #5a6268;
}

.btn-success {
    background-color: var(--success-color);
    color: white;
    width: auto;
}
.btn-success:hover {
    background-color: #218838;
}


/* File Output Section */
#file-output-container, #convert-output-container {
    margin-top: 2rem;
    background: #fff;
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    border-radius: 10px;
}

.file-info {
    text-align: center;
    padding: 1rem;
    background: #e9f3ff;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    border: 1px solid #b8d6ff;
}

.file-info p {
    margin: 0.5rem 0;
    font-size: 1.1rem;
    font-weight: 500;
}

.segment-buttons {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 0.75rem;
}

.copy-segment-btn {
    background: var(--secondary-color);
    color: #333;
    padding: 0.75rem;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.9rem;
    font-weight: 500;
}

.copy-segment-btn:hover {
    background: #45d1b5;
    transform: translateY(-2px);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 25px;
    border-radius: 8px;
    background: var(--text-color);
    color: white;
    box-shadow: var(--shadow);
    transition: bottom 0.5s ease-in-out;
    z-index: 2000;
    font-size: 1rem;
}

.toast.show {
    bottom: 30px;
}