/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8fafc;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Header Styles */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 1rem 0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 1.5rem;
    font-weight: 700;
}

.logo a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.logo i {
    font-size: 2rem;
}

.tagline {
    font-size: 0.9rem;
    opacity: 0.9;
    margin-top: 0.5rem;
}

.breadcrumb {
    font-size: 1rem;
    font-weight: 500;
}

/* Main Content */
.main-content {
    min-height: calc(100vh - 140px);
    padding: 2rem 0;
}

/* Hero Section */
.hero {
    text-align: center;
    margin-bottom: 3rem;
}

.hero h2 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    color: #2d3748;
}

.hero p {
    font-size: 1.1rem;
    color: #718096;
    max-width: 600px;
    margin: 0 auto;
}

/* Document Types Grid */
.document-types {
    margin-bottom: 4rem;
}

.document-types h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2d3748;
}

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

.document-card {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.document-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
    border-color: #667eea;
}

.card-icon {
    font-size: 3rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.document-card h4 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2d3748;
}

.document-card p {
    color: #718096;
    margin-bottom: 1.5rem;
    line-height: 1.6;
}

/* Features Section */
.features {
    margin-bottom: 3rem;
}

.features h3 {
    text-align: center;
    font-size: 2rem;
    margin-bottom: 2rem;
    color: #2d3748;
}

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

.feature {
    text-align: center;
    padding: 1.5rem;
}

.feature i {
    font-size: 2.5rem;
    color: #667eea;
    margin-bottom: 1rem;
}

.feature h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.feature p {
    color: #718096;
    font-size: 0.9rem;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-family: inherit;
}

.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: #e2e8f0;
    color: #4a5568;
}

.btn-secondary:hover {
    background: #cbd5e0;
}

.btn-success {
    background: #48bb78;
    color: white;
}

.btn-success:hover {
    background: #38a169;
    transform: translateY(-2px);
}

.btn-info {
    background: #4299e1;
    color: white;
}

.btn-info:hover {
    background: #3182ce;
    transform: translateY(-2px);
}

/* Generator Layout */
.generator-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    align-items: start;
}

.form-section, .preview-section {
    background: white;
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
}

.form-header, .preview-header {
    margin-bottom: 2rem;
}

.form-header h2, .preview-header h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2d3748;
}

.form-header p, .preview-header p {
    color: #718096;
}

.preview-controls {
    display: flex;
    justify-content: flex-end;
}

/* Form Styles */
.document-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-weight: 500;
    color: #2d3748;
    font-size: 0.9rem;
}

.form-group input,
.form-group textarea,
.form-group select {
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.9rem;
    transition: border-color 0.3s ease;
    font-family: inherit;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: #667eea;
}

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

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Preview Styles */
.document-preview {
    background: #f7fafc;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    padding: 2rem;
    min-height: 400px;
    font-family: 'Times New Roman', serif;
    line-height: 1.8;
    color: #2d3748;
}

.preview-placeholder {
    text-align: center;
    color: #a0aec0;
    padding: 2rem;
}

.preview-placeholder i {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.document-preview h1 {
    font-size: 1.5rem;
    font-weight: bold;
    text-align: center;
    margin-bottom: 2rem;
    text-transform: uppercase;
}

.document-preview h2 {
    font-size: 1.2rem;
    font-weight: bold;
    margin: 1.5rem 0 1rem 0;
}

.document-preview p {
    margin-bottom: 1rem;
    text-align: justify;
}

.document-preview .signature-section {
    margin-top: 3rem;
    display: flex;
    justify-content: space-between;
}

.document-preview .signature-box {
    text-align: center;
    width: 45%;
}

/* Download Section */
.download-section {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.download-section h3 {
    font-size: 1.2rem;
    margin-bottom: 1rem;
    color: #2d3748;
}

.download-buttons {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Footer */
.footer {
    background: #2d3748;
    color: white;
    text-align: center;
    padding: 1.5rem 0;
    margin-top: auto;
}

/* Profile Icon */
.profile-icon {
    font-size: 2rem; /* Increased from 1.5rem */
    margin-left: 1rem;
    display: flex;
    align-items: center;
}

.profile-icon a {
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
}

.profile-icon i {
    font-size: 2rem; /* Explicitly set icon size */
}

.profile-icon a:hover {
    opacity: 0.9;
    transform: scale(1.05);
    transition: all 0.2s ease;
}

/* Responsive Design */
@media (max-width: 768px) {
    .header .container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .generator-layout {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .download-buttons {
        flex-direction: column;
    }
    
    .document-preview .signature-section {
        flex-direction: column;
        gap: 2rem;
    }
    
    .document-preview .signature-box {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0 15px;
    }
    
    .document-card {
        padding: 1.5rem;
    }
    
    .form-section, .preview-section {
        padding: 1.5rem;
    }
    
    .hero h2 {
        font-size: 1.75rem;
    }
}

/* Utility Classes */
.text-center {
    text-align: center;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mt-2 {
    margin-top: 1rem;
}

.hidden {
    display: none;
}

/* Loading States */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #667eea;
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Document Editor Styles */
.document-editor {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin: 1rem 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.editor-header {
    padding: 1rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 8px 8px 0 0;
}

.editor-header h3 {
    margin: 0 0 0.5rem 0;
    color: #2d3748;
    font-size: 1.2rem;
}

.editor-header p {
    margin: 0;
    color: #718096;
    font-size: 0.9rem;
}

.editor-toolbar {
    padding: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn-sm {
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    border-radius: 6px;
}

.editor-content {
    padding: 1rem;
    min-height: 300px;
}

.rich-editor {
    min-height: 250px;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    padding: 1rem;
    font-family: 'Times New Roman', serif;
    font-size: 12pt;
    line-height: 1.6;
    outline: none;
    background: white;
    overflow-y: auto;
}

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

.rich-editor h1 {
    font-size: 16pt;
    font-weight: bold;
    margin: 1rem 0 0.5rem 0;
    color: #2d3748;
}

.rich-editor h2 {
    font-size: 14pt;
    font-weight: bold;
    margin: 0.75rem 0 0.5rem 0;
    color: #2d3748;
}

.rich-editor p {
    margin: 0.5rem 0;
}

.rich-editor strong {
    font-weight: bold;
}

.rich-editor em {
    font-style: italic;
}

.rich-editor u {
    text-decoration: underline;
}

.rich-editor ul, .rich-editor ol {
    margin: 0.5rem 0;
    padding-left: 2rem;
}

.editor-actions {
    padding: 1rem;
    border-top: 1px solid #e2e8f0;
    background: #f8fafc;
    border-radius: 0 0 8px 8px;
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
}

/* Editor state indicators */
.editor-modified {
    border-left: 4px solid #ed8936;
}

.editor-saved {
    border-left: 4px solid #48bb78;
}

/* Responsive editor styles */
@media (max-width: 768px) {
    .editor-toolbar {
        justify-content: center;
    }
    
    .editor-actions {
        flex-direction: column;
    }
    
    .rich-editor {
        font-size: 11pt;
    }
}

/* Authentication Styles */
.header-right {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.auth-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.auth-buttons {
    display: flex;
    gap: 0.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: white;
    font-weight: 500;
}

/* Auth Modal Styles */
.auth-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
}

.auth-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 0;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    animation: modalSlideIn 0.3s ease-out;
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-50px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.auth-modal-header h2 {
    margin: 0;
    color: #2d3748;
    font-size: 1.5rem;
    font-weight: 600;
}

.close-btn {
    background: none;
    border: none;
    font-size: 1.5rem;
    color: #718096;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 50%;
    transition: all 0.2s ease;
}

.close-btn:hover {
    background-color: #f7fafc;
    color: #2d3748;
}

.auth-form {
    padding: 1.5rem;
}

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

.auth-form label {
    display: block;
    margin-bottom: 0.5rem;
    color: #2d3748;
    font-weight: 500;
}

.auth-form input {
    width: 100%;
    padding: 0.75rem;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 1rem;
    transition: border-color 0.2s ease;
}

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

.auth-form button {
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    margin-top: 1rem;
}

.auth-switch {
    padding: 1rem 1.5rem 1.5rem 1.5rem;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.auth-switch p {
    margin: 0;
    color: #718096;
}

.auth-switch a {
    color: #667eea;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* Google Sign-in Button */
.btn-google {
    background-color: #ffffff;
    color: #757575;
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-weight: 500;
    transition: all 0.2s ease;
    width: 100%;
    padding: 0.75rem;
    font-size: 1rem;
    margin-top: 0;
    border-radius: 8px;
    cursor: pointer;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-google:hover {
    background-color: #f8f9fa;
    border-color: #d1d5db;
    color: #374151;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-google:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.btn-google i {
    color: #4285f4;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* Auth Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 1.5rem 0;
    display: flex;
    align-items: center;
}

.auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e2e8f0;
    transform: translateY(-50%);
}

.auth-divider span {
    background-color: #ffffff;
    padding: 0 1rem;
    color: #718096;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
    font-weight: 500;
}

/* Responsive auth styles */
@media (max-width: 768px) {
    .header-right {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
    
    .auth-section {
        width: 100%;
        justify-content: flex-end;
    }
    
    .auth-modal-content {
        margin: 10% auto;
        width: 95%;
    }
}