/* Postojeći CSS + dodaci za modal */
.moj-kalkulator-wrapper {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    position: relative;
}

.embed-button-wrapper {
    text-align: right;
    margin-bottom: 10px;
}

.show-embed-form-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.show-embed-form-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

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

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

.embed-modal-content {
    background-color: white;
    margin: 5% auto;
    padding: 40px;
    border-radius: 20px;
    width: 90%;
    max-width: 500px;
    position: relative;
    animation: slideDown 0.3s;
}

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

.close-modal {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
}

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

.embed-modal-content h3 {
    margin: 0 0 20px 0;
    color: #333;
    font-size: 24px;
}

.embed-modal-content p {
    color: #666;
    margin-bottom: 30px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #333;
    font-weight: 600;
}

.form-group input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.generate-embed-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 10px;
}

.generate-embed-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(102, 126, 234, 0.4);
}

.generate-embed-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.embed-result {
    margin-top: 30px;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 10px;
    border: 2px solid #28a745;
}

.embed-result h4 {
    margin: 0 0 15px 0;
    color: #28a745;
}

.embed-code-textarea {
    width: 100%;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-family: 'Courier New', monospace;
    font-size: 14px;
    background-color: white;
    resize: vertical;
    min-height: 80px;
    box-sizing: border-box;
}

.copy-embed-btn {
    margin-top: 15px;
    padding: 12px 24px;
    background-color: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s;
}

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

.embed-success-message {
    margin-top: 10px;
    font-weight: 600;
}

/* Postojeći CSS za kalkulator */
/*.calculator {
    background: #e1ecf752;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.calculator-title {
    text-align: center;
    color: #333;
    margin: 0 0 20px 0;
    font-size: 28px;
}

.calc-display {
    width: 100%;
    height: 60px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: right;
    font-size: 24px;
    padding: 0 15px;
    margin-bottom: 20px;
    background-color: #f8f9fa;
    color: #333;
    font-weight: bold;
    box-sizing: border-box;
}

.calc-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.calc-btn {
    height: 60px;
    border: 1px solid #ebebeb;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    background-color: #f0f0f0;
    color: #333;
    transition: all 0.3s ease;
    font-weight: bold;
}

.calc-btn:hover {
    background-color: #e0e0e0;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

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

.calc-btn.operator {
    background-color: #667eea;
    color: white;
}

.calc-btn.operator:hover {
    background-color: #5a6fd6;
}

.calc-btn.equals {
    background-color: #28a745;
    color: white;
}

.calc-btn.equals:hover {
    background-color: #218838;
}

.calc-btn.clear {
    background-color: #dc3545;
    color: white;
    grid-column: span 4;
}

.calc-btn.clear:hover {
    background-color: #c82333;
}

.calc-result {
    margin-top: 20px;
    padding: 15px;
    background-color: #f8f9fa;
    border-radius: 10px;
    text-align: center;
    font-size: 18px;
    color: #333;
}

.calc-result p {
    font-weight: bold;
    color: #667eea;
    margin: 0;
}

/* Dark theme */
/*.calculator.theme-dark {
    background: #2c3e50;
}

.theme-dark .calculator-title {
    color: white;
}

.theme-dark .calc-display {
    background-color: #34495e;
    border-color: #4a6278;
    color: white;
}

.theme-dark .calc-btn {
    background-color: #34495e;
    color: white;
}

.theme-dark .calc-btn:hover {
    background-color: #4a6278;
}

.theme-dark .calc-result {
    background-color: #34495e;
    color: white;
}

/* Responsive */
@media (max-width: 600px) {
    .embed-modal-content {
        margin: 10% auto;
        padding: 20px;
    }
    
    .calculator {
        padding: 20px;
    }
    
    .calc-btn {
        height: 50px;
        font-size: 18px;
    }
}



/* Embed footer stilovi */
.embed-footer {
    text-align: center;
    padding: 15px 20px;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
    margin-top: 15px;
    font-size: 13px;
    color: #666;
    border-radius: 0 0 10px 10px;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

.embed-footer a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
}

.embed-footer a:hover {
    color: #764ba2;
    text-decoration: underline;
}

.powered-by {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.bolt-icon {
    font-size: 16px;
    animation: boltPulse 2s infinite;
}

@keyframes boltPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}


/* Stilovi za calorie kalkulator */
/*.calorie-calculator .form-group {
    margin-bottom: 15px;
}

.calorie-calculator .form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #333;
}

.calorie-calculator .form-group input,
.calorie-calculator .form-group select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 16px;
    box-sizing: border-box;
    transition: border-color 0.3s;
}

.calorie-calculator .form-group input:focus,
.calorie-calculator .form-group select:focus {
    outline: none;
    border-color: #667eea;
}

.calculate-calories {
    width: 100%;
    padding: 15px;
    background: #28a745;
    color: white;
    border: none;
    border-radius: 10px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 10px;
}

.calculate-calories:hover {
    background: #218838;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.calorie-result {
    margin-top: 20px;
}

.result-card {
    padding: 20px;
    background: #f8f9fa;
    border-radius: 10px;
    text-align: center;
}

.result-card h3 {
    margin: 0 0 15px 0;
    color: #333;
}

.calorie-value {
    font-size: 36px;
    color: #667eea;
    font-weight: bold;
    margin: 15px 0;
}

.calorie-details {
    font-size: 14px;
    color: #666;
    line-height: 1.8;
}

.calorie-details p {
    margin: 5px 0;
}

/* Scientific Calculator Styles */
/*.sci-display {
    background-color:#e1ecf752;
    padding: 14px;
    border-radius: 8px;
    margin-bottom: 10px;
    text-align: right;
    border: 1px solid #cbd5e1;
    min-height: 70px;
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.sci-result {
    font-size: 2em;
    color: #1e293b;
    word-wrap: break-word;
    font-weight: 700;
    min-height: 35px;
}

.sci-buttons {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

.sci-operator {
    background: #f8fafc !important;
    color: #0369a1 !important;
    font-weight: 600 !important;
}

.sci-operator:hover {
    background: #f0f9ff !important;
}

/* Responsive */
@media (max-width: 400px) {
   /* .sci-display {
        padding: 10px;
        min-height: 50px;
    }
    .sci-result {
        font-size: 1.5em;
    }
}



:root {
    --bg: #f0ede8;
    --surface: #ffffff;
    --surface2: #f7f5f2;
    --border: #e2ddd7;
    --text: #1a1714;
    --text2: #6b6560;
    --text3: #9e9890;
    --accent: #1a1714;
    --accent-fg: #ffffff;
    --blue: #185fa5;
    --blue-bg: #e6f1fb;
    --blue-light: #b5d4f4;
    --green: #1a7a4a;
    --green-bg: #eaf5ef;
    --red: #b83232;
    --red-bg: #fdf0f0;
    --amber: #8a6d00;
    --amber-bg: #fef9e6;
    --radius: 14px;
    --radius-sm: 8px;
    --shadow: 0 2px 16px rgba(0,0,0,0);
  }
  [data-theme="dark"] {
    --bg: #111010;
    --surface: #1c1b1a;
    --surface2: #242322;
    --border: #2e2c2a;
    --text: #f0ede8;
    --text2: #9e9890;
    --text3: #5a5752;
    --accent: #f0ede8;
    --accent-fg: #1a1714;
    --blue: #85b7eb;
    --blue-bg: #0c2540;
    --blue-light: #0c2540;
    --green: #4ade80;
    --green-bg: #0d2b1a;
    --red: #f87171;
    --red-bg: #2b0d0d;
    --amber: #fbbf24;
    --amber-bg: #2b2000;
    --shadow: 0 2px 16px rgba(0,0,0,0.3);
  }

  * { box-sizing: border-box; margin: 0; padding: 0; }

  .body {
    font-family: 'DM Sans', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 16px 64px;
    transition: background 0.3s, color 0.3s;
  }

  .wrap { width: 100%; max-width: 420px; }

  /* Header */
  /*.header {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .header h1 { font-size: 20px; font-weight: 600; letter-spacing: -0.3px; }
  .theme-btn {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 50%;
    width: 36px; height: 36px;
    cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    font-size: 16px;
    transition: background 0.2s;
    color: var(--text);
  }
  .theme-btn:hover { background: var(--surface2); }

  /* Card */
 /* .card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
  }

  /* Fields */
  /*.field { margin-bottom: 16px; }
  .field:last-child { margin-bottom: 0; }
  .field-row { display: flex; gap: 12px; }
  .field-row .field { flex: 1; margin-bottom: 0; }

  label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 500;
    color: var(--text2);
    text-transform: uppercase;
    letter-spacing: 0.2px;
    margin-bottom: 6px;
  }

  .tip {
    width: 14px; height: 14px;
    background: var(--border);
    border-radius: 50%;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 600;
    color: var(--text2);
    cursor: help;
    position: relative;
    font-style: normal;
    flex-shrink: 0;
  }
  .tip:hover .tip-text { display: block; }
  .tip-text {
    display: none;
    position: absolute;
    left: 50%; bottom: calc(100% + 6px);
    transform: translateX(-50%);
    background: var(--text);
    color: var(--accent-fg);
    font-size: 11px; font-weight: 400;
    line-height: 1.5;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    width: 210px;
    text-transform: none; letter-spacing: 0;
    z-index: 10; white-space: normal;
    pointer-events: none;
  }

  input, select {
    width: 100%;
    padding: 11px 14px;
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Mono', monospace;
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
    appearance: none;
    -webkit-appearance: none;
  }
  input:focus, select:focus { border-color: var(--text3); background: var(--surface); }
  select {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%239e9890' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
  }

  /* Slider */
  /*.slider-wrap { margin-top: 8px; }
  input[type="range"] {
    padding: 0;
    height: 4px;
    background: var(--border);
    border-radius: 99px;
    cursor: pointer;
    accent-color: #0066cc;
    border: none;
  }
  .slider-labels {
    display: flex; justify-content: space-between;
    font-size: 11px; color: var(--text3);
    margin-top: 4px;
    font-family: 'DM Mono', monospace;
  }

  /* Button */
  /*.calc-btn {
    width: 100%;
    padding: 13px;
    background: #0066cc;
    color: var(--accent-fg);
    border: none;
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 15px; font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s, transform 0.1s;
    letter-spacing: -0.2px;
    margin-top: 4px;
  }
  .calc-btn:hover { opacity: 0.85; }
  .calc-btn:active { transform: scale(0.99); }

  /* Error */
 /* .error-box {
    display: none;
    margin-top: 14px;
    background: var(--red-bg);
    border: 1px solid var(--red);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    font-size: 13px; color: var(--red);
    line-height: 1.5;
  }

  /* Result card */
  /*.result-card {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    box-shadow: var(--shadow);
    margin-bottom: 16px;
    animation: fadeUp 0.3s ease;
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Main EMI display */
  /*.main-result {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 20px;
  }
  .main-result .emi-label {
    font-size: 11px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.2px;
    color: var(--text2); margin-bottom: 8px;
  }
  .emi-amount {
    font-family: 'DM Mono', monospace;
    font-size: 46px; font-weight: 400;
    line-height: 1; letter-spacing: -2px;
    color: var(--blue);
  }
  .emi-period {
    font-size: 13px; color: var(--text3);
    margin-top: 6px;
  }

  /* Stats grid */
 /* .stats-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }
  .stat {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
  }
  .stat .stat-label {
    font-size: 11px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.2px;
    color: var(--text3); margin-bottom: 4px;
  }
  .stat .stat-val {
    font-family: 'DM Mono', monospace;
    font-size: 15px; font-weight: 500;
    color: var(--text);
  }
  .stat .stat-val.red { color: var(--red); }
  .stat .stat-val.green { color: var(--green); }
  .stat .stat-val.amber { color: var(--amber); }

  /* Breakdown bar */
 /* .breakdown {
    margin-bottom: 20px;
  }
  .breakdown-label {
    display: flex; justify-content: space-between;
    font-size: 12px; color: var(--text2);
    margin-bottom: 8px;
  }
  .bar-track {
    height: 8px;
    background: var(--border);
    border-radius: 99px;
    overflow: hidden;
    display: flex;
  }
  .bar-principal {
    height: 100%;
    background: var(--blue);
    border-radius: 99px 0 0 99px;
    transition: width 0.5s ease;
  }
  .bar-interest {
    height: 100%;
    background: var(--red);
    border-radius: 0 99px 99px 0;
    transition: width 0.5s ease;
  }
  .bar-legend {
    display: flex; gap: 16px;
    margin-top: 8px;
  }
  .legend-item {
    display: flex; align-items: center; gap: 6px;
    font-size: 12px; color: var(--text2);
  }
  .legend-dot {
    width: 8px; height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
  }

  /* Amortization toggle */
 /* .amort-toggle {
    width: 100%;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px; font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 0;
  }
  .amort-toggle:hover { background: var(--surface2); color: var(--text); }

  /* Amortization table */
  /*.amort-wrap {
    display: none;
    margin-top: 16px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
  }
  .amort-head {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 1fr;
    gap: 0;
    padding: 10px 16px;
    background: var(--surface2);
    border-bottom: 1px solid var(--border);
  }
  .amort-head span {
    font-size: 10px; font-weight: 500;
    text-transform: uppercase; letter-spacing: 0.2px;
    color: var(--text3);
    text-align: right;
  }
  .amort-head span:first-child { text-align: left; }
  .amort-body { max-height: 300px; overflow-y: auto; }
  .amort-row {
    display: grid;
    grid-template-columns: 40px 1fr 1fr 1fr;
    padding: 9px 16px;
    border-bottom: 1px solid var(--border);
    font-family: 'DM Mono', monospace;
    font-size: 12px;
    transition: background 0.15s;
  }
  .amort-row:last-child { border-bottom: none; }
  .amort-row:hover { background: var(--surface2); }
  .amort-row span { text-align: right; color: var(--text2); }
  .amort-row span:first-child { text-align: left; color: var(--text3); }
  .amort-row .interest-cell { color: var(--red); }
  .amort-row .principal-cell { color: var(--blue); }

  /* Copy button */
 /* .copy-btn {
    width: 100%;
    margin-top: 16px;
    padding: 10px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    font-family: 'DM Sans', sans-serif;
    font-size: 13px; font-weight: 500;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s;
  }
  .copy-btn:hover { background: var(--surface2); color: var(--text); }
  .copy-btn.copied { color: var(--green); border-color: var(--green); }

  /* History */
  /*.history-card {
    display: none;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px 24px;
    box-shadow: var(--shadow);
  }
  .history-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px;
  }
  .history-header span {
    font-size: 12px; font-weight: 500;
    color: var(--text2);
    text-transform: uppercase; letter-spacing: 0.2px;
  }
  .clear-btn {
    font-size: 11px; color: var(--text3);
    background: none; border: none;
    cursor: pointer;
    font-family: 'DM Sans', sans-serif;
    transition: color 0.2s;
  }
  .clear-btn:hover { color: var(--red); }
  .history-item {
    display: flex; justify-content: space-between; align-items: center;
    padding: 9px 0;
    border-bottom: 1px solid var(--border);
    animation: fadeUp 0.2s ease;
  }
  .history-item:last-child { border-bottom: none; padding-bottom: 0; }
  .history-item:first-child { padding-top: 0; }
  .hist-left { font-size: 12px; color: var(--text2); font-family: 'DM Mono', monospace; line-height: 1.6; }
  .hist-right { text-align: right; }
  .hist-emi { font-family: 'DM Mono', monospace; font-size: 14px; font-weight: 500; color: var(--blue); }
  .hist-time { font-size: 11px; color: var(--text3); }

  .field-row {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}