:root {
    --font-family: Arial, sans-serif;
    --border-radius: 8px;
    --spacing: 30px;
    --primary-color: #FF9800;
    --hover-color: #cf7b00;
    --text-color: #fff;
    --background-color: #16181b;
}

html {
    min-height: 100%;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100%;
    background: #061d33;
    text-align: center;
    font-family: 'Open Sans', sans-serif;
    margin: 0;
}

.no-js-message {
    color: white;
    position: absolute;
    width: 100%;
    padding: 50px;
    background: #000000e0;
    border-radius: 10px;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
}

p {
    font-weight: 600;
}

ul {
    text-align: left;
    margin-bottom: 20px;
    padding: 0 20px;
}

li > button {
    font-weight: 800; 
    background: none;
    border: none;
    float: right;
    color: #ffffff94;
}

.flex-container {
    width: 90%;
    margin: auto;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.page-title {
    padding: 50px 0;
    font-weight: bold;
}

.page-title h1 {
    color: #fff;
    text-transform: uppercase;
    font-weight: 800;
    margin: 0;
    font-family: 'Adamina', 'Georgia', serif;
    letter-spacing: 5px;
    font-size: 30px;
}

.input-group {
	margin-bottom: 5px;
}

.input-row {
	display: flex;
	flex-direction: row;
    gap: 1rem;
}

.input-row > * {
	flex: 1;
	min-width: 40px;
    flex-wrap: wrap;
}

.flex-grid {
	display: flex;
    flex-wrap: wrap;
    gap: 30px;
}

.layout-section {
	flex: 1;
}

.social-share-buttons a {
  text-decoration: none;
}

.share-tool-section {
	text-align: center;
}

.share-tool-section .social-share-buttons {
    padding: 10px 20px;
    background: none;
}

.share-tool-section .social-share-buttons a {
    color: #ffffff99;
    padding: 8px;
}

.share-tool-section .social-share-buttons a i {
    border: 1px solid #ffffff21;
    padding: 10px;
    border-radius: 6px;
}


/* App styles */


.budgeter-app {
    font-family: var(--font-family);
    border-radius: var(--border-radius);
    margin: 0 auto var(--spacing);
    text-align: center;
	min-width: 320px;
}


.expense-form-section h2 {
	margin-bottom: 30px;
    margin-top: 0px;
    font-size: 1.5rem;
    color: white;
}

.individual-expenses-section h2 {
	text-align: left;
	margin-bottom: 30px;
    margin-top: 30px;
    font-size: 1.5rem;
    color: white;
}

.calculator-container {
    background: var(--background-color);
    padding: 40px;
    border-radius: var(--border-radius);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    min-width: 300px;
}


/* Labels */
.budgeter-app label {
    display: block;
	text-align: left;
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--text-color);
}

/* Inputs and Selects */
.budgeter-app input[type="number"], .budgeter-app input[type="text"], .budgeter-app input[type="date"],
.budgeter-app select {
    width: 100%;
    padding: 10px 15px;
    font-size: 16px;
    border: none;
    border-radius: 5px;
    box-sizing: border-box;
    margin-bottom: 20px;
    background: #ffffff0d;
    color: #757575;
    height: 48px;
    font-family: inherit;
    line-height: 1.5;
}

.budgeter-app input[type="date"]::-webkit-calendar-picker-indicator {
  filter: brightness(0) invert(1);
  opacity: 0.8;
}

.budgeter-app input[type="number"]:focus,
.budgeter-app select:focus {
    border-color: #007bff;
    outline: none;
}

.budgeter-app select {
    appearance: none;
    background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2216%22 height=%2216%22 viewBox=%220 0 16 16%22%3E%3Cpath fill=%22%23ccc%22 d=%22M1 4h14l-7 7-7-7z%22/%3E%3C/svg%3E');
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 30px;
}


.expense-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  background: #1e2228;
  color: #ffffffb0;
  padding: 25px 20px 15px;
  margin-bottom: 26px;
  border-radius: var(--border-radius);
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  flex-wrap: wrap;
  transition: background 0.3s ease;
  position: relative;
}

.expense-item:hover {
  background: #2a2f36;
}

.expense-info {
  flex: 1 1 auto;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  margin-bottom: 6px;
}

.expense-actions {
  display: flex;
  gap: 10px;
}

.expense-actions button {
  background: none;
  border: none;
  color: #ffffff99;
  cursor: pointer;
  font-size: 1.1rem;
  transition: color 0.2s ease;
  padding: 2px 6px;
}

.expense-actions button:hover {
  color: var(--primary-color);
}

.recurrence-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: bold;
	text-transform: capitalize;
	color: #fff;
	position: absolute;
	top: -10px;
	left: 0;
}

.recurrence-badge.daily { background-color: #2ecc71; }
.recurrence-badge.weekly { background-color: #3498db; }
.recurrence-badge.monthly { background-color: #597ab6; }
.recurrence-badge.quarterly { background-color: #f39c12; }
.recurrence-badge.biannually { background-color: #e67e22; }
.recurrence-badge.yearly { background-color: #e74c3c; }
.recurrence-badge.onetime { background-color: #7f8c8d; }

/* Mobile adjustments */
@media (max-width: 600px) {
  .expense-item {
    flex-direction: column;
    align-items: flex-start;
  }

  .expense-actions {
    margin-top: 10px;
    align-self: flex-end;
  }
}




/* Buttons */
.budgeter-app button[type="submit"] {
    background-color: var(--primary-color);
    color: var(--text-color);
    border: none;
    padding: 15px 20px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 5px;
    margin-bottom: 20px;
    cursor: pointer;
    width: 100%;
    transition: background-color 0.3s ease;
}

.budgeter-app button[type="submit"]:hover {
    background-color: var(--hover-color);
}


/* Error Messages */
.error-message {
    display: none;
    position: absolute;
    top: 40px;
    left: 0;
    color: var(--error-color);
    font-size: 14px;
    font-weight: 600;
    background-color: var(--error-bg);
    padding: 5px 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    width: 100%;
    text-align: left;
    margin-top: 5px;
}

.budgeter-app input[type="number"]:invalid {
    border-color: var(--error-color);
}

.budgeter-app input[type="number"]:invalid:focus {
    border-color: var(--error-color);
    box-shadow: 0 0 5px rgb(60 103 231 / 80%);
}

.summary-section {
  color: white;
  border-radius: 12px;
  max-width: 800px;
  font-family: system-ui, sans-serif;
}

.summary-overview-total {
	background: #ffffff;
    color: #061d33;
    padding: 20px 20px 40px;
    border-radius: 10px;
	margin-bottom: 40px;
}

.summary-section .summary-total {
	font-size: 20px;
}

.summary-section .monthly-expense-list {
	width: fit-content;
    margin-right: auto;
    margin-left: auto;
    list-style: none;
}

.summary-section h2 {
  margin-top: 30px;
  font-size: 1.5rem;
}

.summary-section .monthly-projection-heading {
	text-align: left;
    color: #ffffffba;
    margin-bottom: 30px;
    font-size: 20px;
    font-weight: lighter;
}

.month-block {
  background: #1e2228;
  text-align: left;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  margin-bottom: 20px;
  padding: 15px 20px;
  border-left: 5px solid #ff9901;
}

.month-block h3 {
  margin-top: 0;
  font-size: 1.2rem;
  color: #fff;
}

.month-block p {
  font-weight: bold;
  color: #fff;
  margin-bottom: 10px;
}

.category-breakdown {
  list-style: none;
  padding: 0;
  margin: 0;
}

.category-breakdown li {
  padding: 4px 0;
  font-size: 0.95rem;
  color: #999999e6;
}

.clear-data-section {
	margin: 40px 0;
}

#clear-data-button {
	padding: 10px 20px;
    background: #252525;
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
}

.individual-expenses-section .delete-button {
  background: none;
  border: none;
  color: #b00;
  cursor: pointer;
  margin-left: 10px;
  padding: 2px;
  font-size: 1rem;
  transition: color 0.2s ease;
}
.individual-expenses-section .delete-button:hover {
  color: #e00;
}


.popup {
  position: fixed;
  top: 0; left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.popup-content {
  background: var(--background-color);
  padding: 30px 20px;
  border-radius: var(--border-radius);
  box-shadow: 0 0 20px rgba(0,0,0,0.4);
  max-width: 400px;
  width: 100%;
  color: var(--text-color);
  font-family: var(--font-family);
}

.popup-content h3 {
  margin-top: 0;
  font-size: 1.4rem;
  color: white;
  text-align: center;
}

.popup-content label {
  display: block;
  margin: 15px 0 10px;
  font-weight: 600;
  color: var(--text-color);
  text-align: left;
}

.popup-content input,
.popup-content select {
  width: 100%;
  padding: 10px 15px;
  font-size: 16px;
  border: none;
  border-radius: 5px;
  background: #ffffff0d;
  color: #ccc;
  height: 48px;
  font-family: inherit;
  line-height: 1.5;
}

.popup-content select {
  appearance: none;
  background-image: url('data:image/svg+xml,%3Csvg xmlns=%22http://www.w3.org/2000/svg%22 width=%2216%22 height=%2216%22 viewBox=%220 0 16 16%22%3E%3Cpath fill=%22%23ccc%22 d=%22M1 4h14l-7 7-7-7z%22/%3E%3C/svg%3E');
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 30px;
}

.popup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 20px;
}

.popup-actions button {
  padding: 10px 15px;
  font-size: 14px;
  font-weight: bold;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-family: inherit;
  transition: background-color 0.3s ease;
}

#save-edit {
  background-color: var(--primary-color);
  color: var(--text-color);
}

#save-edit:hover {
  background-color: var(--hover-color);
}

#cancel-edit {
  background-color: #444;
  color: #ddd;
}

#cancel-edit:hover {
  background-color: #666;
}


.hidden {
  display: none;
}

.no-js-message {
    color: var(--error-color);
    background-color: var(--error-bg);
    padding: 15px;
    border-radius: 5px;
    font-size: 16px;
}

/* Media Queries */

@media (min-width: 500px) {
	.budgeter-app {
	    min-width: 360px;
	}

}


/* End App styles */



.fade-out {
    opacity: 0;
    transition: opacity 1s ease-out;
    pointer-events: none;
}

.fade-in {
    opacity: 0; 
    animation: fadeIn 1s forwards; 
}


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

footer {
    padding: 15px 20px;
    color: #ffffff6e;
    font-family: sans-serif;
    text-align: center;
    font-size: 15px;
    letter-spacing: .2px;
}

footer a {
    color: #ff9901;
    text-decoration: none;
    cursor: pointer;
    display: inline-block;
}

footer .made-by {
    color: white;
}

footer .footer-copyright {
    font-size: 14px;
    line-height: 1.4;
    font-weight: lighter;
}
