@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #EC4899;
    --bg-color: #F3F4F6;
    --card-bg: rgba(255, 255, 255, 0.9);
    --text-main: #1F2937;
    --text-muted: #6B7280;
    --border-color: #E5E7EB;
    --success: #10B981;
    --danger: #EF4444;
    --info: #3B82F6;
    --nav-bg: #111827;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #EEF2FF 0%, #FCE7F3 100%);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.5;
}

/* Navbar */
.navbar {
    background: var(--nav-bg);
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.navbar h1 {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(to right, #818CF8, #F472B6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    margin: 0;
}

.navbar a {
    color: #D1D5DB;
    text-decoration: none;
    margin-left: 1.5rem;
    font-weight: 500;
    transition: color 0.3s;
}

.navbar a:hover {
    color: white;
}

.navbar .btn {
    margin-left: 1.5rem;
    color: white;
}

/* Container */
.container {
    max-width: 1200px;
    margin: 2rem auto;
    padding: 2rem;
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    border-radius: 16px;
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.05), 0 8px 10px -6px rgba(0, 0, 0, 0.01);
    border: 1px solid rgba(255, 255, 255, 0.5);
}

.container-sm {
    max-width: 600px;
}

/* Typography */
h2, h3 {
    color: var(--text-main);
    margin-bottom: 1.5rem;
    font-weight: 600;
}

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

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--text-main);
    font-size: 0.9rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="tel"],
input[type="file"],
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background: white;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(79, 70, 229, 0.1);
}

.note {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 0.25rem;
}

/* Buttons */
.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.2s ease;
    text-align: center;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, #6366F1 100%);
    color: white;
    box-shadow: 0 4px 6px -1px rgba(79, 70, 229, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary) 100%);
    box-shadow: 0 6px 8px -1px rgba(79, 70, 229, 0.4);
    transform: translateY(-1px);
}

.btn-success {
    background: var(--success);
    color: white;
}
.btn-success:hover { background: #059669; }

.btn-danger {
    background: var(--danger);
    color: white;
}
.btn-danger:hover { background: #DC2626; }

.btn-info {
    background: var(--info);
    color: white;
}
.btn-info:hover { background: #2563EB; }

.btn-warning {
    background: #F59E0B;
    color: white;
}
.btn-warning:hover { background: #D97706; }

.btn-sm {
    padding: 0.4rem 0.8rem;
    font-size: 0.875rem;
    border-radius: 6px;
    margin-right: 0.25rem;
    margin-bottom: 0.25rem;
}

/* Tables */
table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    margin-top: 1rem;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

th {
    background: #F9FAFB;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.05em;
}

tr:last-child td {
    border-bottom: none;
}

tbody tr {
    transition: background-color 0.2s;
}

tbody tr:hover {
    background-color: #F9FAFB;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-weight: 500;
}
.alert-error, .error {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #F87171;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}
.alert-success, .success {
    background: #ECFDF5;
    color: #065F46;
    border: 1px solid #34D399;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.pagination a {
    padding: 0.5rem 1rem;
    border: 1px solid var(--border-color);
    text-decoration: none;
    color: var(--text-main);
    border-radius: 6px;
    transition: all 0.2s;
}
.pagination a.active, .pagination a:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* Misc Utilities */
hr {
    border: 0;
    height: 1px;
    background: var(--border-color);
    margin: 2rem 0;
}

/* Specific Component Styles */

/* View Form */
.share-link, .payment-instruction {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    word-break: break-all;
    border: 1px solid var(--border-color);
}
.field-list {
    list-style: none;
}
.field-item {
    padding: 15px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.field-item:last-child {
    border-bottom: none;
}

/* Create / Edit Form */
.field-container {
    border: 1px solid var(--border-color);
    padding: 15px;
    margin-bottom: 15px;
    border-radius: 8px;
    background: #f8f9fa;
}
.field-row {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}
.field-row select, .field-row input {
    flex: 1;
}

/* Public Share Form Specifics */
.required-asterisk {
    color: var(--danger);
    margin-left: 4px;
    font-weight: 700;
}
input[type="file"]::file-selector-button {
    padding: 8px 16px;
    margin-right: 16px;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.875rem;
    font-weight: 600;
    transition: all 0.2s;
}
input[type="file"]::file-selector-button:hover {
    background: var(--primary-hover);
}
.required-notice {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    text-align: center;
}
.required-notice span {
    color: var(--danger);
    font-weight: 600;
}
.loading {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255,255,255,0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
.submitting button {
    position: relative;
    pointer-events: none;
}
.submitting button .button-text {
    visibility: hidden;
}
.submitting button .loading {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

