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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
    color: #333;
}

.container {
    max-width: 900px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow: hidden;
}

header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 40px;
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    font-weight: 700;
}

.subtitle {
    font-size: 1.1em;
    opacity: 0.9;
}

main {
    padding: 40px;
}

.input-section {
    margin-bottom: 40px;
}

.input-section h2 {
    color: #667eea;
    margin-bottom: 20px;
    font-size: 1.8em;
}

textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    font-family: inherit;
    resize: vertical;
    transition: border-color 0.3s;
    line-height: 1.6;
}

textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.btn {
    padding: 12px 30px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 15px;
    margin-right: 10px;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: #f0f0f0;
    color: #333;
}

.btn-secondary:hover {
    background: #e0e0e0;
    transform: translateY(-2px);
}

.proof-section {
    margin-top: 40px;
    padding-top: 40px;
    border-top: 2px solid #e0e0e0;
}

.proof-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    flex-wrap: wrap;
    gap: 15px;
}

.proof-header h2 {
    color: #667eea;
    font-size: 1.8em;
}

.action-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.proof-content {
    background: #f8f9fa;
    padding: 40px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    line-height: 1.8;
    font-size: 16px;
    font-family: 'Times New Roman', Times, serif;
    text-align: justify;
}

/* Main title */
.proof-content .main-title {
    font-size: 1.8em;
    font-weight: bold;
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Section headers (1. INTRODUCTION, 2. DEFINITIONS, etc.) */
.proof-content .section-header {
    color: #667eea;
    margin-top: 30px;
    margin-bottom: 15px;
    font-size: 1.4em;
    font-weight: bold;
    text-transform: uppercase;
}

.proof-content .section-header:first-of-type {
    margin-top: 0;
}

/* Subsection headers (4.1. Assumption, 4.2. Construction, etc.) */
.proof-content .subsection-header {
    color: #764ba2;
    margin-top: 20px;
    margin-bottom: 12px;
    font-size: 1.2em;
    font-weight: 600;
}

/* Paragraphs */
.proof-content .proof-paragraph {
    margin-bottom: 15px;
    text-indent: 0;
    text-align: justify;
}

/* Theorem box */
.proof-content .theorem {
    background: white;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border: 2px solid #667eea;
    border-left: 5px solid #667eea;
}

.proof-content .theorem-title {
    font-weight: bold;
    color: #764ba2;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-style: italic;
}

/* Corollary box */
.proof-content .corollary {
    background: #f0f4ff;
    padding: 20px;
    border-radius: 8px;
    margin: 25px 0;
    border: 2px solid #764ba2;
    border-left: 5px solid #764ba2;
}

.proof-content .corollary-title {
    font-weight: bold;
    color: #764ba2;
    margin-bottom: 10px;
    font-size: 1.1em;
    font-style: italic;
}

/* Q.E.D. */
.proof-content .qed {
    text-align: right;
    font-weight: bold;
    font-style: italic;
    margin-top: 30px;
    margin-bottom: 10px;
    font-size: 1.1em;
    color: #667eea;
}

/* Algorithm/code blocks */
.proof-content .algorithm {
    background: #f5f5f5;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
    border-left: 4px solid #667eea;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    overflow-x: auto;
    white-space: pre;
}

/* Numbered items */
.proof-content .numbered-item {
    margin: 10px 0;
    padding-left: 20px;
    text-indent: -20px;
}

/* Title line */
.proof-content .title-line {
    text-align: center;
    font-style: italic;
    margin-bottom: 20px;
    color: #666;
}

/* Case statements */
.proof-content .case-statement {
    font-weight: 600;
    margin-top: 15px;
    margin-bottom: 10px;
    color: #764ba2;
}

footer {
    background: #f8f9fa;
    padding: 20px;
    text-align: center;
    color: #666;
    font-size: 0.9em;
}

@media print {
    body {
        background: white;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border-radius: 0;
    }
    
    header {
        background: #667eea;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }
    
    .action-buttons {
        display: none;
    }
    
    .input-section {
        display: none;
    }
    
    .proof-content {
        background: white;
        border: none;
        padding: 20px;
        font-size: 12pt;
    }
    
    .proof-content .main-title {
        font-size: 16pt;
    }
    
    .proof-content .section-header {
        font-size: 14pt;
    }
    
    .proof-content .subsection-header {
        font-size: 12pt;
    }
    
    .proof-content .algorithm {
        font-size: 10pt;
        page-break-inside: avoid;
    }
    
    .proof-content .theorem,
    .proof-content .corollary {
        page-break-inside: avoid;
    }
}

@media (max-width: 768px) {
    header h1 {
        font-size: 2em;
    }
    
    main {
        padding: 20px;
    }
    
    .proof-header {
        flex-direction: column;
        align-items: flex-start;
    }
}

