/* Digital Forms - Complete Styles */

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    line-height: 1.6;
    color: #374151;
    margin: 0;
    padding: 0;
}

/* Utility Classes */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-primary {
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1D4ED8, #1E40AF);
    transform: translateY(-1px);
}

.card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
    transition: all 0.3s;
}

.card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #3B82F6;
}

/* Page Layout */
.page-container {
    min-height: 100vh;
    background: linear-gradient(135deg, #F9FAFB, #EBF8FF);
    padding: 2rem 0;
}

.page-header {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
    padding: 2rem;
    margin-bottom: 2rem;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 0.5rem;
}

.page-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #3B82F6, #8B5CF6);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.page-title h1 {
    font-size: 2rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.page-subtitle {
    color: #6B7280;
    margin: 0;
}

/* Forms Grid */
.forms-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
}

.form-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
    padding: 1.5rem;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
}

.form-card:hover {
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
    border-color: #3B82F6;
    transform: translateY(-2px);
}

.form-card-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.form-icon {
    width: 3rem;
    height: 3rem;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    border-radius: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.form-content {
    flex: 1;
    min-width: 0;
}

.form-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
    line-height: 1.4;
}

.form-description {
    font-size: 0.875rem;
    color: #6B7280;
    margin: 0;
    line-height: 1.5;
}

.form-stats {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
}

.form-stats-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.stat-item {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    color: #6B7280;
}

.stat-number {
    font-weight: 600;
    color: #374151;
}

.secure-badge {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: #D97706;
    font-size: 0.75rem;
    font-weight: 600;
}

.form-button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
    text-decoration: none;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.form-button:hover {
    background: linear-gradient(135deg, #1D4ED8, #1E40AF);
    transform: translateY(-1px);
    color: white;
}

/* Search Form */
.search-form {
    display: flex;
    gap: 0;
    margin-top: 1.5rem;
}

.search-input-wrapper {
    position: relative;
    flex: 1;
}

.search-input {
    width: 100%;
    padding: 0.75rem 1rem 0.75rem 2.5rem;
    border: 1px solid #D1D5DB;
    border-right: none;
    border-radius: 0.5rem 0 0 0.5rem;
    font-size: 0.875rem;
    outline: none;
    transition: all 0.2s;
}

.search-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.search-icon {
    position: absolute;
    left: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9CA3AF;
    width: 1rem;
    height: 1rem;
}

.search-button {
    padding: 0.75rem 1.5rem;
    background: #3B82F6;
    color: white;
    border: 1px solid #3B82F6;
    border-radius: 0 0.5rem 0.5rem 0;
    cursor: pointer;
    transition: all 0.2s;
}

.search-button:hover {
    background: #1D4ED8;
    border-color: #1D4ED8;
}

/* Empty State */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border: 1px solid #E5E7EB;
}

.empty-icon {
    width: 4rem;
    height: 4rem;
    background: #F3F4F6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    color: #9CA3AF;
}

.empty-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.empty-description {
    color: #6B7280;
    margin: 0 0 2rem 0;
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid #E5E7EB;
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 4rem;
}

.navbar-brand {
    font-size: 1.25rem;
    font-weight: 700;
    color: #111827;
    text-decoration: none;
}

.navbar-nav {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-link {
    color: #6B7280;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.nav-link:hover {
    color: #3B82F6;
}

/* Dropdown hover effects */
.navbar-nav a:hover,
.navbar-nav button:hover {
    color: #3B82F6 !important;
}

.navbar-nav div[x-show="open"] a:hover,
.navbar-nav div[x-show="open"] button:hover {
    background-color: #F3F4F6;
}

/* Responsive */
@media (max-width: 768px) {
    .navbar-container {
        flex-direction: column;
        height: auto;
        padding: 1rem;
    }
    
    .navbar-nav {
        margin-top: 1rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .page-header {
        padding: 1.5rem;
    }
    
    .page-title {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .page-title h1 {
        font-size: 1.5rem;
    }
    
    .forms-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .form-card {
        padding: 1rem;
    }
    
    .search-form {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .search-input {
        border-radius: 0.5rem;
        border-right: 1px solid #D1D5DB;
    }
    
    .search-button {
        border-radius: 0.5rem;
    }
}

/* Form Styles */
.form-container {
    max-width: 64rem;
    margin: 0 auto;
    padding: 1.5rem;
}

.form-header {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.form-header-content {
    padding: 1.5rem;
    border-bottom: 1px solid #E5E7EB;
}

.form-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
    margin: 0 0 0.5rem 0;
}

.form-description {
    color: #6B7280;
    margin: 0;
}

.form-meta {
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    font-size: 0.875rem;
    color: #6B7280;
}

.form-meta-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-body {
    background: white;
    border-radius: 0.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.form-content {
    padding: 1.5rem;
}

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

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.5rem;
}

.form-label .required {
    color: #DC2626;
}

.sensitive-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.125rem 0.5rem;
    background: #FEF3C7;
    color: #D97706;
    border-radius: 0.25rem;
    font-size: 0.75rem;
    font-weight: 500;
    margin-left: 0.5rem;
}

.form-input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    transition: all 0.2s;
    outline: none;
}

.form-input:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.error {
    border-color: #DC2626;
}

.form-select {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    background: white;
    transition: all 0.2s;
    outline: none;
}

.form-select:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #D1D5DB;
    border-radius: 0.5rem;
    font-size: 0.875rem;
    resize: vertical;
    min-height: 6rem;
    transition: all 0.2s;
    outline: none;
}

.form-textarea:focus {
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-error {
    color: #DC2626;
    font-size: 0.875rem;
    margin-top: 0.25rem;
}

.security-notice {
    background: #FFFBEB;
    border: 1px solid #FDE68A;
    border-radius: 0.5rem;
    padding: 1rem;
    margin-bottom: 1.5rem;
}

.security-notice-content {
    display: flex;
    gap: 0.75rem;
}

.security-notice-icon {
    flex-shrink: 0;
    color: #F59E0B;
}

.security-notice-text h3 {
    font-size: 0.875rem;
    font-weight: 500;
    color: #92400E;
    margin: 0 0 0.5rem 0;
}

.security-notice-text p {
    font-size: 0.875rem;
    color: #92400E;
    margin: 0;
}

.form-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1.5rem;
    border-top: 1px solid #E5E7EB;
}

.back-link {
    font-size: 0.875rem;
    color: #6B7280;
    text-decoration: none;
    transition: color 0.2s;
}

.back-link:hover {
    color: #374151;
}

.submit-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, #3B82F6, #1D4ED8);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.submit-button:hover {
    background: linear-gradient(135deg, #1D4ED8, #1E40AF);
    transform: translateY(-1px);
}

.submit-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.spinner {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Gujarati font support */
.gujarati {
    font-family: 'Noto Sans Gujarati', 'Shruti', Arial, sans-serif;
}

/* Form canvas for positioning */
.form-canvas {
    background-image: 
        linear-gradient(rgba(0, 0, 0, 0.1) 1px, transparent 1px),
        linear-gradient(90deg, rgba(0, 0, 0, 0.1) 1px, transparent 1px);
    background-size: 20px 20px;
    position: relative;
    overflow: hidden;
}

/* Draggable field styles */
.draggable-field {
    cursor: move;
    border: 2px dashed #3B82F6;
    background: rgba(59, 130, 246, 0.1);
    position: absolute;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    user-select: none;
    z-index: 10;
}

.draggable-field:hover {
    background: rgba(59, 130, 246, 0.2);
    border-color: #2563EB;
}

/* Positioned field styles */
.positioned-field {
    border: 1px solid #10B981;
    background: rgba(16, 185, 129, 0.1);
    position: absolute;
    padding: 2px 4px;
    border-radius: 2px;
    font-size: 12px;
    pointer-events: none;
}

/* Loading spinner */
.spinner {
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    animation: spin 1s linear infinite;
}

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

/* Form field focus styles */
.form-input:focus {
    outline: none;
    border-color: #3B82F6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* Sensitive field indicator */
.sensitive-field {
    position: relative;
}

.sensitive-field::after {
    content: "🔒";
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 12px;
}

/* PDF preview styles */
.pdf-preview {
    width: 794px;
    height: 1123px;
    border: 1px solid #ddd;
    margin: 0 auto;
    position: relative;
    background: white;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .pdf-preview {
        width: 100%;
        height: auto;
        aspect-ratio: 794/1123;
    }
    
    .form-canvas {
        background-size: 10px 10px;
    }
}

/* Print styles for PDF generation */
@media print {
    body {
        margin: 0;
        padding: 0;
    }
    
    .no-print {
        display: none !important;
    }
    
    .pdf-page {
        page-break-after: always;
        width: 794px;
        height: 1123px;
        position: relative;
    }
    
    .pdf-page:last-child {
        page-break-after: avoid;
    }
}
