/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    line-height: 1.6;
    color: #333;
    background: #ffffff;
    min-height: 100vh;
}

/* Header styles - SoftServe inspired */
.main-header {
    background: #ffffff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 70px;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 2rem;
    height: 100%;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    color: #1a237e;
    text-decoration: none;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    color: #333;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
}

.nav-links a:hover {
    color: #1a237e;
}

/* Container and layout */
.container {
    margin-top: 70px;
    min-height: calc(100vh - 70px);
}

/* Hero section - SoftServe style */
.hero-section {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
}

.hero-content {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 2rem;
}

.hero-title {
    font-size: 3.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.hero-subtitle {
    font-size: 1.2rem;
    margin-bottom: 2rem;
    opacity: 0.9;
    font-weight: 400;
}

.hero-cta {
    display: inline-block;
    background: #ffffff;
    color: #1a237e;
    padding: 1rem 2rem;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    margin-top: 1rem;
}

.hero-cta:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

/* Main content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

/* Service sections - numbered like SoftServe */
.service-section {
    margin-bottom: 3rem;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.service-header {
    background: #f8f9fa;
    padding: 1.5rem 2rem;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    align-items: center;
    gap: 1rem;
}

.service-number {
    background: #1a237e;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 1.1rem;
}

.service-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.service-content {
    padding: 2rem;
}

/* Form styles - corporate design */
.form-section {
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #333;
    font-size: 0.95rem;
}

input[type="text"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    background: white;
}

input[type="text"]:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #1a237e;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

textarea {
    resize: vertical;
    min-height: 100px;
}

select {
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 0.65rem;
    appearance: none;
}

.help-text {
    display: block;
    margin-top: 0.25rem;
    color: #6c757d;
    font-size: 0.875rem;
}

/* Buttons - SoftServe style */
.btn-primary,
.btn-secondary {
    display: inline-block;
    padding: 0.875rem 2rem;
    border: none;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    margin-right: 1rem;
    margin-bottom: 0.5rem;
}

.btn-primary {
    background: #1a237e;
    color: white;
}

.btn-primary:hover {
    background: #303f9f;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(26, 35, 126, 0.3);
}

.btn-secondary {
    background: #6c757d;
    color: white;
}

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

/* Form actions */
.form-actions {
    text-align: center;
    padding: 2rem;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-top: 2rem;
}

/* Error messages */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 1rem 1.5rem;
    margin: 1.5rem 0;
    border-radius: 6px;
    border: 1px solid #f5c6cb;
    font-weight: 500;
}

/* Privacy warning styles */
.privacy-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffeaa7 100%);
    border: 2px solid #ffc107;
    border-radius: 12px;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.15);
}

.warning-header {
    display: flex;
    align-items: center;
    margin-bottom: 1rem;
}

.warning-icon {
    font-size: 1.5rem;
    margin-right: 0.75rem;
}

.warning-header h3 {
    color: #856404;
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.warning-content p {
    color: #856404;
    font-weight: 500;
    margin-bottom: 1rem;
}

.warning-content ul {
    color: #856404;
    margin-left: 1.5rem;
    margin-bottom: 0;
}

.warning-content li {
    margin-bottom: 0.5rem;
    line-height: 1.5;
}

.warning-content li:last-child {
    margin-bottom: 0;
}

/* Result page styles */
.result-hero {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 3rem 0;
    text-align: center;
}

.result-section {
    padding: 3rem 2rem;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.result-title {
    font-size: 2rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.result-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.generation-info {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
    border-radius: 6px;
    padding: 1rem;
    margin-bottom: 2rem;
    text-align: center;
}

.generation-method {
    color: #1565c0;
    font-weight: 600;
}

.case-study-output {
    background: #ffffff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    font-family: 'Georgia', 'Times New Roman', serif;
    line-height: 1.8;
    color: #333;
    margin-bottom: 2rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: pre-line;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.case-study-output:hover {
    border-color: #1a237e;
    box-shadow: 0 4px 20px rgba(26, 35, 126, 0.1);
}

/* Instructions */
.copy-instructions {
    background: #f0f8ff;
    border: 1px solid #b3d9ff;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.copy-instructions h3 {
    color: #0056b3;
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.copy-instructions ol {
    margin-left: 1.5rem;
    color: #0056b3;
}

.copy-instructions li {
    margin-bottom: 0.5rem;
}

/* Summary section */
.form-summary {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.form-summary h3 {
    color: #333;
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    font-weight: 600;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1rem;
}

.summary-item {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 6px;
    border-left: 4px solid #1a237e;
}

.summary-item strong {
    color: #333;
    display: block;
    margin-bottom: 0.25rem;
    font-size: 0.9rem;
}

/* Footer - SoftServe style */
.main-footer {
    background: #1a237e;
    color: white;
    padding: 3rem 0 2rem;
    margin-top: 4rem;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.footer-section h4 {
    margin-bottom: 1rem;
    font-size: 1.1rem;
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: 0.5rem;
}

.footer-section ul li a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s ease;
}

.footer-section ul li a:hover {
    color: white;
}

.footer-bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.2);
    margin-top: 2rem;
    padding-top: 1rem;
    text-align: center;
    color: rgba(255, 255, 255, 0.7);
}

/* Responsive design */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .main-content {
        padding: 2rem 1rem;
    }

    .service-content {
        padding: 1.5rem;
    }

    .result-header {
        flex-direction: column;
        text-align: center;
    }

    .result-actions {
        justify-content: center;
    }

    .nav-links {
        display: none;
    }

    .header-content {
        padding: 0 1rem;
    }

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

@media (max-width: 480px) {
    .hero-title {
        font-size: 2rem;
    }

    .service-header {
        padding: 1rem;
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
        margin: 0.25rem 0;
    }
}

/* Print styles */
@media print {
    .main-header,
    .hero-section,
    .result-actions,
    .form-actions,
    .copy-instructions,
    .main-footer {
        display: none;
    }

    .container {
        margin-top: 0;
    }

    .case-study-output {
        border: 1px solid #ccc;
        box-shadow: none;
    }
}

/* Animations */
.service-section,
.case-study-output,
.summary-item {
    animation: fadeInUp 0.6s ease-out;
}

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

/* Form error highlighting */
.form-field-error {
    border: 2px solid #dc3545 !important;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.2) !important;
    background-color: #fff5f5 !important;
}

.form-field-error:focus {
    border-color: #dc3545 !important;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.3) !important;
}

.form-group.has-error label {
    color: #dc3545;
    font-weight: 600;
}

.form-group.has-error .help-text {
    color: #dc3545;
}

/* Generated Content Section Styles */
.generated-content-section {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px solid #dee2e6;
    border-radius: 12px;
    padding: 2rem;
    margin: 2rem 0;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #dee2e6;
}

.content-title {
    color: #2c3e50;
    font-size: 1.8rem;
    font-weight: 700;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.content-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.generation-info {
    margin-bottom: 1.5rem;
    text-align: center;
}

.generation-method {
    display: inline-block;
    background: linear-gradient(135deg, #007bff, #0056b3);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.3);
}

.case-study-display {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 2rem;
    margin: 1.5rem 0;
    line-height: 1.7;
    font-size: 1rem;
    color: #333;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.05);
    max-height: 600px;
    overflow-y: auto;
}

.case-study-display h1,
.case-study-display h2,
.case-study-display h3 {
    color: #2c3e50;
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.case-study-display h1 {
    font-size: 1.8rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.case-study-display h2 {
    font-size: 1.5rem;
    color: #34495e;
}

.case-study-display h3 {
    font-size: 1.3rem;
    color: #34495e;
}

.case-study-display p {
    margin-bottom: 1rem;
    text-align: justify;
}

.case-study-display strong {
    color: #2c3e50;
    font-weight: 600;
}

.case-study-edit {
    margin: 1.5rem 0;
}

.case-study-edit textarea {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    resize: vertical;
    min-height: 400px;
    border: 2px solid #dee2e6;
    transition: border-color 0.3s ease;
}

.case-study-edit textarea:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
    outline: none;
}

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

.quick-actions {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 1.5rem;
    margin-top: 1.5rem;
}

.quick-actions h4 {
    margin: 0 0 1rem 0;
    color: #495057;
    font-size: 1.1rem;
    font-weight: 600;
}

.quick-actions > div {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
}

.form-separator {
    text-align: center;
    margin: 3rem 0 2rem 0;
    padding: 2rem;
    background: linear-gradient(135deg, #e3f2fd 0%, #f3e5f5 100%);
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

.form-separator h3 {
    color: #37474f;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0 0 1rem 0;
}

.form-separator p {
    color: #546e7a;
    font-size: 1rem;
    margin: 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Button Enhancements */
.btn-success {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    border: none;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    font-weight: 600;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.95rem;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-success:hover {
    background: linear-gradient(135deg, #218838, #1ea085);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

/* Responsive Design for Generated Content */
@media (max-width: 768px) {
    .content-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }

    .content-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .edit-actions {
        justify-content: flex-start;
    }

    .quick-actions > div {
        flex-direction: column;
        align-items: flex-start;
    }

    .case-study-display {
        padding: 1rem;
        font-size: 0.95rem;
    }

    .generated-content-section {
        padding: 1.5rem;
        margin: 1rem 0;
    }
}