/* Forms Specific Styles */
.forms-page {
    animation: fadeIn 0.3s ease;
}

.forms-container {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.forms-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.forms-header h2 {
    font-size: 20px;
    color: #333;
    margin: 0;
}

.forms-filters {
    display: flex;
    gap: 10px;
    align-items: center;
}

.forms-filters select {
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
}

.forms-list {
    padding: 20px;
}

.form-item {
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
    position: relative;
}

.form-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #0078d4, #106ebe);
    border-radius: 12px 12px 0 0;
}

.form-item:hover {
    border-color: #0078d4;
    box-shadow: 0 4px 20px rgba(0, 120, 212, 0.15);
    transform: translateY(-2px);
}

.form-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.form-item-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.form-item-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.form-item-meta {
    display: flex;
    gap: 20px;
    font-size: 12px;
    color: #999;
    margin-bottom: 15px;
}

.form-item-meta-item {
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-item-meta-item i {
    color: #0078d4;
}

.form-item-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.form-item-status {
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-item-status.active {
    background: #d4edda;
    color: #155724;
}

.form-item-status.draft {
    background: #fff3cd;
    color: #856404;
}

.form-item-status.archived {
    background: #f8d7da;
    color: #721c24;
}

/* SharePoint-First Approach */
.create-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.create-form-header h4 {
    color: #333;
    margin-bottom: 10px;
    font-size: 24px;
}

.form-instruction {
    color: #666;
    font-size: 16px;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

.sharepoint-first-approach {
    margin-bottom: 30px;
}

.step-guide {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 12px;
}

.step {
    flex: 1;
    text-align: center;
    padding: 0 15px;
    position: relative;
}

.step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 20px;
    right: -15px;
    width: 30px;
    height: 2px;
    background: #0078d4;
    z-index: 1;
}

.step-number {
    width: 40px;
    height: 40px;
    background: #0078d4;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 18px;
    margin: 0 auto 15px;
}

.step-content h5 {
    color: #333;
    margin-bottom: 8px;
    font-size: 16px;
}

.step-content p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.create-options {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.create-option {
    background: white;
    border: 2px solid #e9ecef;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
}

.create-option.primary {
    border-color: #0078d4;
    background: linear-gradient(135deg, #f0f8ff 0%, #e3f2fd 100%);
}

.create-option.primary:hover {
    border-color: #106ebe;
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 120, 212, 0.15);
}

.create-option.disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: #f8f9fa;
}

.create-option i {
    font-size: 32px;
    color: #0078d4;
    margin-bottom: 15px;
}

.create-option h5 {
    color: #333;
    margin-bottom: 10px;
    font-size: 18px;
}

.create-option p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.recommended {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #28a745;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.coming-soon {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #6c757d;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* SharePoint Guide */
.sharepoint-guide {
    max-width: 800px;
}

.guide-steps {
    margin-bottom: 30px;
}

.guide-step {
    display: flex;
    align-items: flex-start;
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #0078d4;
}

.guide-step .step-number {
    width: 32px;
    height: 32px;
    background: #0078d4;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-right: 20px;
    flex-shrink: 0;
}

.guide-step .step-content h5 {
    color: #333;
    margin-bottom: 5px;
    font-size: 16px;
}

.guide-step .step-content p {
    color: #666;
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
}

.guide-tips {
    background: #e3f2fd;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
}

.guide-tips h5 {
    color: #0078d4;
    margin-bottom: 15px;
    font-size: 16px;
}

.guide-tips ul {
    margin: 0;
    padding-left: 20px;
}

.guide-tips li {
    color: #333;
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 8px;
}

/* Multi-Site List Selection */
.site-group {
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.site-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
}

.site-header h5 {
    color: #333;
    margin: 0 0 5px 0;
    font-size: 18px;
    font-weight: 600;
}

.site-url {
    color: #666;
    font-size: 14px;
    font-family: monospace;
}

.site-lists {
    padding: 20px;
}

.site-lists .list-option {
    margin-bottom: 15px;
}

.site-lists .list-option:last-child {
    margin-bottom: 0;
}

.list-selection {
    max-height: 500px;
    overflow-y: auto;
}

/* Form Builder */
.form-builder {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    margin-bottom: 20px;
}

.form-builder-header {
    padding: 20px;
    border-bottom: 1px solid #eee;
    background: #f8f9fa;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.form-builder-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
}

.form-builder-actions {
    display: flex;
    gap: 10px;
}

.form-builder-content {
    padding: 20px;
}

.form-builder-sidebar {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 20px;
}

.form-builder-main {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    min-height: 400px;
}

.form-builder-panel {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
}

.form-builder-panel h4 {
    font-size: 16px;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.field-types {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.field-type {
    padding: 12px;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
}

.field-type:hover {
    border-color: #0078d4;
    background: #f0f8ff;
}

.field-type i {
    font-size: 20px;
    color: #0078d4;
    margin-bottom: 5px;
}

.field-type-name {
    font-size: 12px;
    color: #333;
    font-weight: 500;
}

/* Form Fields */
.form-field {
    background: white;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    position: relative;
    transition: all 0.3s ease;
}

.form-field:hover {
    border-color: #0078d4;
    box-shadow: 0 2px 8px rgba(0, 120, 212, 0.1);
}

.form-field.selected {
    border-color: #0078d4;
    box-shadow: 0 0 0 2px rgba(0, 120, 212, 0.2);
}

.form-field-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

.form-field-title {
    font-weight: 600;
    color: #333;
    font-size: 14px;
}

.form-field-type {
    font-size: 11px;
    color: #0078d4;
    background: #e3f2fd;
    padding: 3px 6px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-field-controls {
    display: flex;
    gap: 5px;
}

.form-field-controls button {
    padding: 4px 6px;
    font-size: 11px;
    border: none;
    background: #6c757d;
    color: white;
    border-radius: 3px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.form-field-controls button:hover {
    background: #5a6268;
}

.form-field-controls .btn-danger {
    background: #dc3545;
}

.form-field-controls .btn-danger:hover {
    background: #c82333;
}

.form-field-preview {
    pointer-events: none;
    opacity: 0.7;
}

.form-field-preview input,
.form-field-preview select,
.form-field-preview textarea {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    background: #f8f9fa;
}

.form-field-properties {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid #eee;
}

.property-group {
    margin-bottom: 10px;
}

.property-group label {
    display: block;
    font-size: 12px;
    color: #666;
    margin-bottom: 3px;
}

.property-group input,
.property-group select {
    width: 100%;
    padding: 6px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 12px;
}

.property-group input[type="checkbox"] {
    width: auto;
    margin-right: 5px;
}

/* Form Rendering */
.form-renderer {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 30px;
    max-width: 600px;
    margin: 0 auto;
}

.form-renderer h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 24px;
    text-align: center;
}

.form-renderer .form-description {
    color: #666;
    text-align: center;
    margin-bottom: 30px;
    font-size: 14px;
    line-height: 1.6;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.form-group label.required::after {
    content: " *";
    color: #dc3545;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
    background: white;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0, 120, 212, 0.1);
}

.form-group input:invalid {
    border-color: #dc3545;
}

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

.form-group .form-help {
    font-size: 12px;
    color: #666;
    margin-top: 5px;
    line-height: 1.4;
}

.form-group .form-error {
    font-size: 12px;
    color: #dc3545;
    margin-top: 5px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.form-group .form-error i {
    font-size: 10px;
}

.form-actions {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.form-actions .btn {
    min-width: 120px;
}

/* Form Validation */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.1);
}

.form-group.success input,
.form-group.success select,
.form-group.success textarea {
    border-color: #28a745;
    box-shadow: 0 0 0 3px rgba(40, 167, 69, 0.1);
}

/* Form Progress */
.form-progress {
    background: white;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    padding: 20px;
    margin-bottom: 20px;
}

.progress-bar {
    width: 100%;
    height: 8px;
    background: #e9ecef;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0078d4, #106ebe);
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 14px;
    color: #666;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {
    .form-builder-sidebar {
        grid-template-columns: 1fr;
    }
    
    .form-builder-panel {
        order: -1;
    }
    
    .field-types {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .form-item-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .form-item-actions {
        width: 100%;
        justify-content: flex-start;
    }
    
    .form-renderer {
        padding: 20px;
    }
    
    .form-actions {
        flex-direction: column;
    }
    
    .form-actions .btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .field-types {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .forms-filters {
        flex-direction: column;
        align-items: stretch;
    }
    
    .forms-filters select {
        width: 100%;
    }
}

/* Submission Management Styles */
.submissions-container {
    max-width: 100%;
    margin: 0 auto;
}

.submissions-header {
    margin-bottom: 30px;
    text-align: center;
}

.submissions-header h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 24px;
}

.submissions-header p {
    color: #666;
    margin: 0;
    font-size: 16px;
}

.submissions-list {
    max-height: 600px;
    overflow-y: auto;
}

.submission-group {
    margin-bottom: 30px;
    border: 1px solid #e9ecef;
    border-radius: 12px;
    overflow: hidden;
}

.submission-group-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.submission-group-header h5 {
    color: #333;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.submission-count {
    background: #0078d4;
    color: white;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

.submission-items {
    padding: 20px;
}

.submission-item {
    border: 1px solid #e9ecef;
    border-radius: 8px;
    margin-bottom: 15px;
    padding: 15px;
    background: white;
    transition: all 0.2s ease;
}

.submission-item:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: #0078d4;
}

.submission-item:last-child {
    margin-bottom: 0;
}

.submission-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}

.submission-info {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.submission-date {
    color: #666;
    font-size: 14px;
    font-weight: 500;
}

.submission-user {
    color: #999;
    font-size: 13px;
}

.submission-actions {
    display: flex;
    gap: 10px;
}

.submission-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
}

.submission-field {
    display: flex;
    flex-direction: column;
    min-width: 150px;
}

.submission-field .field-name {
    font-weight: 600;
    color: #333;
    font-size: 13px;
    margin-bottom: 2px;
}

.submission-field .field-value {
    color: #666;
    font-size: 14px;
    word-break: break-word;
}

/* Submission Details */
.submission-details {
    max-width: 100%;
}

.submission-details-header {
    margin-bottom: 30px;
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.submission-details-header h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 24px;
}

.submission-meta {
    display: flex;
    justify-content: center;
    gap: 20px;
    color: #666;
    font-size: 14px;
}

.submission-fields {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.submission-fields .submission-field {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.submission-fields .field-label {
    font-weight: 600;
    color: #333;
    font-size: 14px;
    margin-bottom: 8px;
    display: block;
}

.submission-fields .field-value {
    color: #666;
    font-size: 16px;
    word-break: break-word;
    line-height: 1.4;
}

/* Submission Edit */
.submission-edit {
    max-width: 100%;
}

.submission-edit-header {
    margin-bottom: 30px;
    text-align: center;
}

.submission-edit-header h4 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 24px;
}

.submission-edit-header p {
    color: #666;
    margin: 0;
    font-size: 16px;
}

/* Clickable Cards */
.dashboard-card.clickable {
    cursor: pointer;
    transition: all 0.2s ease;
}

.dashboard-card.clickable:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.dashboard-card.clickable:active {
    transform: translateY(0);
}

/* Empty State for Submissions */
.submissions-container .empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.submissions-container .empty-state i {
    font-size: 48px;
    color: #ccc;
    margin-bottom: 20px;
}

.submissions-container .empty-state h3 {
    color: #333;
    margin: 0 0 10px 0;
    font-size: 20px;
}

.submissions-container .empty-state p {
    margin: 0;
    font-size: 16px;
    line-height: 1.5;
}
