@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    --primary-color: #4F46E5;
    --primary-hover: #4338CA;
    --primary-light: rgba(79, 70, 229, 0.1);
    --accent-color: #4F46E5;
    --success-color: #10B981;
    --warning-color: #F59E0B;
    --error-color: #EF4444;
    --light-bg: #F5F7FA;
    --card-bg: #FFFFFF;
    --header-bg: #FAFBFF;
    --gray-bg: #F3F4F6;
    --border-color: #E5E7EB;
    --text-primary: #111827;
    --text-secondary: #4B5563;
    --text-light: #9CA3AF;
    --success-bg: rgba(16, 185, 129, 0.1);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --border-radius: 14px;
    --border-radius-sm: 10px;
    --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Plus Jakarta Sans', sans-serif;
}

body {
    background-color: var(--light-bg);
    color: var(--text-primary);
    padding: 40px;
    line-height: 1.6;
    background-image:
        radial-gradient(at 0% 0%, rgba(79, 70, 229, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 0%, rgba(16, 185, 129, 0.03) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(79, 70, 229, 0.03) 0px, transparent 50%),
        radial-gradient(at 0% 100%, rgba(245, 158, 11, 0.03) 0px, transparent 50%);
    min-height: 100vh;
}

.container {
    max-width: 1300px;
    margin: 0 auto;
}

.app-header {
    margin-bottom: 30px;
    padding-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
}

.app-title {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    position: relative;
    background: linear-gradient(90deg, var(--primary-color), #818cf8);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    padding-left: 15px;
}

.app-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 25px;
    background: linear-gradient(to bottom, var(--primary-color), #818cf8);
    border-radius: 5px;
}

.header-text {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    padding: 10px 16px;
    background-color: white;
    border-radius: var(--border-radius-sm);
    display: inline-block;
    box-shadow: var(--shadow-sm);
    border-left: 3px solid var(--primary-color);
}

/* Layout în patru coloane */
.calculator-container {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
    perspective: 1000px;
}

.column {
    background-color: var(--card-bg);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    border: none;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: var(--transition);
    position: relative;
    z-index: 1;
    transform-style: preserve-3d;
    transform: translateZ(0);
    backdrop-filter: blur(10px);
}

.column:hover {
    box-shadow: var(--shadow-lg);
    transform: translateY(-3px) translateZ(0);
}

.column::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: var(--border-radius);
    background: linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.1) 100%);
    pointer-events: none;
}

.section-header {
    display: flex;
    align-items: center;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
    background-color: var(--header-bg);
}

.section-header .line {
    width: 4px;
    height: 22px;
    background: linear-gradient(to bottom, var(--primary-color), #818cf8);
    margin-right: 14px;
    border-radius: 4px;
}

.section-header h3 {
    color: var(--primary-color);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
}

.section-content {
    padding: 28px;
    flex-grow: 1;
}

.input-group {
    margin-bottom: 24px;
    position: relative;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-group.animate {
    animation: fadeIn 0.5s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

label {
    display: block;
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 10px;
    letter-spacing: 0.2px;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-with-checkbox {
    display: flex;
    align-items: center;
    width: 100%;
    border-radius: var(--border-radius-sm);
    transition: var(--transition);
    padding: 4px;
}

.input-with-checkbox:hover {
    background-color: var(--gray-bg);
    padding: 10px;
    margin: -6px;
}

input[type="number"] {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--border-radius-sm);
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    background-color: white;
    transition: var(--transition);
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.02);
}

.input-with-icon input[type="number"] {
    padding-left: 46px;
}

input[type="number"]:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px var(--primary-light);
}

input[type="number"]::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

input[type="number"][readonly] {
    background-color: var(--gray-bg);
    color: var(--text-secondary);
    cursor: not-allowed;
}

.info {
    margin-left: 10px;
    color: var(--text-light);
    font-size: 13px;
    background-color: var(--gray-bg);
    padding: 4px 10px;
    border-radius: 20px;
    white-space: nowrap;
    font-weight: 500;
}

.time-inputs {
    display: flex;
    gap: 12px;
}

.time-inputs .input-with-icon {
    flex: 1;
}

.checkbox-container {
    display: flex;
    align-items: center;
    margin-left: 16px;
    position: relative;
}

input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    transition: var(--transition);
}

input[type="checkbox"]:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

input[type="checkbox"]:checked::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 2px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

input[type="checkbox"]:focus {
    outline: none;
    box-shadow: 0 0 0 3px var(--primary-light);
}

.checkbox-label {
    margin-left: 10px;
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
}

/* Iconițe pentru inputuri */
.input-with-icon::before {
    content: '';
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 20px;
    height: 20px;
    background-size: contain;
    background-repeat: no-repeat;
    opacity: 0.9;
    z-index: 2;
}

.filament-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F46E5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 2L2 7l10 5 10-5-10-5zM2 17l10 5 10-5M2 12l10 5 10-5'/%3E%3C/svg%3E");
}

.calculator-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B5563' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='4' y='2' width='16' height='20' rx='2' ry='2'/%3E%3Cline x1='8' y1='6' x2='16' y2='6'/%3E%3Cline x1='8' y1='10' x2='16' y2='10'/%3E%3Cline x1='8' y1='14' x2='16' y2='14'/%3E%3Cline x1='8' y1='18' x2='16' y2='18'/%3E%3C/svg%3E");
}

.weight-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F46E5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 4h12a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2z'/%3E%3Cpath d='M9 10a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h6a1 1 0 0 0 1-1v-6a1 1 0 0 0-1-1H9z'/%3E%3Cpath d='M12 4v6'/%3E%3C/svg%3E");
}

.energy-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F46E5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M13 2L3 14h9l-1 8 10-12h-9l1-8z'/%3E%3C/svg%3E");
}

.time-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F46E5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='10'/%3E%3Cpolyline points='12 6 12 12 16 14'/%3E%3C/svg%3E");
}

.profit-icon::before {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234F46E5' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='12' y1='1' x2='12' y2='23'/%3E%3Cpath d='M17 5H9.5a3.5 3.5 0 0 0 0 7h5a3.5 3.5 0 0 1 0 7H6'/%3E%3C/svg%3E");
}

.button-container {
    padding: 20px 24px;
    display: flex;
    justify-content: flex-end;
    margin-top: auto;
    border-top: 1px solid var(--border-color);
    background-color: var(--header-bg);
}

button {
    padding: 12px 28px;
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    color: white;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    transition: var(--transition);
    box-shadow: 0 4px 10px rgba(79, 70, 229, 0.2);
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
}

button:hover {
    box-shadow: 0 6px 15px rgba(79, 70, 229, 0.3);
    transform: translateY(-2px);
}

button:active {
    transform: translateY(0);
}

button::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    background-image: radial-gradient(circle, #fff 10%, transparent 10.01%);
    background-repeat: no-repeat;
    background-position: 50%;
    transform: scale(10, 10);
    opacity: 0;
    transition: transform 0.5s, opacity 1s;
}

button:active::after {
    transform: scale(0, 0);
    opacity: 0.3;
    transition: 0s;
}

/* Analiză financiară */
.finance-column {
    background-color: var(--card-bg);
}

.finance-header {
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    padding: 20px 24px;
    position: relative;
    overflow: hidden;
}

.finance-header::before {
    content: '';
    position: absolute;
    top: -10px;
    right: -10px;
    width: 100px;
    height: 100px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.finance-header h3 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.3px;
    position: relative;
    z-index: 1;
}

.finance-content {
    padding: 28px;
    flex-grow: 1;
}

.finance-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    transition: var(--transition);
    border-radius: var(--border-radius-sm);
}

.finance-row:hover {
    background-color: var(--gray-bg);
    padding: 12px 10px;
    margin: 0 -10px;
    transform: scale(1.01);
}

.finance-label {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
}

.finance-value {
    font-weight: 600;
    color: var(--text-primary);
    font-size: 14px;
    text-align: right;
    min-width: 80px;
}

.separator {
    border-top: 1px solid var(--border-color);
    margin-top: 16px;
    padding-top: 20px;
}

.profit {
    color: var(--success-color);
    background-color: var(--success-bg);
    padding: 4px 10px;
    border-radius: 20px;
    display: inline-block;
    font-weight: 600;
}

.final-price {
    background: linear-gradient(135deg, var(--primary-color), #818cf8);
    padding: 24px;
    margin-top: auto;
    position: relative;
    overflow: hidden;
}

.final-price::before {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 100px;
    height: 100px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
}

.final-price::after {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 140px;
    height: 140px;
    background-color: rgba(255, 255, 255, 0.05);
    border-radius: 50%;
}

.final-price h3 {
    color: white;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    position: relative;
    z-index: 1;
}

#final-price {
   font-weight: 700;
   font-size: 28px;
   letter-spacing: 0.5px;
   margin-left: 5px;
   position: relative;
   display: inline-block;
}

#final-price::before {
   content: '';
   position: absolute;
   bottom: -2px;
   left: 0;
   width: 100%;
   height: 2px;
   background-color: rgba(255, 255, 255, 0.3);
}

/* Animations */
@keyframes fadeInUp {
   from { opacity: 0; transform: translateY(20px); }
   to { opacity: 1; transform: translateY(0); }
}

.column {
   animation: fadeInUp 0.6s ease-out forwards;
}

.column:nth-child(1) { animation-delay: 0.1s; }
.column:nth-child(2) { animation-delay: 0.2s; }
.column:nth-child(3) { animation-delay: 0.3s; }
.column:nth-child(4) { animation-delay: 0.4s; }

/* Tooltip styles */
.tooltip {
   position: relative;
   margin-left: 8px;
   cursor: help;
}

.tooltip::before {
   content: "?";
   display: inline-flex;
   align-items: center;
   justify-content: center;
   width: 16px;
   height: 16px;
   background-color: var(--text-light);
   color: white;
   border-radius: 50%;
   font-size: 11px;
   font-weight: 600;
}

.tooltip:hover::after {
   content: attr(data-tooltip);
   position: absolute;
   bottom: 125%;
   left: 50%;
   transform: translateX(-50%);
   background-color: var(--text-primary);
   color: white;
   padding: 8px 12px;
   border-radius: 6px;
   font-size: 12px;
   font-weight: 400;
   white-space: nowrap;
   z-index: 10;
   box-shadow: var(--shadow);
}

/* Responsive design */
@media (max-width: 1200px) {
   .calculator-container {
       grid-template-columns: repeat(2, 1fr);
   }

   body {
       padding: 24px;
   }
}

@media (max-width: 768px) {
   body {
       padding: 16px;
   }

   .calculator-container {
       grid-template-columns: 1fr;
   }

   .input-with-checkbox {
       flex-direction: column;
       align-items: flex-start;
   }

   .checkbox-container {
       margin-left: 0;
       margin-top: 12px;
   }

   .app-header {
       flex-direction: column;
       align-items: flex-start;
       gap: 16px;
   }

   .header-text {
       align-self: flex-start;
   }

   .section-content {
       padding: 20px;
   }

   .finance-content {
       padding: 20px;
   }
}

@media (max-width: 480px) {
   body {
       padding: 12px;
   }

   .app-title {
       font-size: 22px;
   }

   .column {
       border-radius: 10px;
   }

   .section-header {
       padding: 16px;
   }

   .section-content {
       padding: 16px;
   }

   .time-inputs {
       flex-direction: column;
       gap: 16px;
   }

   input[type="number"] {
       padding: 12px;
   }

   .input-with-icon input[type="number"] {
       padding-left: 40px;
   }

   .button-container {
       padding: 16px;
   }

   button {
       width: 100%;
   }

   .finance-content {
       padding: 16px;
   }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
   :root {
       --light-bg: #111827;
       --card-bg: #1F2937;
       --header-bg: #1A1F2B;
       --gray-bg: #374151;
       --border-color: #4B5563;
       --text-primary: #F9FAFB;
       --text-secondary: #D1D5DB;
       --text-light: #9CA3AF;
   }

   input[type="number"] {
       background-color: #374151;
       color: #F9FAFB;
   }

   input[type="number"][readonly] {
       background-color: #4B5563;
   }

   .info {
       background-color: #374151;
   }

   .checkbox-container input[type="checkbox"] {
       border-color: #6B7280;
   }

   .tooltip::before {
       background-color: #6B7280;
   }

   .finance-row:hover {
       background-color: #2D3748;
   }

   .profit {
       background-color: rgba(16, 185, 129, 0.2);
   }
}

/* Print styles */
@media print {
   body {
       padding: 0;
       background: white;
   }

   .calculator-container {
       grid-template-columns: repeat(2, 1fr);
       gap: 10px;
   }

   .column {
       box-shadow: none;
       border: 1px solid #ddd;
   }

   .column:hover {
       box-shadow: none;
       transform: none;
   }

   .button-container {
       display: none;
   }

   input[type="number"] {
       border: 1px solid #ddd;
       box-shadow: none;
   }

   .app-title {
       color: black;
       -webkit-text-fill-color: black;
   }

   .finance-header,
   .final-price {
       background: #e0e0e0;
       color: black;
   }

   .finance-header h3,
   .final-price h3 {
       color: black;
   }
}

/* Adăugare microinteracțiuni și confirmări vizuale */

/* Animații pentru valorile care cresc/scad */
.finance-value span {
   position: relative;
   transition: all 0.3s ease;
}

.value-increase {
   animation: valueIncrease 1s forwards;
}

.value-decrease {
   animation: valueDecrease 1s forwards;
}

@keyframes valueIncrease {
   0%, 100% { color: var(--text-primary); }
   50% { color: var(--success-color); }
}

@keyframes valueDecrease {
   0%, 100% { color: var(--text-primary); }
   50% { color: var(--error-color); }
}

/* Confirmări vizuale pentru schimbări de preț semnificative */
.price-significant-change {
   animation: pulsateHighlight 1.5s ease;
}

@keyframes pulsateHighlight {
   0% { transform: scale(1); }
   25% { transform: scale(1.1); }
   50% { transform: scale(1); }
   75% { transform: scale(1.05); }
   100% { transform: scale(1); }
}

/* Notificări toast */
.toast-container {
   position: fixed;
   bottom: 20px;
   right: 20px;
   z-index: 1000;
}

.toast {
   background-color: var(--card-bg);
   color: var(--text-primary);
   padding: 12px 16px;
   border-radius: var(--border-radius-sm);
   margin-bottom: 10px;
   box-shadow: var(--shadow-lg);
   display: flex;
   align-items: center;
   animation: toastIn 0.3s ease, toastOut 0.3s ease 2.7s forwards;
   max-width: 300px;
}

.toast.success {
   border-left: 4px solid var(--success-color);
}

.toast.warning {
   border-left: 4px solid var(--warning-color);
}

.toast.error {
   border-left: 4px solid var(--error-color);
}

.toast-icon {
   margin-right: 12px;
   font-size: 20px;
}

.toast-content {
   flex: 1;
}

.toast-message {
   font-size: 14px;
   font-weight: 500;
}

@keyframes toastIn {
   from { transform: translateX(100%); opacity: 0; }
   to { transform: translateX(0); opacity: 1; }
}

@keyframes toastOut {
   from { transform: translateX(0); opacity: 1; }
   to { transform: translateX(100%); opacity: 0; }
}

/* Optimizări mobile îmbunătățite */
@media (max-width: 480px) {
   body {
       padding: 12px 6px;
   }

   .app-header {
       padding-bottom: 15px;
       margin-bottom: 20px;
   }

   .app-title {
       font-size: 20px;
       padding-left: 12px;
   }

   .app-title::before {
       width: 4px;
   }

   .header-text {
       padding: 8px 12px;
       font-size: 12px;
   }

   .column {
       margin-bottom: 15px;
   }

   .section-header {
       padding: 14px 16px;
   }

   .section-content {
       padding: 16px;
   }

   .input-group {
       margin-bottom: 18px;
   }

   label {
       font-size: 13px;
       margin-bottom: 6px;
   }

   input[type="number"] {
       font-size: 13px;
       padding: 10px;
   }

   .input-with-icon input[type="number"] {
       padding-left: 36px;
   }

   .input-with-icon::before {
       left: 10px;
       width: 16px;
       height: 16px;
   }

   .info {
       font-size: 11px;
       padding: 3px 8px;
   }

   .checkbox-label {
       font-size: 12px;
   }

   .finance-content {
       padding: 16px;
   }

   .finance-row {
       padding: 8px 0;
   }

   .finance-label, .finance-value {
       font-size: 13px;
   }

   button {
       padding: 10px 20px;
       font-size: 13px;
   }

   .toast-container {
       left: 10px;
       right: 10px;
       bottom: 10px;
   }

   .toast {
       max-width: 100%;
   }

   /* Optimizări specifice pentru orientarea mobilului */
   @media (orientation: portrait) {
       .app-title {
           text-align: center;
           width: 100%;
       }

       .header-text {
           margin-top: 10px;
           align-self: center;
       }
   }
}