/* Basic Reset */
* {
    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-color: #f8f9fa;
}

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

h1 {
    color: #b8860b;
    text-align: center;
    margin-bottom: 30px;
    padding-bottom: 10px;
    border-bottom: 2px solid #daa520;
}

h2 {
    color: #8b4513;
    margin-bottom: 15px;
}

h3 {
    color: #333;
    margin-bottom: 15px;
}

/* Current Price Box */
.current-price-box {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

#current-price-display {
    margin-top: 15px;
}

.price-value {
    font-size: 24px;
    font-weight: bold;
    color: #b8860b;
}

.price-time {
    font-size: 14px;
    color: #777;
    margin-top: 5px;
}

/* Import/Export Box */
.import-export-box {
    background-color: #fff;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    text-align: center;
}

.import-export-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.export-button, .import-button {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #3498db;
    color: white;
    padding: 10px 15px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.3s;
}

.export-button:hover {
    background-color: #2980b9;
}

.import-button {
    background-color: #f39c12;
    position: relative;
}

.import-button:hover {
    background-color: #e67e22;
}

.button-icon {
    margin-right: 5px;
    font-size: 18px;
}

/* Form Styling */
.investment-calculator {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
}

input[type="number"],
input[type="date"],
input[type="text"] {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
}

button {
    cursor: pointer;
    padding: 10px 15px;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 600;
    transition: background-color 0.3s;
}

.primary-button {
    background-color: #daa520;
    color: white;
    width: 100%;
}

.primary-button:hover {
    background-color: #b8860b;
}

.secondary-button {
    background-color: #f0f0f0;
    color: #333;
    margin-top: 5px;
}

.secondary-button:hover {
    background-color: #e0e0e0;
}

.delete-button {
    background-color: #dc3545;
    color: white;
    padding: 5px 10px;
    font-size: 14px;
}

.delete-button:hover {
    background-color: #c82333;
}

/* Refresh Button */
.refresh-button {
    background-color: #4CAF50;
    color: white;
    padding: 8px 12px;
    margin-top: 15px;
    border-radius: 4px;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
    transition: background-color 0.3s;
}

.refresh-button:hover {
    background-color: #45a049;
}

.refresh-button:disabled {
    background-color: #cccccc;
    cursor: not-allowed;
}

.refresh-icon {
    margin-right: 5px;
    font-size: 16px;
    display: inline-block;
}

.spin {
    animation: spinner 1s linear infinite;
}

@keyframes spinner {
    to {transform: rotate(360deg);}
}

/* Purchases Table */
.purchases-section {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.table-container {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 10px;
}

th, td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

th {
    background-color: #f8f8f8;
    font-weight: 600;
}

.empty-row td {
    text-align: center;
    padding: 30px;
    color: #777;
}

tfoot tr {
    background-color: #f9f9f9;
    font-weight: 600;
}

tfoot td {
    border-top: 2px solid #ddd;
}

/* Cache Status Indicator */
.cache-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    font-size: 14px;
    color: #666;
}

.cached-indicator {
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.cached {
    background-color: #e0e0e0;
    color: #666;
}

.fresh {
    background-color: #d4edda;
    color: #155724;
}

/* Modal Styling */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.hidden {
    display: none !important;
}

.modal-content {
    background-color: #fff;
    padding: 25px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.close-button {
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 24px;
    cursor: pointer;
    color: #888;
    font-weight: bold;
}

.close-button:hover {
    color: #333;
}

.modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
}

.modal-content ul {
    text-align: left;
    margin-bottom: 20px;
}

.modal-content li {
    margin-bottom: 5px;
}

.download-sample {
    margin: 15px 0;
    font-size: 14px;
}

.download-sample a {
    color: #3498db;
    text-decoration: underline;
}

.download-sample a:hover {
    color: #2980b9;
}

.upload-area {
    border: 2px dashed #ddd;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: #f9f9f9;
}

#file-name {
    color: #666;
    margin-bottom: 10px;
}

.modal-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

/* Progress Bar */
.progress-container {
    width: 100%;
    height: 10px;
    background-color: #eee;
    border-radius: 5px;
    overflow: hidden;
    margin-top: 10px;
}

.progress-bar {
    height: 100%;
    width: 0;
    background-color: #4CAF50;
    transition: width 0.3s;
}

/* Profit/Loss Styling */
.profit {
    color: #28a745;
}

.loss {
    color: #dc3545;
}

/* Status text colors */
.success-text {
    color: #28a745;
    font-weight: bold;
}

.warning-text {
    color: #ffc107;
    font-weight: bold;
}

.error-text {
    color: #dc3545;
    font-weight: bold;
}

/* Error Message */
#error-message {
    background-color: #f8d7da;
    color: #721c24;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Responsive Design */
@media (max-width: 800px) {
    th, td {
        padding: 8px 10px;
        font-size: 14px;
    }
    
    .container {
        padding: 10px;
    }
    
    h1 {
        font-size: 24px;
    }
    
    .price-value {
        font-size: 20px;
    }
    
    .import-export-buttons {
        flex-direction: column;
        gap: 10px;
    }
}

/* Equal button sizing */
.action-button {
    flex: 1;
    min-width: 200px;
    max-width: 250px;
    height: 44px;
    text-align: center;
    justify-content: center;
}

.import-export-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-bottom: 10px;
}

/* Sample download link styling */
.sample-download {
    margin-top: 8px;
    text-align: center;
    font-size: 14px;
}

.sample-download a {
    color: #3498db;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.sample-download a:hover {
    text-decoration: underline;
    color: #2980b9;
}

.sample-icon {
    margin-right: 5px;
    font-size: 16px;
}

/* Responsive adjustment */
@media (max-width: 600px) {
    .import-export-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .action-button {
        width: 100%;
        max-width: 300px;
    }
}