* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(270deg,
        #FF9933,
        #FFFFFF,
        #138808,
        #FFFFFF,
        #FF9933);
    background-size: 600% 600%;
    animation: smoothTricolor 20s ease-in-out infinite;
    min-height: 100vh;
    padding: 0;
    position: relative;
    overflow-x: hidden;
}

/* Smooth flowing tricolor animation */
@keyframes smoothTricolor {
    0% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
    100% {
        background-position: 0% 50%;
    }
}

/* Subtle Ashoka Chakra emblem in the background */
body::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, rgba(0, 0, 128, 0.03) 0%, transparent 70%);
    z-index: -1;
    opacity: 0.4;
}

.container {
    width: 100%;
    min-height: 100vh;
    background: rgba(255, 255, 255, 0.97);
    overflow: hidden;
    border: none;
    backdrop-filter: blur(8px);
    position: relative;
}

/* Smooth tricolor header gradient */
.form-header {
    background: linear-gradient(135deg, 
        #FF9933 0%, 
        #FFB366 25%, 
        #FFFFFF 50%, 
        #99FF99 75%, 
        #138808 100%);
    color: #000080;
    padding: 40px 20px;
    text-align: center;
    position: relative;
    border-bottom: 1px solid rgba(0, 0, 128, 0.1);
    overflow: hidden;
}

/* Animated Real Ashoka Chakra in Header */
.form-header::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80px;
    height: 80px;
    background-image: url('https://upload.wikimedia.org/wikipedia/commons/1/17/Ashoka_Chakra.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    animation: chakra-rotate 20s linear infinite; /* smooth rotation */
    opacity: 0.9;
    z-index: 1;
}

/* Smooth Chakra rotation */
@keyframes chakra-rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Ensure header content stays on top */
.form-header {
    position: relative;
    z-index: 2;
}


.form-header h1 {
    font-size: 1.8em;
    margin-bottom: 12px;
    color: #000080;
    font-weight: 700;
    text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8);
    position: relative;
    z-index: 2;
    letter-spacing: 0.3px;
    line-height: 1.3;
}

.form-header p {
    font-size: 1.1em;
    color: #000080;
    font-weight: 500;
    opacity: 0.9;
    position: relative;
    z-index: 2;
    text-shadow: 1px 1px 2px rgba(255, 255, 255, 0.8);
    line-height: 1.4;
}

/* Form Sections with smooth gradients */
.form-section {
    padding: 25px 20px;
    border-bottom: 1px solid rgba(0, 0, 128, 0.1);
    background: rgba(255, 255, 255, 0.85);
    position: relative;
    transition: all 0.3s ease;
}

.form-section:hover {
    background: rgba(255, 255, 255, 0.92);
}

.form-section:last-child {
    border-bottom: none;
}

.form-section h2 {
    color: #000080;
    margin-bottom: 20px;
    font-size: 1.3em;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    padding: 12px 15px;
    background: linear-gradient(135deg, 
        rgba(255, 153, 51, 0.08) 0%, 
        rgba(255, 255, 255, 0.15) 50%, 
        rgba(19, 136, 8, 0.08) 100%);
    border-radius: 6px;
    border-left: 4px solid #000080;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

label {
    font-weight: 600;
    margin-bottom: 8px;
    color: #000080;
    font-size: 0.95em;
    display: flex;
    align-items: center;
    gap: 6px;
}

label::before {
    content: '▸';
    color: #138808;
    font-weight: bold;
    font-size: 1.1em;
}

input, select, textarea {
    padding: 14px 16px;
    border: 2px solid rgba(0, 0, 128, 0.15);
    border-radius: 6px;
    font-size: 16px; /* Better for mobile */
    transition: all 0.3s ease;
    background: rgba(255, 255, 255, 0.95);
    font-family: inherit;
    width: 100%;
    -webkit-appearance: none;
    appearance: none;
}

input:focus, select:focus, textarea:focus {
    outline: none;
    border-color: #000080;
    box-shadow: 0 0 0 3px rgba(0, 0, 128, 0.1);
    background: white;
    transform: translateY(-1px);
}

.interest-entry {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    align-items: center;
}

.interest-entry input {
    flex: 1;
}

/* Button Styles with smooth tricolor gradients */
.btn-primary, .btn-secondary, .btn-remove {
    padding: 16px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    width: 100%;
    position: relative;
    overflow: hidden;
    -webkit-tap-highlight-color: transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #000080 0%, #2a2aa0 50%, #000080 100%);
    color: white;
    border: 2px solid #000080;
}

.btn-primary::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.5s;
}

.btn-primary:hover::before {
    left: 100%;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #2a2aa0 0%, #000080 50%, #2a2aa0 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 128, 0.25);
}

.btn-secondary {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 50%, #ffffff 100%);
    color: #000080;
    border: 2px solid #000080;
}

.btn-secondary:hover {
    background: linear-gradient(135deg, #000080 0%, #2a2aa0 50%, #000080 100%);
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 128, 0.2);
}

.btn-remove {
    background: linear-gradient(135deg, #dc3545 0%, #e25562 50%, #dc3545 100%);
    color: white;
    padding: 12px 16px;
    font-size: 14px;
    margin-top: 8px;
    border: 2px solid #dc3545;
    width: auto;
    align-self: flex-start;
}

.btn-remove:hover {
    background: linear-gradient(135deg, #c82333 0%, #d04552 50%, #c82333 100%);
    border-color: #c82333;
    transform: translateY(-1px);
}

.form-actions {
    padding: 30px 20px;
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 15px;
    justify-content: center;
    background: linear-gradient(135deg, 
        rgba(255, 153, 51, 0.05) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(19, 136, 8, 0.05) 100%);
    border-top: 1px solid rgba(0, 0, 128, 0.1);
}

.education-entry, .skill-entry {
    background: linear-gradient(135deg, 
        rgba(255, 153, 51, 0.05) 0%, 
        rgba(255, 255, 255, 0.1) 50%, 
        rgba(19, 136, 8, 0.05) 100%);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 15px;
    border: 1px solid rgba(0, 0, 128, 0.1);
    border-left: 4px solid #138808;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    transition: all 0.3s ease;
}

.education-entry:hover, .skill-entry:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* Modal Styles with smooth tricolor theme */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 128, 0.9);
    justify-content: center;
    align-items: center;
    z-index: 1000;
    backdrop-filter: blur(5px);
    padding: 15px;
}

.modal-content {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.98) 0%, 
        rgba(248, 249, 250, 0.99) 100%);
    padding: 35px 25px;
    border-radius: 10px;
    text-align: center;
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    border: 1px solid rgba(0, 0, 128, 0.2);
    position: relative;
    overflow: hidden;
}

/* Smooth tricolor top border for modal */
.modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 5px;
    background: linear-gradient(90deg, 
        #FF9933 0%, 
        #FFB366 25%, 
        #FFFFFF 50%, 
        #99FF99 75%, 
        #138808 100%);
}

.success-icon {
    font-size: 4em;
    color: #138808;
    margin-bottom: 20px;
    background: linear-gradient(135deg, #000080 0%, #2a2aa0 100%);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    color: white;
    box-shadow: 0 6px 16px rgba(0, 0, 128, 0.25);
}

.modal-content h3 {
    font-size: 1.6em;
    margin-bottom: 15px;
    color: #000080;
    font-weight: 700;
    background: linear-gradient(135deg, #000080, #138808);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    line-height: 1.3;
}

.modal-content p {
    color: #666;
    margin-bottom: 25px;
    font-size: 1.1em;
    line-height: 1.5;
}

/* Enhanced form field styling */
input[type="date"] {
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' fill='%23000080' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 0a.5.5 0 0 1 .5.5V1h8V.5a.5.5 0 0 1 1 0V1h1a2 2 0 0 1 2 2v11a2 2 0 0 1-2 2H2a2 2 0 0 1-2-2V3a2 2 0 0 1 2-2h1V.5a.5.5 0 0 1 .5-.5zM1 4v10a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1V4H1z'/%3E%3C/svg%3E") no-repeat right 14px center;
    background-size: 16px;
}

select {
    background: white url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='%23000080' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E") no-repeat right 14px center;
    background-size: 12px;
    appearance: none;
}

/* Required field indicators */
input:required, select:required, textarea:required {
    border-left: 3px solid #FF9933;
    background: rgba(255, 153, 51, 0.03);
}

/* Additional smooth gradient elements */
.form-section::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 20px;
    right: 20px;
    height: 1px;
    background: linear-gradient(90deg, 
        transparent 0%, 
        #FF9933 20%, 
        #FFFFFF 50%, 
        #138808 80%, 
        transparent 100%);
    opacity: 0.4;
}

/* Focus states for accessibility */
input:focus-visible, 
select:focus-visible, 
textarea:focus-visible {
    outline: 2px solid #000080;
    outline-offset: 1px;
}

/* Loading animation */
.btn-primary.loading {
    background: linear-gradient(135deg, #666 0%, #999 50%, #666 100%);
    cursor: not-allowed;
    pointer-events: none;
}

.btn-primary.loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 8px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Remove button in education/skill entries */
.education-entry .btn-remove,
.skill-entry .btn-remove {
    margin-top: 10px;
    width: auto;
    min-width: 120px;
}

/* Tablet Styles (768px and up) */
@media (min-width: 768px) {
    body {
        padding: 20px;
    }
    
    .container {
        max-width: 900px;
        margin: 0 auto;
        border-radius: 12px;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
        border: 1px solid rgba(0, 0, 128, 0.1);
    }
    
    .form-header {
        padding: 50px 40px;
    }
    
    .form-header h1 {
        font-size: 2.2em;
    }
    
    .form-section {
        padding: 35px 30px;
    }
    
    .form-grid {
        grid-template-columns: 1fr 1fr;
        gap: 25px;
    }
    
    .form-actions {
        flex-direction: row;
        padding: 40px 30px;
        gap: 20px;
    }
    
    .btn-primary, .btn-secondary {
        width: auto;
        min-width: 160px;
    }
    
    .modal-content {
        padding: 50px 40px;
        max-width: 450px;
    }
    
    .success-icon {
        width: 100px;
        height: 100px;
        font-size: 4.5em;
    }
}

/* Desktop Styles (1024px and up) */
@media (min-width: 1024px) {
    .container {
        max-width: 1000px;
    }
    
    .form-header h1 {
        font-size: 2.4em;
    }
    
    .form-section h2 {
        font-size: 1.4em;
    }
    
    .form-grid {
        gap: 30px;
    }
}

/* Large Desktop Styles (1200px and up) */
@media (min-width: 1200px) {
    .container {
        max-width: 1100px;
    }
}

/* Small mobile devices (480px and below) */
@media (max-width: 480px) {
    .form-header {
        padding: 30px 15px;
    }
    
    .form-header h1 {
        font-size: 1.6em;
    }
    
    .form-header p {
        font-size: 1em;
    }
    
    .form-section {
        padding: 20px 15px;
    }
    
    .form-section h2 {
        font-size: 1.2em;
        padding: 10px 12px;
    }
    
    input, select, textarea {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .btn-primary, .btn-secondary {
        padding: 14px 20px;
        font-size: 15px;
    }
    
    .modal-content {
        padding: 30px 20px;
        margin: 10px;
    }
    
    .success-icon {
        width: 70px;
        height: 70px;
        font-size: 3em;
    }
    
    .modal-content h3 {
        font-size: 1.4em;
    }
}

/* Very small devices (360px and below) */
@media (max-width: 360px) {
    .form-header {
        padding: 25px 12px;
    }
    
    .form-header h1 {
        font-size: 1.4em;
    }
    
    .form-section {
        padding: 18px 12px;
    }
    
    .education-entry, .skill-entry {
        padding: 15px;
    }
    
    .btn-remove {
        padding: 10px 14px;
        font-size: 13px;
    }
}

/* Prevent horizontal scrolling */
html, body {
    max-width: 100%;
    overflow-x: hidden;
}

/* Improve touch targets for mobile */
@media (max-width: 768px) {
    input, select, textarea, button {
        min-height: 44px; /* Minimum touch target size */
    }
    
    .btn-primary, .btn-secondary {
        min-height: 50px;
    }
}

/* Print styles */
@media print {
    body {
        background: white !important;
        padding: 0;
    }
    
    .container {
        box-shadow: none;
        border: 2px solid #000080;
        border-radius: 0;
    }
    
    .btn-primary, .btn-secondary, .btn-remove {
        display: none;
    }
    
    .form-actions {
        display: none;
    }
    
    .modal {
        display: none !important;
    }
}