/* 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.6;
    color: #333;
    background-color: #f5f5f5;
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 20px;
}

/* Header Styles */
header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem 0;
    border-bottom: 2px solid #e1e8ed;
}

header h1 {
    color: #2c3e50;
    font-size: 2rem;
    font-weight: 700;
}

.header-buttons {
    display: flex;
    gap: 1rem;
}

.header-btn {
    padding: 0.75rem 1.5rem;
    border: 2px solid #3498db;
    background-color: #3498db;
    color: white;
    border-radius: 6px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 100px;
}

.header-btn:hover {
    background-color: #2980b9;
    border-color: #2980b9;
    transform: translateY(-2px);
}

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

/* Description Section */
.description {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    border-left: 4px solid #3498db;
}

.description p {
    margin: 0 0 1rem 0;
    color: #555;
    line-height: 1.6;
    font-size: 1rem;
}

.description p:last-child {
    margin-bottom: 0;
}

/* Main Layout */
main {
    display: block;
}

/* Data Section Styles */
.data-section {
    background: white;
    border-radius: 8px;
    padding: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.data-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.data-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.data-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.data-label {
    font-weight: 600;
    color: #7f8c8d;
    min-width: 80px;
}

.data-value {
    flex: 1;
    margin: 0 1rem;
    color: #2c3e50;
    font-weight: 500;
    font-size:2rem;
}

.data-cost {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.25rem;
}

.data-cost-monthly {
    font-weight: 700;
    color: #27ae60;
    font-size: 1.1rem;
}

.data-cost-daily {
    font-weight: 700;
    color: #f39c12;
    font-size: 1.1rem;
    margin-right:25px;
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s ease;
}

.modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content {
    background-color: white;
    border-radius: 8px;
    width: 90%;
    max-width: 600px;
    max-height: 90vh;
    overflow-y: auto;
    animation: slideIn 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem;
    border-bottom: 1px solid #e1e8ed;
}

.modal-header h2 {
    color: #2c3e50;
    font-size: 1.5rem;
    margin: 0;
}

.close {
    font-size: 2rem;
    font-weight: bold;
    color: #7f8c8d;
    cursor: pointer;
    transition: color 0.3s ease;
}

.close:hover {
    color: #e74c3c;
}

.modal-body {
    padding: 1.5rem;
}

.modal-actions {
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid #e1e8ed;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideIn {
    from {
        transform: translateY(-50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Form Styles */
.calculator-form {
    display: grid;
    gap: 1rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #34495e;
}

.form-group input {
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s ease;
    min-height: 44px; /* Touch-friendly minimum */
    -webkit-appearance: none; /* Remove iOS styling */
    appearance: none;
}

.form-group input:focus {
    outline: none;
    border-color: #3498db;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.2);
    transform: scale(1.02);
}

.form-group input:invalid {
    border-color: #e74c3c;
}

.form-group input.error {
    border-color: #e74c3c;
}

.error-message {
    color: #e74c3c;
    font-size: 0.875rem;
    margin-top: 0.25rem;
    min-height: 1.2rem;
    display: block;
}

.error-message:empty {
    display: none;
}

/* Results Display */
.results-display {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    padding: 1rem;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 8px;
    border: 1px solid #dee2e6;
}

.result-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.25rem;
    background-color: white;
    border-radius: 6px;
    border-left: 4px solid #3498db;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.result-item:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.result-item:first-child {
    border-left-color: #e74c3c;
}

.result-item:last-child {
    border-left-color: #f39c12;
}

.result-label {
    font-weight: 600;
    color: #2c3e50;
    font-size: 1rem;
}

.result-value {
    font-size: 1.5rem;
    font-weight: 700;
    color: #27ae60;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.currency-note {
    font-size: 0.85rem;
    color: #7f8c8d;
    font-style: italic;
    text-align: center;
    margin: 0.5rem 0;
    opacity: 0.8;
}

/* Results section header enhancement */
.results-section h2 {
    color: #2c3e50;
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-align: center;
    position: relative;
}

.results-section h2::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 50px;
    height: 3px;
    background: linear-gradient(90deg, #3498db, #27ae60);
    border-radius: 2px;
}

/* Button Styles */
button {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 4px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 44px;
    min-width: 44px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

button:focus {
    outline: 2px solid #3498db;
    outline-offset: 2px;
}

button:active {
    transform: scale(0.98);
}

.save-btn {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    color: white;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: 6px;
    box-shadow: 0 2px 4px rgba(39, 174, 96, 0.3);
    transition: all 0.3s ease;
}

.save-btn:hover:not(:disabled) {
    background: linear-gradient(135deg, #229954 0%, #27ae60 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(39, 174, 96, 0.4);
}

.save-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    opacity: 0.6;
}

.cancel-btn {
    background-color: #95a5a6;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
}

.cancel-btn:hover {
    background-color: #7f8c8d;
}

.backup-action-btn, .restore-action-btn {
    background-color: #3498db;
    color: white;
    padding: 0.75rem 1.5rem;
    border-radius: 6px;
    width: 100%;
    margin-top: 1rem;
}

.backup-action-btn:hover, .restore-action-btn:hover {
    background-color: #2980b9;
}

/* Backup Modal Specific Styles */
.backup-section, .restore-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    background-color: #f8f9fa;
    border-radius: 6px;
    border-left: 4px solid #3498db;
}

.backup-section h3, .restore-section h3 {
    color: #2c3e50;
    margin-bottom: 0.5rem;
    font-size: 1.2rem;
}

.backup-section p, .restore-section p {
    color: #7f8c8d;
    margin-bottom: 1rem;
}

.restore-controls {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
}

.restore-controls input {
    flex: 1;
    padding: 0.75rem;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    font-size: 1rem;
}

/* Saved Items Section */
.saved-items-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.backup-controls {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.restore-controls {
    display: flex;
    gap: 0.5rem;
}

.restore-controls input {
    padding: 0.5rem;
    border: 2px solid #e1e8ed;
    border-radius: 4px;
    font-size: 0.9rem;
}

.saved-items-list {
    min-height: 100px;
}

.empty-state {
    text-align: center;
    color: #7f8c8d;
    font-style: italic;
    padding: 2rem;
}

.saved-item {
    background-color: #f8f9fa;
    border: 1px solid #e1e8ed;
    border-radius: 4px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.saved-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.saved-item-title {
    font-weight: 600;
    color: #2c3e50;
}

.saved-item-actions {
    display: flex;
    gap: 0.5rem;
}

.edit-btn, .delete-btn {
    padding: 0.25rem 0.5rem;
    font-size: 0.8rem;
}

.edit-btn {
    background-color: #f39c12;
    color: white;
}

.edit-btn:hover {
    background-color: #e67e22;
}

.delete-btn {
    background-color: #e74c3c;
    color: white;
}

.delete-btn:hover {
    background-color: #c0392b;
}

.saved-item-details {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    font-size: 0.9rem;
}

.saved-item-detail {
    display: flex;
    justify-content: space-between;
}

.saved-item-detail strong {
    color: #2c3e50;
}

/* Status Messages */
.status-messages {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.status-message {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: 4px;
    color: white;
    font-weight: 600;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.status-message.success {
    background-color: #27ae60;
}

.status-message.error {
    background-color: #e74c3c;
}

.status-message.info {
    background-color: #3498db;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .container {
        padding: 1rem;
    }
    
    header {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    header h1 {
        font-size: 1.5rem;
    }
    
    .header-buttons {
        justify-content: center;
    }
    
    .modal-content {
        width: 95%;
        margin: 1rem;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .calculator-form {
        gap: 1rem;
    }
    
    .form-group input {
        padding: 1rem;
        font-size: 1rem;
    }
    
    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .modal-actions button {
        width: 100%;
    }
    
    .restore-controls {
        flex-direction: column;
        gap: 0.75rem;
    }
    
    .restore-controls input {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 0.5rem;
    }
    
    header h1 {
        font-size: 1.25rem;
    }
    
    .header-btn {
        padding: 0.5rem 1rem;
        font-size: 0.9rem;
        min-width: 80px;
    }
    
    .data-item {
        flex-direction: column;
        text-align: center;
        gap: 0.5rem;
    }
    
    .data-label, .data-value {
        width: 100%;
        font-size:3rem;
    }
    
    .data-cost {
        align-items: center;
        width: 100%;
    }
}
/*
 Backup Result Styles */
.backup-result {
    margin-top: 1.5rem;
    padding: 1rem;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    border-left: 4px solid #28a745;
}

.backup-result h4 {
    color: #155724;
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.backup-result p {
    color: #155724;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.backup-url-container {
    display: flex;
    gap: 0.5rem;
    align-items: stretch;
}

.backup-details {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.backup-field {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.backup-field label {
    color: #155724;
    font-size: 0.85rem;
    font-weight: 500;
}

.backup-input {
    flex: 1;
    padding: 0.5rem;
    border: 1px solid #c3e6cb;
    border-radius: 4px;
    background-color: #f8f9fa;
    font-size: 0.85rem;
    font-family: monospace;
    color: #495057;
    width: 100%;
}

.copy-url-btn {
    padding: 0.5rem 1rem;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.85rem;
    font-weight: 500;
    transition: background-color 0.2s ease;
    white-space: nowrap;
}

.copy-url-btn:hover {
    background-color: #218838;
}

.copy-url-btn:active {
    background-color: #1e7e34;
}