/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.7;
    color: #2c3e50;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

/* Main container */
.container {
    max-width: 1000px;
    margin: 0 auto;
    background: white;
    border-radius: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    animation: fadeInUp 0.8s ease-out;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 25px 20px;
    text-align: center;
    position: relative;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.header-content {
    position: relative;
    z-index: 2;
}

h1 {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 8px;
    text-shadow: 0 3px 6px rgba(0, 0, 0, 0.3);
}

.header-subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
    line-height: 1.5;
    max-width: 800px;
    margin: 0 auto;
}

/* Content section */
.content {
    padding: 25px;
}

/* Results section */
.results-section {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    border-radius: 12px;
    margin-bottom: 25px;
    text-align: center;
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.25);
    animation: pulse 2s infinite;
    position: sticky;
    top: 20px;
    z-index: 10;
}

.results-section h2 {
    font-size: 1.1rem;
    margin-bottom: 8px;
    font-weight: 600;
    color: white;
    opacity: 0.9;
}

.result-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

/* Calculator section */
.calculator-section {
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
    padding: 25px;
    border-radius: 15px;
    border: 1px solid #e2e8f0;
}

/* Table styles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.data-table thead {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.data-table th {
    padding: 15px 12px;
    font-weight: 600;
    font-size: 0.95rem;
    text-align: left;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

.data-table tbody tr {
    border-bottom: 1px solid #e2e8f0;
    transition: all 0.3s ease;
}

.data-table tbody tr:hover {
    background: #f8fafc;
}

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

.data-table td {
    padding: 12px;
    vertical-align: middle;
}

/* Input styles */
input[type="text"],
input[type="date"],
input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.3s ease;
    background: #f7fafc;
    color: #2c3e50;
}

input[type="text"]:focus,
input[type="date"]:focus,
input[type="number"]:focus {
    outline: none;
    border-color: #667eea;
    background: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    transform: translateY(-1px);
}

input[type="text"]:hover,
input[type="date"]:hover,
input[type="number"]:hover {
    border-color: #cbd5e0;
    background: white;
}

/* Auto-format containers */
.autoformat {
    position: relative;
    display: flex;
    align-items: center;
}

.autoformat input {
    margin-right: 10px;
    flex: 1;
}

.autoformat input[style*="display: none"] {
    display: none !important;
}

.autoformat .formatted {
    font-size: 1rem;
    font-weight: 600;
    color: #667eea;
    padding: 10px 12px;
    background: linear-gradient(135deg, #f7fafc 0%, #edf2f7 100%);
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
    text-align: right;
    flex: 1;
}

.autoformat .formatted:hover {
    background: linear-gradient(135deg, #edf2f7 0%, #e2e8f0 100%);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

/* Button styles */
.add-row,
.delete-row {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 12px;
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
    margin: 0 2px;
}

.add-row:hover,
.delete-row:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6b4190 100%);
}

.delete-row {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.3);
}

.delete-row:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.4);
}

/* Navigation */
.navigation {
    background: #f8fafc;
    padding: 20px;
    text-align: center;
    border-top: 1px solid #e2e8f0;
}

.home-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    text-decoration: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.home-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.4);
    background: linear-gradient(135deg, #5a6fd8 0%, #6b4190 100%);
    text-decoration: none;
    color: white;
}

.home-icon {
    font-size: 1.2rem;
    font-weight: bold;
}

/* Animations */
@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.02);
    }
}

/* Responsive design */
@media (max-width: 768px) {
    body {
        padding: 10px;
    }

    .header {
        padding: 20px 15px;
    }

    h1 {
        font-size: 1.7rem;
    }

    .header-subtitle {
        font-size: 0.85rem;
    }

    .content {
        padding: 20px 15px;
    }

    .calculator-section {
        padding: 20px 15px;
    }

    .results-section {
        padding: 15px;
        margin-bottom: 20px;
        position: relative;
        top: auto;
    }

    .data-table th,
    .data-table td {
        padding: 10px 8px;
        font-size: 0.9rem;
    }

    .autoformat .formatted {
        min-width: 100px;
        font-size: 0.9rem;
        padding: 8px 10px;
    }

    .navigation {
        padding: 15px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 5px;
    }

    .header {
        padding: 15px 10px;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 6px;
    }

    .header-subtitle {
        font-size: 0.8rem;
    }

    .content {
        padding: 15px 10px;
    }

    .calculator-section {
        padding: 15px 10px;
    }

    .results-section {
        padding: 12px;
        margin-bottom: 15px;
    }

    .result-value {
        font-size: 1.2rem;
    }

    .data-table th,
    .data-table td {
        padding: 8px 6px;
        font-size: 0.85rem;
    }

    input[type="text"],
    input[type="date"],
    input[type="number"] {
        padding: 8px 10px;
        font-size: 0.9rem;
    }

    .autoformat .formatted {
        min-width: 80px;
        font-size: 0.85rem;
        padding: 6px 8px;
    }

    .add-row,
    .delete-row {
        padding: 6px 10px;
        font-size: 1rem;
    }

    .navigation {
        padding: 12px;
    }
}

/* Legacy support for old classes */
.section {
    display: block;
}

.blog-card,
.blog-cardd {
    background: transparent;
    border: none;
    margin: 0;
}

.blog-card-body {
    padding: 0;
}

.sticky {
    position: relative;
    top: auto;
}

.borderred {
    border: none;
    margin: 0;
}

.center-content {
    display: block;
}

.bold {
    font-weight: 800;
}

table {
    width: 100%;
    height: auto;
}