/* Tile Detail Modal Styles */

.tile-detail-modal .modal-content {
    padding: 0;
}

/* Tile detail header in modal header */
.tile-detail-modal .modal-header {
    padding: 0;
    border-bottom: 3px solid #e0e0e0;
    background: linear-gradient(135deg, var(--tile-bg-color, #ffffff) 0%, var(--tile-bg-color, #ffffff) 100%);
    border-radius: 12px 12px 0 0;
    position: relative;
    padding-right: 4rem; /* Space for close button */
}

.tile-detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 2rem;
    width: 100%;
}

.tile-detail-icon {
    width: 60px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--tile-icon-bg-color, #0066cc);
    color: var(--tile-icon-color, #ffffff);
    border-radius: 50%;
    font-size: 2rem;
    flex-shrink: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.tile-detail-title-section {
    flex: 1;
}

.tile-detail-title {
    margin: 0;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--tile-text-color, #2c3e50);
    line-height: 1.3;
}

.tile-detail-subtitle {
    margin: 0.5rem 0 0 0;
    font-size: 1rem;
    color: #666666;
    line-height: 1.4;
}

/* Form Styles */
.tile-detail-form {
    padding: 2rem;
    max-height: 60vh;
    overflow-y: auto;
}

.form-warning {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1rem 1.25rem;
    background-color: #fff3cd;
    border: 2px solid #ffc107;
    border-radius: 8px;
    margin-bottom: 2rem;
    color: #856404;
    font-weight: 500;
}

.form-warning i {
    font-size: 1.25rem;
    color: #ff9800;
    flex-shrink: 0;
}

.form-warning span {
    line-height: 1.5;
}


.form-section {
    margin-bottom: 2.5rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

.form-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0 0 1.5rem 0;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid #e0e0e0;
}

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

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

.form-field label {
    font-weight: 500;
    color: #2c3e50;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

.required-indicator {
    color: #f44336;
    font-weight: 600;
}

.form-input,
.form-textarea,
.form-select {
    padding: 0.75rem;
    border: 2px solid #d0d0d0;
    border-radius: 8px;
    font-size: 1rem;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    background-color: #ffffff;
    color: #2c3e50;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
    outline: none;
    border-color: #999999;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.form-input:invalid:not(:placeholder-shown),
.form-textarea:invalid:not(:placeholder-shown),
.form-select:invalid:not(:placeholder-shown) {
    border-color: #f44336;
}

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

.form-select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%232c3e50' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
    padding-right: 2.5rem;
    appearance: none;
}

.form-multiselect-checkbox-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding: 0.5rem 0;
}

.form-multiselect-checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 6px;
    transition: background-color 0.2s ease;
    user-select: none;
}

.form-multiselect-checkbox-label:hover {
    background-color: #f5f5f5;
}

.form-multiselect-checkbox-label input[type="checkbox"] {
    margin: 0;
    cursor: pointer;
}

.form-multiselect-checkbox-label span {
    font-size: 1rem;
    color: #2c3e50;
    flex: 1;
}

.form-multiselect-checkbox-label:has(input:checked) {
    background-color: rgba(0, 102, 204, 0.1);
}

.form-multiselect-checkbox-label:has(input:checked) span {
    color: var(--accent-color, #0066cc);
    font-weight: 500;
}

/* Tablet Mode */
body.tablet-mode .tile-detail-header {
    padding: 2rem;
    gap: 1.5rem;
}

body.tablet-mode .tile-detail-icon {
    width: 60px;
    height: 60px;
    font-size: 2.5rem;
}

body.tablet-mode .tile-detail-title {
    font-size: 2rem;
}

body.tablet-mode .tile-detail-subtitle {
    font-size: 1.25rem;
}

body.tablet-mode .tile-detail-form {
    padding: 0;
    max-height: none;
    overflow-y: visible;
}

body.tablet-mode .form-section-title {
    font-size: 1.75rem;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
}

body.tablet-mode .form-fields {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
}

body.tablet-mode .form-field-full-width {
    grid-column: 1 / -1; /* Span full width */
}

body.tablet-mode .form-field label {
    font-size: 1.5rem;
}

body.tablet-mode .form-input,
body.tablet-mode .form-textarea,
body.tablet-mode .form-select {
    padding: 1.25rem;
    font-size: 1.5rem;
    border-radius: 12px;
}

body.tablet-mode .form-textarea {
    min-height: 150px;
}

body.tablet-mode .form-multiselect-checkbox-group {
    gap: 1rem;
}

body.tablet-mode .form-multiselect-checkbox-label {
    padding: 1rem;
    border-radius: 8px;
}

body.tablet-mode .form-multiselect-checkbox-label span {
    font-size: 1.5rem;
}

/* Samples Table Styles */
.samples-table-container {
    margin-top: 1rem;
}

.samples-table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: #ffffff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.samples-table thead {
    background-color: #f5f5f5;
}

.samples-table th {
    padding: 0.75rem 1rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #e0e0e0;
    font-size: 0.9rem;
}

.samples-table td {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e0e0e0;
}

.samples-table tbody tr:last-child td {
    border-bottom: none;
}

.samples-table tbody tr:hover {
    background-color: #f9f9f9;
}

.form-input-sm,
.form-select-sm {
    width: 100%;
    padding: 0.5rem;
    font-size: 0.9rem;
    border: 2px solid #d0d0d0;
    border-radius: 6px;
    font-family: inherit;
}

.form-input-sm:focus,
.form-select-sm:focus {
    outline: none;
    border-color: #999999;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
}

.btn-add-sample {
    padding: 0.5rem 1rem;
    background-color: var(--accent-color, #0066cc);
    color: #ffffff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background-color 0.2s ease;
}

.btn-add-sample:hover {
    background-color: var(--accent-color-dark, #0052a3);
}

.btn-remove-sample {
    padding: 0.25rem 0.5rem;
    background-color: #f44336;
    color: #ffffff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    transition: background-color 0.2s ease;
}

.btn-remove-sample:hover {
    background-color: #d32f2f;
}

/* Tablet Mode for Samples Table */
body.tablet-mode .samples-table th,
body.tablet-mode .samples-table td {
    padding: 1rem 1.5rem;
    font-size: 1.5rem;
}

body.tablet-mode .form-input-sm,
body.tablet-mode .form-select-sm {
    padding: 1rem;
    font-size: 1.5rem;
    border-width: 3px;
    border-radius: 8px;
}

body.tablet-mode .btn-add-sample {
    padding: 1rem 1.5rem;
    font-size: 1.5rem;
    border-radius: 8px;
}

body.tablet-mode .btn-remove-sample {
    padding: 0.75rem 1rem;
    font-size: 1.25rem;
    border-radius: 6px;
}

/* Scrollbar for form */
.tile-detail-form::-webkit-scrollbar {
    width: 8px;
}

.tile-detail-form::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.tile-detail-form::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.tile-detail-form::-webkit-scrollbar-thumb:hover {
    background: #555;
}

