/* ============================================
   FORMS PAGE - Modern Soft Redesign
   Glassmorphism · Smooth Animations · Dark/Light
   ============================================ */

/* =============================================
   PAGE HEADER
   ============================================= */

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    padding: 24px 28px;
    background: var(--card-bg);
    border-radius: 16px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow);
    flex-wrap: wrap;
    gap: 16px;
}

.header-content h1 {
    margin-bottom: 4px;
    color: var(--text-color);
    font-size: 1.5em;
    font-weight: 700;
    letter-spacing: -0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
}

.subtitle {
    color: var(--text-light);
    font-size: 0.88em;
    margin: 0;
    font-weight: 400;
}

.btn-create-form {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 22px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88em;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.2);
    transition: all 0.25s ease;
}

.btn-create-form:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 14px rgba(74, 144, 226, 0.3);
    text-decoration: none;
    color: white;
    filter: brightness(1.05);
}

.btn-create-form:active {
    transform: translateY(0);
}

/* =============================================
   TABS
   ============================================= */

.forms-tabs {
    display: flex;
    gap: 6px;
    margin-bottom: 20px;
    padding: 5px;
    background: var(--surface-alt);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.tab-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: transparent;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 0.85em;
    font-weight: 500;
    color: var(--text-light);
    transition: all 0.2s ease;
    position: relative;
}

.tab-btn:hover {
    color: var(--text-color);
    background: var(--hover-bg);
}

.tab-btn.active {
    color: var(--primary);
    background: var(--card-bg);
    font-weight: 600;
    box-shadow: 0 1px 4px var(--shadow);
}

.tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    background: var(--primary);
    color: white;
    border-radius: 10px;
    font-size: 0.75em;
    font-weight: 700;
}

.tab-btn:not(.active) .tab-count {
    background: var(--border-color);
    color: var(--text-light);
}

/* =============================================
   CONTROLS BAR
   ============================================= */

.controls-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding: 10px 14px;
    background: var(--card-bg);
    border-radius: 12px;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow);
    flex-wrap: wrap;
    gap: 12px;
}

.view-controls {
    display: flex;
    gap: 4px;
    padding: 3px;
    background: var(--surface-alt);
    border-radius: 8px;
}

.view-btn {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-light);
    transition: all 0.2s ease;
}

.view-btn:hover {
    background: var(--hover-bg);
    color: var(--text-color);
}

.view-btn.active {
    background: var(--primary);
    color: white;
    box-shadow: 0 1px 4px rgba(74, 144, 226, 0.25);
}

.search-controls {
    display: flex;
    align-items: center;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 11px;
    color: var(--text-muted);
    pointer-events: none;
}

.search-input-wrapper input {
    padding: 8px 32px 8px 34px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85em;
    background: var(--surface-alt);
    color: var(--text-color);
    min-width: 200px;
    transition: all 0.2s ease;
}

.search-input-wrapper input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(74, 144, 226, 0.08);
    background: var(--card-bg);
}

.search-input-wrapper input::placeholder {
    color: var(--text-muted);
}

.search-clear-btn {
    position: absolute;
    right: 6px;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--border-color);
    border: none;
    border-radius: 50%;
    font-size: 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.15s ease;
}

.search-clear-btn:hover {
    background: var(--text-muted);
    color: white;
}

.sort-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.sort-controls label {
    font-weight: 500;
    color: var(--text-light);
    font-size: 0.82em;
}

.sort-controls select {
    padding: 8px 32px 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.82em;
    background: var(--surface-alt);
    color: var(--text-color);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 12 12'%3E%3Cpath fill='%23777' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 200px;
    transition: all 0.2s ease;
}

.sort-controls select:focus {
    outline: none;
    border-color: var(--primary);
}

/* =============================================
   TAB CONTENT
   ============================================= */

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

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

/* =============================================
   FORMS CONTAINER
   ============================================= */

.forms-container {
    min-height: 200px;
}

/* =============================================
   GRID VIEW
   ============================================= */

.forms-container.grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
}

/* =============================================
   FORM CARD
   ============================================= */

.form-card {
    background: var(--card-bg);
    border-radius: 14px;
    overflow: visible;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow);
    position: relative;
    display: flex;
    flex-direction: column;
    height: fit-content;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
    border-color: rgba(74, 144, 226, 0.3);
}

.form-card.dropdown-active,
.form-card.dropdown-active:hover {
    transform: none !important;
    transition: none !important;
    z-index: 100;
}

/* Card Header */
.form-card-header {
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    position: relative;
    z-index: 1;
    border-bottom: 1px solid var(--border-color);
}

.form-card-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.form-card-title {
    font-size: 0.95em;
    font-weight: 650;
    color: var(--text-color);
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    max-width: 180px;
    cursor: help;
    margin: 0;
}

.form-status-badge {
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.7em;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
    letter-spacing: 0.02em;
}

.form-status-badge.active {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.form-status-badge.inactive {
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.15);
}

.form-card-header-right {
    position: relative;
    z-index: 100;
}

/* Three Dot Menu */
.three-dot-menu {
    position: static;
}

.three-dot-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: 1px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    font-size: 1.2em;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-weight: 700;
    position: relative;
    z-index: 1;
}

.three-dot-btn:hover {
    background: var(--surface-alt);
    border-color: var(--border-color);
    color: var(--text-color);
}

.three-dot-btn.dropdown-open {
    z-index: 1 !important;
    transform: none;
}

/* Dropdown Menu */
.dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
    min-width: 170px;
    max-width: 210px;
    z-index: 999999 !important;
    display: none;
    overflow: hidden;
}

.dropdown-menu.show {
    display: block;
    position: fixed;
    animation: dropdownIn 0.15s ease;
}

@keyframes dropdownIn {
    from { opacity: 0; transform: translateY(-4px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-size: 0.82em;
    font-weight: 500;
    color: var(--text-color);
    transition: all 0.15s ease;
}

.dropdown-item:hover {
    background: var(--hover-bg);
    color: var(--primary);
}

.dropdown-item.danger {
    color: var(--danger);
}

.dropdown-item.danger:hover {
    background: rgba(239, 68, 68, 0.06);
}

/* Card Body */
.form-card-body {
    padding: 16px;
    flex: 1;
}

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

.form-stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 14px 10px;
    background: var(--surface-alt);
    border-radius: 10px;
    flex: 1;
    border: 1px solid var(--border-light);
    transition: all 0.2s ease;
}

.form-stat:hover {
    background: var(--hover-bg);
    border-color: var(--border-color);
}

.form-stat-clickable {
    cursor: pointer;
    position: relative;
}

.form-stat-clickable::after {
    content: '';
    position: absolute;
    top: 5px;
    right: 5px;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    opacity: 0;
    transition: opacity 0.2s ease;
}

.form-stat-clickable:hover::after {
    opacity: 1;
}

.form-stat-clickable:hover {
    background: rgba(74, 144, 226, 0.06);
    border-color: rgba(74, 144, 226, 0.15);
}

.question-count-link {
    color: var(--primary);
    font-weight: 700;
    cursor: pointer;
    padding: 4px 10px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.question-count-link:hover {
    background: rgba(74, 144, 226, 0.1);
}

.form-stat-value {
    font-weight: 700;
    font-size: 1.6em;
    color: var(--stat-value);
    line-height: 1;
}

.form-stat-label {
    font-size: 0.7em;
    color: var(--stat-label);
    font-weight: 600;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-meta-info {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.75em;
    color: var(--text-muted);
}

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

/* =============================================
   LIST VIEW
   ============================================= */

.forms-container.list-view {
    display: flex;
    flex-direction: column;
    background: var(--card-bg);
    border-radius: 14px;
    overflow: visible;
    border: 1px solid var(--border-color);
    box-shadow: 0 1px 3px var(--shadow);
}

.list-view-header {
    display: grid;
    grid-template-columns: 1fr 90px 70px 70px 100px 120px 50px;
    padding: 10px 18px;
    background: var(--surface-alt);
    border-bottom: 1px solid var(--border-color);
    font-weight: 600;
    font-size: 0.68em;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    gap: 12px;
    align-items: center;
}

.list-header-cell {
    display: flex;
    align-items: center;
    justify-content: center;
}

.list-header-cell:first-child {
    justify-content: flex-start;
}

.list-row {
    display: grid;
    grid-template-columns: 1fr 90px 70px 70px 100px 120px 50px;
    padding: 11px 18px;
    gap: 12px;
    align-items: center;
    border-bottom: 1px solid var(--border-light);
    background: var(--card-bg);
    transition: all 0.15s ease;
    position: relative;
    cursor: pointer;
}

.list-row:last-child {
    border-bottom: none;
}

.list-row:hover {
    background: var(--hover-bg);
}

.list-row.dropdown-active {
    background: var(--hover-bg);
}

.list-cell {
    display: flex;
    align-items: center;
}

.list-cell-title {
    font-weight: 550;
    color: var(--text-color);
    font-size: 0.88em;
    cursor: pointer;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.list-cell-title:hover {
    color: var(--primary);
}

.list-cell-status {
    justify-content: center;
}

.list-cell-center {
    justify-content: center;
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.88em;
}

.list-cell-creator {
    justify-content: center;
    font-size: 0.8em;
    color: var(--text-light);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-cell-date {
    justify-content: center;
    font-size: 0.75em;
    color: var(--text-muted);
}

.list-cell-actions {
    justify-content: center;
    position: relative;
}

.list-row .form-status-badge {
    padding: 3px 8px;
    font-size: 0.65em;
}

.list-cell-actions .three-dot-menu {
    position: static;
}

.list-cell-actions .three-dot-btn {
    width: 30px;
    height: 30px;
    font-size: 1.1em;
    position: relative;
    z-index: 1;
}

.list-cell-actions .three-dot-btn.dropdown-open {
    z-index: 1 !important;
}

.list-row.deleted {
    opacity: 0.7;
}

.list-row.deleted:hover {
    opacity: 0.9;
}

/* =============================================
   DELETED FORMS TAB
   ============================================= */

.deleted-forms-header {
    padding: 16px 20px;
    background: rgba(245, 158, 11, 0.06);
    border: 1px solid rgba(245, 158, 11, 0.2);
    border-radius: 12px;
    margin-bottom: 20px;
}

.deleted-info {
    margin: 0 0 12px 0;
    color: var(--warning);
    font-weight: 500;
    font-size: 0.85em;
    display: flex;
    align-items: center;
    gap: 6px;
}

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

/* Buttons */
.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--surface-alt);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 550;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-secondary:hover {
    background: var(--hover-bg);
    border-color: var(--text-muted);
}

.btn-danger {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: rgba(239, 68, 68, 0.08);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 8px;
    font-weight: 550;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.14);
    border-color: rgba(239, 68, 68, 0.35);
}

.form-card.deleted {
    opacity: 0.75;
}

.form-card.deleted:hover {
    opacity: 0.9;
}

.deletion-info {
    padding: 10px 16px;
    background: rgba(245, 158, 11, 0.06);
    border-bottom: 1px solid rgba(245, 158, 11, 0.15);
    font-size: 0.78em;
    color: var(--warning);
    font-weight: 500;
    border-radius: 14px 14px 0 0;
}

.deletion-info div {
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.deletion-info div:last-child {
    margin-bottom: 0;
}

.days-remaining {
    font-weight: 700;
    color: var(--danger);
}

/* =============================================
   EMPTY & LOADING STATES
   ============================================= */

.empty-forms-state {
    text-align: center;
    padding: 60px 24px;
    background: var(--card-bg);
    border-radius: 14px;
    border: 1px solid var(--border-color);
}

.empty-forms-state h3 {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--text-color);
    margin-bottom: 6px;
}

.empty-forms-state p {
    font-size: 0.88em;
    color: var(--text-light);
    margin-bottom: 20px;
}

.empty-icon {
    margin-bottom: 16px;
    opacity: 0.4;
    color: var(--text-muted);
}

.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    color: var(--text-light);
    background: var(--card-bg);
    border-radius: 14px;
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--border-color);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 14px;
}

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

.error-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 50px 20px;
    background: var(--card-bg);
    border-radius: 14px;
    text-align: center;
}

.error-icon {
    font-size: 3em;
    margin-bottom: 12px;
    opacity: 0.5;
}

.error-message {
    font-size: 0.95em;
    color: var(--danger);
    font-weight: 600;
    margin-bottom: 16px;
}

.btn-retry {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 18px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-retry:hover {
    filter: brightness(1.05);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
}

/* =============================================
   MODALS
   ============================================= */

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--modal-overlay);
    z-index: 10000;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.modal-content {
    background: var(--modal-bg);
    padding: 24px;
    border-radius: 16px;
    max-width: 460px;
    width: 92%;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
    position: relative;
    border: 1px solid var(--border-color);
    animation: modalIn 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-content h3 {
    margin-bottom: 12px;
    color: var(--text-color);
    font-size: 1.1em;
    font-weight: 650;
}

.modal-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
    justify-content: flex-end;
}

.close {
    position: absolute;
    top: 14px;
    right: 18px;
    font-size: 22px;
    cursor: pointer;
    color: var(--text-muted);
    transition: all 0.15s ease;
    line-height: 1;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.close:hover {
    color: var(--text-color);
    background: var(--hover-bg);
}

.delete-note {
    color: var(--text-light);
    font-size: 0.82em;
    margin-top: 8px;
}

.permanent-delete-warning {
    padding: 12px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: 10px;
    color: var(--danger);
    font-weight: 600;
    font-size: 0.85em;
    margin-top: 12px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

.btn-danger-permanent {
    background: var(--danger);
    color: white;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-weight: 650;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-danger-permanent:hover {
    filter: brightness(1.08);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.25);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85em;
    cursor: pointer;
    text-decoration: none;
    transition: all 0.2s ease;
}

.btn-primary:hover {
    filter: brightness(1.05);
    box-shadow: 0 2px 8px rgba(74, 144, 226, 0.25);
    color: white;
    text-decoration: none;
}

/* Generic Confirm Modal */
.modal-confirm-generic {
    max-width: 380px !important;
    text-align: center;
    padding: 28px !important;
}

.confirm-icon-generic {
    margin-bottom: 10px;
}

.modal-confirm-generic h3 {
    margin: 0 0 8px 0;
    font-size: 1.15em;
}

.modal-confirm-generic p {
    color: var(--text-light);
    margin: 0 0 6px 0;
    font-size: 0.88em;
    line-height: 1.5;
}

.confirm-note-generic {
    padding: 10px;
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.15);
    border-radius: 8px;
    color: var(--danger);
    font-weight: 600;
    font-size: 0.82em !important;
    margin-top: 8px !important;
}

.modal-confirm-generic .modal-actions {
    justify-content: center;
    margin-top: 16px;
}

.btn-warning {
    background: var(--warning);
    color: white;
    padding: 10px 22px;
    border: none;
    border-radius: 8px;
    font-weight: 650;
    font-size: 0.85em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-warning:hover {
    filter: brightness(1.08);
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.25);
}

/* =============================================
   FORM VIEW MODAL
   ============================================= */

.modal-large {
    max-width: 640px;
    max-height: 85vh;
    overflow-y: auto;
}

.form-view-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
    padding-right: 32px;
}

.form-view-header h3 {
    margin: 0;
    flex: 1;
}

.form-view-description {
    color: var(--text-light);
    margin-bottom: 16px;
    font-size: 0.88em;
}

.form-view-fields-container {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form-view-field {
    background: var(--surface-alt);
    padding: 16px;
    border-radius: 12px;
    border: 1px solid var(--border-light);
    transition: border-color 0.2s ease;
}

.form-view-field:hover {
    border-color: var(--border-color);
}

.form-view-field-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.form-view-field-number {
    width: 26px;
    height: 26px;
    background: var(--primary);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.78em;
    flex-shrink: 0;
}

.form-view-field-label {
    font-weight: 600;
    color: var(--text-color);
    font-size: 0.92em;
    flex: 1;
}

.form-view-field-required {
    color: var(--danger);
    font-weight: 600;
    font-size: 0.78em;
}

.form-view-field-type {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(74, 144, 226, 0.08);
    color: var(--primary);
    padding: 3px 10px;
    border-radius: 6px;
    font-size: 0.72em;
    font-weight: 600;
    margin-bottom: 12px;
}

.form-view-field-preview {
    margin-top: 8px;
}

.form-view-stars {
    display: flex;
    gap: 6px;
    font-size: 1.5em;
}

.form-view-star {
    color: var(--border-color);
    transition: color 0.15s;
}

.form-view-star.active {
    color: var(--warning);
}

.form-view-map {
    width: 100%;
    height: 120px;
    background: rgba(34, 197, 94, 0.05);
    border-radius: 8px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    color: var(--success);
    border: 1px dashed rgba(34, 197, 94, 0.3);
    font-size: 0.85em;
}

.form-view-map-icon {
    font-size: 2em;
}

.form-view-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: var(--card-bg);
    font-size: 0.85em;
    color: var(--text-muted);
}

.form-view-textarea {
    min-height: 70px;
    resize: none;
}

.form-view-options {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-view-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 0.85em;
    color: var(--text-color);
    transition: border-color 0.15s ease;
}

.form-view-option:hover {
    border-color: var(--primary);
}

.form-view-option input {
    margin: 0;
}

.form-view-phone {
    display: flex;
    gap: 8px;
}

.form-view-phone-country {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 12px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85em;
}

.form-view-phone-input {
    flex: 1;
}

/* =============================================
   ANIMATIONS
   ============================================= */

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

/* =============================================
   RESPONSIVE - 1200px
   ============================================= */

@media (max-width: 1200px) {
    .forms-container.grid-view {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }

    .list-view-header,
    .list-row {
        grid-template-columns: 1fr 85px 60px 60px 90px 100px 45px;
        gap: 10px;
        padding: 10px 15px;
    }
}

@media (max-width: 992px) {
    .list-view-header,
    .list-row {
        grid-template-columns: 1fr 80px 60px 60px 100px 45px;
        gap: 8px;
        padding: 10px 12px;
    }

    .list-header-cell:nth-child(5),
    .list-cell:nth-child(5) {
        display: none;
    }
}

/* =============================================
   RESPONSIVE - 768px (Tablet/Mobile)
   ============================================= */

@media (max-width: 768px) {
    .page-header {
        flex-direction: column;
        align-items: stretch;
        padding: 18px 16px;
        gap: 12px;
        border-radius: 12px;
        margin-bottom: 16px;
    }

    .header-content h1 {
        font-size: 1.2em;
    }

    .subtitle {
        font-size: 0.8em;
    }

    .btn-create-form {
        padding: 10px 18px;
        font-size: 0.82em;
        justify-content: center;
    }

    /* Tabs */
    .forms-tabs {
        gap: 4px;
        padding: 4px;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        border-radius: 10px;
        margin-bottom: 14px;
    }

    .forms-tabs::-webkit-scrollbar {
        display: none;
    }

    .tab-btn {
        padding: 8px 12px;
        font-size: 0.78em;
        gap: 6px;
        white-space: nowrap;
        flex-shrink: 0;
        border-radius: 7px;
    }

    .tab-icon {
        display: none;
    }

    .tab-count {
        min-width: 18px;
        height: 18px;
        font-size: 0.7em;
    }

    /* Controls */
    .controls-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 10px;
        gap: 8px;
        border-radius: 10px;
        margin-bottom: 14px;
    }

    .view-controls {
        display: none;
    }

    .search-controls,
    .search-input-wrapper {
        width: 100%;
    }

    .search-input-wrapper input {
        min-width: unset;
        width: 100%;
        font-size: 0.82em;
    }

    .sort-controls {
        width: 100%;
    }

    .sort-controls select {
        min-width: unset;
        flex: 1;
        font-size: 0.78em;
    }

    /* Grid */
    .forms-container.grid-view {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .form-card {
        border-radius: 12px;
    }

    .form-card:hover {
        transform: none;
    }

    .form-card-header {
        padding: 12px 14px;
    }

    .form-card-title {
        font-size: 0.9em;
        max-width: 200px;
    }

    .form-card-body {
        padding: 14px;
    }

    .form-stats {
        gap: 8px;
    }

    .form-stat {
        padding: 12px 8px;
        border-radius: 8px;
    }

    .form-stat-value {
        font-size: 1.35em;
    }

    .form-stat-label {
        font-size: 0.65em;
    }

    .form-meta-info {
        font-size: 0.72em;
    }

    /* List View */
    .list-view-header,
    .list-row {
        grid-template-columns: 1fr 75px 44px;
        padding: 9px 12px;
    }

    .list-view-header {
        font-size: 0.65em;
    }

    .list-cell-title {
        font-size: 0.82em;
    }

    .list-row .form-status-badge {
        padding: 2px 7px;
        font-size: 0.6em;
    }

    .list-header-cell:nth-child(3),
    .list-header-cell:nth-child(4),
    .list-header-cell:nth-child(5),
    .list-header-cell:nth-child(6),
    .list-cell:nth-child(3),
    .list-cell:nth-child(4),
    .list-cell:nth-child(5),
    .list-cell:nth-child(6) {
        display: none;
    }

    /* Deleted */
    .deleted-forms-header {
        padding: 12px 14px;
        border-radius: 10px;
        margin-bottom: 14px;
    }

    .deleted-info {
        font-size: 0.78em;
    }

    .deleted-actions {
        flex-direction: column;
        gap: 8px;
    }

    .btn-secondary,
    .btn-danger {
        width: 100%;
        justify-content: center;
    }

    /* Empty/Loading */
    .empty-forms-state {
        padding: 40px 16px;
        border-radius: 12px;
    }

    .empty-forms-state h3 {
        font-size: 1em;
    }

    .loading-container {
        padding: 36px 16px;
    }

    /* Modals */
    .modal-content {
        padding: 18px;
        border-radius: 14px;
        width: 94%;
    }

    .modal-large {
        width: 96%;
        max-height: 90vh;
    }

    .close {
        top: 12px;
        right: 14px;
    }

    /* Form View */
    .form-view-field {
        padding: 12px;
        border-radius: 10px;
    }

    .form-view-field-label {
        font-size: 0.85em;
    }

    .form-view-input {
        padding: 9px 10px;
        font-size: 0.82em;
    }

    .form-view-option {
        padding: 8px 10px;
        font-size: 0.8em;
    }

    .form-view-stars {
        font-size: 1.3em;
    }

    .dropdown-menu {
        min-width: 155px;
    }

    .dropdown-item {
        padding: 9px 12px;
        font-size: 0.78em;
    }
}

/* =============================================
   RESPONSIVE - 480px (Small Mobile)
   ============================================= */

@media (max-width: 480px) {
    .page-header {
        padding: 14px 12px;
    }

    .header-content h1 {
        font-size: 1.05em;
    }

    .subtitle {
        font-size: 0.75em;
    }

    .tab-btn {
        padding: 7px 9px;
        font-size: 0.7em;
    }

    .form-card-header {
        padding: 10px 12px;
    }

    .form-card-title {
        font-size: 0.85em;
        max-width: 150px;
    }

    .three-dot-btn {
        width: 28px;
        height: 28px;
    }

    .form-card-body {
        padding: 12px 10px;
    }

    .form-stat {
        padding: 10px 6px;
    }

    .form-stat-value {
        font-size: 1.15em;
    }

    .form-stat-label {
        font-size: 0.6em;
    }

    .modal-content {
        padding: 14px;
    }

    .btn-primary,
    .btn-danger,
    .btn-secondary,
    .btn-danger-permanent,
    .btn-warning {
        padding: 9px 16px;
        font-size: 0.8em;
    }

    .form-view-field {
        padding: 10px;
    }

    .form-view-phone {
        flex-direction: column;
    }

    .btn-primary, .btn-danger, .btn-secondary, .btn-danger-permanent, .btn-warning { min-height: 40px; }
    .form-view-input, .form-view-textarea { font-size: 16px; }
}

@media (max-width: 360px) {
    .header-content h1 { font-size: 0.95em; }
    .tab-btn { padding: 6px 8px; font-size: 0.65em; }
    .form-card-title { font-size: 0.8em; max-width: 120px; }
    .form-stat-value { font-size: 1em; }
    .modal-content { padding: 12px; }
    .form-view-field { padding: 8px; }
    .btn-primary, .btn-danger, .btn-secondary { padding: 8px 12px; font-size: 0.75em; }
}
