@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #ff6b35;
    --primary-dark: #e55a2b;
    --primary-light: #ff8c42;
    --secondary-color: #2c3e50;
    --accent-color: #3498db;
    --success-color: #27ae60;
    --warning-color: #f39c12;
    --error-color: #e74c3c;
    --text-primary: #2c3e50;
    --text-secondary: #7f8c8d;
    --bg-primary: #ffffff;
    --bg-secondary: #f8f9fa;
    --bg-tertiary: #ecf0f1;
    --border-color: #e1e5e9;
    --shadow-light: 0 2px 10px rgba(0, 0, 0, 0.08);
    --shadow-medium: 0 8px 30px rgba(0, 0, 0, 0.12);
    --shadow-heavy: 0 20px 60px rgba(0, 0, 0, 0.15);
    --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-light) 100%);
    --gradient-secondary: linear-gradient(135deg, var(--secondary-color) 0%, #34495e 100%);
    --border-radius: 16px;
    --border-radius-small: 8px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(-45deg, #667eea, #764ba2, #667eea, #764ba2);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
    min-height: 100vh;
    color: var(--text-primary);
    line-height: 1.6;
    overflow-x: hidden;
}

@keyframes gradientShift {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Custom scrollbar */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    transition: var(--transition);
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.5);
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    position: relative;
}

/* Animated background particles */
.container::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: 
        radial-gradient(circle at 20% 80%, rgba(120, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 80% 20%, rgba(255, 119, 198, 0.3) 0%, transparent 50%),
        radial-gradient(circle at 40% 40%, rgba(120, 219, 255, 0.3) 0%, transparent 50%);
    pointer-events: none;
    z-index: -1;
    animation: float 20s ease-in-out infinite;
}

@keyframes float {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    33% { transform: translateY(-20px) rotate(1deg); }
    66% { transform: translateY(10px) rotate(-1deg); }
}

header {
    text-align: center;
    margin-bottom: 60px;
    color: white;
    position: relative;
    z-index: 1;
}

header h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(2rem, 4vw, 3rem);
    margin-bottom: 15px;
    color: white;
    text-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-weight: 700;
    letter-spacing: -0.02em;
    animation: slideInDown 1s ease-out;
}

header p {
    font-size: 1.1rem;
    opacity: 0.9;
    color: rgba(255, 255, 255, 0.9);
    font-weight: 300;
    animation: slideInUp 1s ease-out 0.2s both;
}

@keyframes slideInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slideInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Setup Button Container */
.setup-button-container {
    text-align: center;
    margin-bottom: 60px;
    animation: fadeIn 1s ease-out 0.4s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    animation: modalFadeIn 0.3s ease-out;
}

.modal-content {
    background: var(--bg-primary);
    margin: 5% auto;
    padding: 0;
    border-radius: var(--border-radius);
    width: 90%;
    max-width: 600px;
    box-shadow: var(--shadow-heavy);
    animation: modalSlideIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border: 1px solid rgba(255, 255, 255, 0.2);
    position: relative;
    overflow: hidden;
}

.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    z-index: 1;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes modalSlideIn {
    from {
        opacity: 0;
        transform: translateY(-60px) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.modal-header {
    background: var(--gradient-primary);
    color: white;
    padding: 30px 40px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: relative;
    overflow: hidden;
}

.modal-header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

.modal-header::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="1" fill="white" opacity="0.1"/><circle cx="75" cy="75" r="1" fill="white" opacity="0.1"/><circle cx="50" cy="10" r="0.5" fill="white" opacity="0.1"/><circle cx="10" cy="60" r="0.5" fill="white" opacity="0.1"/><circle cx="90" cy="40" r="0.5" fill="white" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.3;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.modal-header h2 {
    margin: 0;
    font-family: 'Playfair Display', serif;
    font-size: 2rem;
    font-weight: 600;
    position: relative;
    z-index: 1;
    letter-spacing: -0.01em;
}

.modal-close {
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    padding: 12px;
    border-radius: 50%;
    transition: var(--transition);
    position: relative;
    z-index: 1;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 300;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.modal-close:hover {
    background: rgba(255, 255, 255, 0.25);
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-body {
    padding: 40px;
    background: var(--bg-primary);
}

.welcome-message {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, rgba(255, 107, 53, 0.05) 0%, rgba(255, 140, 66, 0.05) 100%);
    border-radius: var(--border-radius-small);
    border: 1px solid rgba(255, 107, 53, 0.1);
    animation: welcomeFadeIn 0.8s ease-out 0.3s both;
}

.welcome-message h3 {
    font-family: 'Playfair Display', serif;
    font-size: 1.4rem;
    color: var(--primary-color);
    margin-bottom: 10px;
    font-weight: 600;
    overflow: hidden;
    border-right: 2px solid var(--primary-color);
    white-space: nowrap;
    animation: typing 3s steps(40, end), blink-caret 0.75s step-end infinite;
    margin: 0 auto;
    max-width: fit-content;
}

.welcome-message p {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.5;
    margin: 10px 0 0 0;
    opacity: 0;
    animation: fadeInText 0.5s ease-in 3s forwards;
}

@keyframes welcomeFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes typing {
    from {
        width: 0;
    }
    to {
        width: 100%;
    }
}

@keyframes blink-caret {
    from, to {
        border-color: transparent;
    }
    50% {
        border-color: var(--primary-color);
    }
}

@keyframes fadeInText {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.modal-footer {
    padding: 30px 40px;
    border-top: 1px solid var(--border-color);
    text-align: right;
    background: var(--bg-secondary);
    border-radius: 0 0 var(--border-radius) var(--border-radius);
    position: relative;
}

.modal-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--border-color), transparent);
}

.form-group {
    margin-bottom: 35px;
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--text-primary);
    font-size: 0.95rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
}

.form-group label::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--gradient-primary);
    border-radius: 1px;
}

.form-group input {
    width: 100%;
    padding: 20px 25px;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-small);
    font-size: 16px;
    transition: var(--transition);
    background: var(--bg-primary);
    box-shadow: var(--shadow-light);
    font-family: 'Inter', sans-serif;
    position: relative;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    background: var(--bg-primary);
    box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1), var(--shadow-medium);
    transform: translateY(-2px);
}

.form-group input:hover {
    border-color: var(--primary-light);
    box-shadow: var(--shadow-medium);
}

/* Buttons */
.btn {
    padding: 14px 28px;
    border: none;
    border-radius: var(--border-radius-small);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-family: 'Inter', sans-serif;
    gap: 8px;
    min-height: 48px;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s ease;
}

.btn:hover::before {
    left: 100%;
}

.btn:active {
    transform: scale(0.98);
}

.btn-primary {
    background: var(--gradient-primary);
    color: white;
    width: 100%;
    margin-top: 10px;
    box-shadow: var(--shadow-medium);
    position: relative;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-heavy);
}

.btn-primary:hover::after {
    opacity: 1;
}

.btn-secondary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-secondary:hover {
    background: var(--gradient-primary);
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-danger {
    background: linear-gradient(135deg, var(--error-color) 0%, #c0392b 100%);
    color: white;
    box-shadow: var(--shadow-medium);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.btn-danger:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
    transform: translateY(-2px);
    box-shadow: var(--shadow-heavy);
    border-color: rgba(255, 255, 255, 0.2);
}

/* Table Section */
.table-section {
    background: var(--bg-primary);
    border-radius: var(--border-radius);
    padding: 40px;
    box-shadow: var(--shadow-heavy);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
    animation: slideInUp 0.8s ease-out;
}

.table-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
}

.table-section::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="grain" width="100" height="100" patternUnits="userSpaceOnUse"><circle cx="25" cy="25" r="0.5" fill="%23f0f0f0" opacity="0.3"/><circle cx="75" cy="75" r="0.5" fill="%23f0f0f0" opacity="0.3"/><circle cx="50" cy="10" r="0.3" fill="%23f0f0f0" opacity="0.3"/><circle cx="10" cy="60" r="0.3" fill="%23f0f0f0" opacity="0.3"/><circle cx="90" cy="40" r="0.3" fill="%23f0f0f0" opacity="0.3"/></pattern></defs><rect width="100" height="100" fill="url(%23grain)"/></svg>');
    opacity: 0.5;
    pointer-events: none;
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 35px;
    flex-wrap: wrap;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.table-header h2 {
    color: var(--text-primary);
    margin: 0;
    font-weight: 700;
    font-size: 2rem;
    font-family: 'Playfair Display', serif;
    letter-spacing: -0.01em;
    position: relative;
}

.table-header h2::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 60px;
    height: 3px;
    background: var(--gradient-primary);
    border-radius: 2px;
}

.table-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Enhanced table container with horizontal scrolling */
.table-container {
    overflow-x: auto;
    border-radius: var(--border-radius-small);
    box-shadow: var(--shadow-medium);
    background: var(--bg-primary);
    position: relative;
    border: 1px solid var(--border-color);
    position: relative;
    z-index: 1;
}

.table-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: var(--border-radius-small);
    pointer-events: none;
}

/* Custom scrollbar styling - default/invisible */
.table-container::-webkit-scrollbar {
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: transparent;
}

.table-container::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

#distributionTable {
    width: 100%;
    min-width: 800px;
    border-collapse: collapse;
    background: white;
    font-size: 14px;
    table-layout: fixed;
}

#distributionTable th,
#distributionTable td {
    padding: 15px 20px;
    text-align: center;
    border: 1px solid #e1e5e9;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Column width specifications */
#distributionTable th:nth-child(1),
#distributionTable td:nth-child(1) {
    width: 180px;
    min-width: 180px;
}

#distributionTable th:nth-child(2),
#distributionTable td:nth-child(2) {
    width: 120px;
    min-width: 120px;
}

#distributionTable th:nth-child(3),
#distributionTable td:nth-child(3) {
    width: 120px;
    min-width: 120px;
}

#distributionTable th:nth-child(n+4),
#distributionTable td:nth-child(n+4) {
    width: 140px;
    min-width: 140px;
}

#distributionTable th {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333;
    font-weight: 700;
    position: sticky;
    top: 0;
    z-index: 10;
    border: 2px solid #ff6b35;
    border-bottom: 3px solid #ff6b35;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 13px;
}

#distributionTable th:first-child {
    border-top-left-radius: 15px;
}

#distributionTable th:last-child {
    border-top-right-radius: 15px;
}

#distributionTable tbody tr:nth-child(even) {
    background-color: #f8f9fa;
}

#distributionTable tbody tr:hover {
    background-color: #fff3e0;
    border-left: 4px solid #ff6b35;
    transform: scale(1.01);
    transition: all 0.2s ease;
}

#distributionTable tfoot tr {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333;
    font-weight: 700;
    border: 2px solid #ff6b35;
    border-top: 3px solid #ff6b35;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#distributionTable tfoot tr td:first-child {
    border-bottom-left-radius: 15px;
}

#distributionTable tfoot tr td:last-child {
    border-bottom-right-radius: 15px;
}

/* Input styling */
.editable-input {
    width: 100%;
    padding: 10px 15px;
    border: 2px solid transparent;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    background: transparent;
    transition: all 0.3s ease;
    font-family: inherit;
    font-weight: 500;
}

.editable-input:focus {
    outline: none;
    border-color: #ff6b35;
    background: white;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1);
}

.editable-input:hover {
    border-color: #ffb74d;
    background: rgba(255, 107, 53, 0.05);
}

/* Branch header input specific styling */
.branch-name-input {
    font-weight: 600;
    color: #333 !important;
    background: transparent !important;
    border: 1px solid rgba(255, 107, 53, 0.3) !important;
}

.branch-name-input::placeholder {
    color: rgba(51, 51, 51, 0.6);
}

.branch-name-input:focus {
    border-color: #ff6b35 !important;
    background: rgba(255, 107, 53, 0.05) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1) !important;
}

/* Validation Messages */
.validation-messages {
    margin-top: 25px;
}

.validation-info {
    padding: 20px;
    background: linear-gradient(135deg, #e3f2fd 0%, #bbdefb 100%);
    border: 1px solid #bbdefb;
    border-radius: 12px;
    color: #1565c0;
    margin-bottom: 15px;
    border-left: 5px solid #2196f3;
    box-shadow: 0 4px 15px rgba(33, 150, 243, 0.1);
}

.validation-errors {
    padding: 20px;
    background: linear-gradient(135deg, #ffebee 0%, #ffcdd2 100%);
    border: 1px solid #ffcdd2;
    border-radius: 12px;
    color: #c62828;
    border-left: 5px solid #f44336;
    box-shadow: 0 4px 15px rgba(244, 67, 54, 0.1);
}

.validation-info:empty,
.validation-errors:empty {
    display: none;
}

/* Highlight for validation errors - enhanced visibility */
.input-error {
    border-color: #dc3545 !important;
    background-color: #ffebee !important;
    box-shadow: 0 0 0 2px rgba(220, 53, 69, 0.3) !important;
    animation: errorPulse 1s ease-in-out;
}

.input-error:focus {
    border-color: #dc3545 !important;
    background-color: #ffebee !important;
    box-shadow: 0 0 0 4px rgba(220, 53, 69, 0.4) !important;
}

@keyframes errorPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

/* Success state for valid inputs */
.input-success {
    border-color: #4caf50 !important;
    background-color: #e8f5e8 !important;
}

/* Enhanced hover effects */
#distributionTable tbody tr:hover .editable-input {
    border-color: #ff6b35;
    background: rgba(255, 107, 53, 0.05);
}

/* Fixed sticky first column - improved implementation */
#distributionTable th:first-child,
#distributionTable td:first-child {
    position: sticky;
    left: 0;
    z-index: 5;
    background: white;
    box-shadow: 2px 0 5px rgba(0, 0, 0, 0.1);
}

#distributionTable th:first-child {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    z-index: 15;
}

#distributionTable tbody tr:nth-child(even) td:first-child {
    background: #f8f9fa;
}

#distributionTable tbody tr:hover td:first-child {
    background: #fff3e0;
}

#distributionTable tfoot tr td:first-child {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    color: #333;
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 15px;
    }
    
    header h1 {
        font-size: 2.2rem;
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
    }
    
    .table-actions {
        justify-content: center;
    }
    
    .btn {
        padding: 12px 24px;
        font-size: 14px;
    }
    
    #distributionTable {
        font-size: 12px;
        min-width: 600px;
    }
    
    #distributionTable th,
    #distributionTable td {
        padding: 10px 15px;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-body {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .table-section {
        padding: 25px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    .form-group input {
        padding: 15px 20px;
    }
    
    #distributionTable {
        min-width: 500px;
    }
    
    .modal-body {
        padding: 20px;
    }
    
    .modal-header,
    .modal-footer {
        padding: 20px 25px;
    }
}

/* Enhanced animations and effects */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.05);
    }
}

@keyframes glow {
    0%, 100% {
        box-shadow: var(--shadow-medium);
    }
    50% {
        box-shadow: var(--shadow-medium), 0 0 20px rgba(255, 107, 53, 0.3);
    }
}

/* Loading animation for table generation */
.table-section.loading {
    animation: pulse 2s infinite;
}

/* Success animation */
.table-section.success {
    animation: glow 2s ease-in-out;
}

/* Floating animation for buttons */
.btn:hover {
    animation: float 3s ease-in-out infinite;
}

/* Enhanced table animations */
#distributionTable tbody tr {
    transition: var(--transition);
    animation: fadeInUp 0.6s ease-out;
}

#distributionTable tbody tr:nth-child(1) { animation-delay: 0.1s; }
#distributionTable tbody tr:nth-child(2) { animation-delay: 0.2s; }
#distributionTable tbody tr:nth-child(3) { animation-delay: 0.3s; }
#distributionTable tbody tr:nth-child(4) { animation-delay: 0.4s; }
#distributionTable tbody tr:nth-child(5) { animation-delay: 0.5s; }

/* Book-like page turn effect */
.table-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: var(--gradient-primary);
    transform-origin: left;
    animation: pageTurn 0.8s ease-out 0.3s both;
}

@keyframes pageTurn {
    from {
        transform: scaleX(0);
    }
    to {
        transform: scaleX(1);
    }
}

/* Enhanced validation messages */
.validation-messages {
    margin-top: 30px;
    animation: slideInUp 0.6s ease-out 0.8s both;
}

.validation-info, .validation-errors {
    border-radius: var(--border-radius-small);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    transition: var(--transition);
}

.validation-info:hover, .validation-errors:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-medium);
}

/* Responsive improvements */
@media (max-width: 768px) {
    .container {
        padding: 20px 15px;
    }
    
    .table-section {
        padding: 25px;
        margin: 0 -10px;
        border-radius: var(--border-radius-small);
    }
    
    .table-header {
        flex-direction: column;
        align-items: stretch;
        gap: 15px;
    }
    
    .table-actions {
        justify-content: center;
    }
    
    .btn {
        padding: 12px 20px;
        font-size: 13px;
        min-height: 44px;
    }
    
    header h1 {
        font-size: 1.8rem;
    }
    
    header p {
        font-size: 1rem;
    }
    
    .welcome-message h3 {
        font-size: 1.2rem;
    }
    
    .welcome-message p {
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .table-section {
        padding: 20px;
    }
    
    .modal-content {
        margin: 10% auto;
        width: 95%;
    }
    
    .modal-body {
        padding: 25px;
    }
    
    .modal-header, .modal-footer {
        padding: 20px 25px;
    }
    
    .form-group input {
        padding: 16px 20px;
    }
}

/* SweetAlert Customization */
.swal2-popup {
    border-radius: var(--border-radius) !important;
    font-family: 'Inter', sans-serif !important;
    box-shadow: var(--shadow-heavy) !important;
}

.swal2-title {
    font-family: 'Playfair Display', serif !important;
    color: var(--text-primary) !important;
}

.swal2-confirm {
    border-radius: var(--border-radius-small) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: var(--transition) !important;
}

.swal2-confirm:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-medium) !important;
}

.swal2-cancel {
    border-radius: var(--border-radius-small) !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.5px !important;
    transition: var(--transition) !important;
}

.swal2-cancel:hover {
    transform: translateY(-2px) !important;
    box-shadow: var(--shadow-medium) !important;
}

/* Welcome Modal SweetAlert Customization */
.welcome-title {
    font-family: 'Playfair Display', serif !important;
    font-size: 1.8rem !important;
    color: var(--primary-color) !important;
    font-weight: 600 !important;
    letter-spacing: -0.01em !important;
}

.welcome-content {
    font-family: 'Inter', sans-serif !important;
}

.welcome-content input:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1) !important;
    transform: translateY(-1px) !important;
}

.welcome-content input:hover {
    border-color: var(--primary-light) !important;
    box-shadow: var(--shadow-light) !important;
}

/* SweetAlert input styling */
.swal2-popup input[type="number"] {
    font-family: 'Inter', sans-serif !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.swal2-popup input[type="number"]:focus {
    outline: none !important;
    border-color: var(--primary-color) !important;
    box-shadow: 0 0 0 3px rgba(255, 107, 53, 0.1) !important;
    transform: translateY(-1px) !important;
}

.swal2-popup input[type="number"]:hover {
    border-color: var(--primary-light) !important;
    box-shadow: var(--shadow-light) !important;
}
