/* Doom of Mokhaiotl Calculator - OSRS Delve Boss Efficiency Tool
   Visit: https://themrgecko.com/doomcalculator/
*/

@import url('https://fonts.googleapis.com/css2?family=Dancing+Script:wght@400;500;600;700&family=Orbitron:wght@400;700&family=Poppins:wght@300;400;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --glow-color: #ff6a00;
    --glow-color-light: #ff8533;
    --title-font: 'Orbitron';
    --body-font: 'Poppins';
}

body {
    font-family: var(--body-font), sans-serif;
    background-color: #111827;
    color: #f3f4f6;
    min-height: 100vh;
    padding: 1rem;
}

.title-font {
    font-family: var(--title-font), sans-serif;
}

/* Responsive padding */
@media (min-width: 640px) {
    body {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    body {
        padding: 2rem;
    }
}

/* Main container */
.container {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 1rem;
}

.container > * + * {
    margin-top: 1.5rem;
}

/* Header styling */
.header {
    margin-bottom: 1.5rem;
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 2rem;
    flex-wrap: wrap;
}

.title-section {
    flex: 1;
    min-width: 300px;
}

.main-title {
    font-size: 2.25rem;
    line-height: 2.5rem;
    font-weight: 700;
    color: var(--glow-color);
    margin-bottom: 0.375rem;
    text-align: left;
}

.subtitle {
    font-size: 1.125rem;
    line-height: 1.75rem;
    color: #9ca3af;
    text-align: left;
}

/* Mathematical formulas styling */
.header-button-section {
    flex: 1;
    min-width: 200px;
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
}

.header-button-section .btn {
    margin-top: 0.5rem;
}

/* Responsive adjustments for math formulas */
@media (max-width: 1024px) {
    .header-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .title-section {
        text-align: center;
        min-width: auto;
    }
    
    .main-title {
        text-align: center;
    }
    
    .subtitle {
        text-align: center;
    }
    
    .header-button-section {
        min-width: auto;
        justify-content: center;
        margin-top: 1rem;
    }
}

.section-title {
    font-size: 1.25rem;
    line-height: 1.75rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 1rem;
}

/* Card styling */
.card {
    background-color: #1f2937;
    border-radius: 0.75rem;
    padding: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    border: 1px solid #374151;
    margin-bottom: 1.5rem;
}

/* Configuration header */
.config-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
    flex-wrap: wrap;
    gap: 1rem;
}

.reset-delay-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.input-label-inline {
    font-size: 0.875rem;
    color: #d1d5db;
    font-weight: 500;
    white-space: nowrap;
}

.input-cell-inline {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Responsive config header */
@media (max-width: 768px) {
    .config-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }
    
    .reset-delay-inline {
        width: 100%;
        justify-content: center;
    }
}

/* Input grid */
.input-grid {
    display: flex;
    justify-content: center;
    margin-bottom: 1rem;
}

.input-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 200px;
}

.input-cell-main {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
}

.unit-label-main {
    font-size: 0.875rem;
    color: #9ca3af;
    font-weight: 500;
}

.input-label {
    display: block;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: #d1d5db;
    text-align: center;
    font-size: 0.875rem;
}

/* Input styling */
.input-field {
    background-color: #374151;
    border: 1px solid #4b5563;
    color: #f3f4f6;
    border-radius: 0.375rem;
    padding: 0.5rem 0.75rem;
    width: 100%;
    transition: border-color 0.2s, box-shadow 0.2s;
    font-family: var(--body-font), sans-serif;
}

.compact-input {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    text-align: center;
    width: 50px;
    margin-right: 2px;
}

.input-cell {
    text-align: center;
    white-space: nowrap;
}

.unit-label {
    font-size: 0.75rem;
    color: #9ca3af;
    font-weight: 500;
    margin-left: 2px;
}

.input-field:focus {
    outline: none;
    border-color: var(--glow-color);
    box-shadow: 0 0 0 2px rgba(255, 106, 0, 0.2);
}

/* Remove number input spinners */
.input-field::-webkit-outer-spin-button,
.input-field::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.input-field[type=number] {
    -moz-appearance: textfield;
    appearance: textfield;
}

/* Warning styling for illogical wipe chances */
.input-field.wipe-warning {
    border-color: #ef4444;
    background-color: #7f1d1d;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.2);
}

.input-field.wipe-warning:focus {
    border-color: #ef4444;
    box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.4);
}

/* Button styling */
.button-container {
    text-align: center;
    margin-bottom: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

.btn {
    padding: 0.5rem 1.25rem;
    border-radius: 0.375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s, transform 0.1s;
    border: none;
    font-family: var(--body-font), sans-serif;
    font-size: 1rem;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background-color: var(--glow-color);
    color: #111827;
    box-shadow: 0 0 10px rgba(255, 106, 0, 0.3);
}

.btn-primary:hover {
    background-color: var(--glow-color-light);
    box-shadow: 0 0 15px rgba(255, 106, 0, 0.5);
}

.btn-secondary {
    background-color: #374151;
    color: #f3f4f6;
    border: 1px solid #4b5563;
}

.btn-secondary:hover {
    background-color: #4b5563;
    border-color: var(--glow-color);
}

/* Table styling */
.table-container {
    overflow-x: auto;
    margin-top: 0.75rem;
    max-width: 100%;
}

.data-table {
    width: 100%;
    min-width: 100%;
    font-size: 0.8rem;
    text-align: center;
    border-collapse: collapse;
    background-color: #1f2937;
}

.table-header {
    background-color: #374151;
    color: #e5e7eb;
    text-transform: uppercase;
    font-weight: 600;
}

.table-header th {
    padding: 0.5rem 0.25rem;
    border: 1px solid #4b5563;
    font-size: 0.75rem;
}

.data-table td {
    padding: 0.375rem 0.25rem;
    border: 1px solid #4b5563;
    vertical-align: middle;
}

.time-input-row {
    background-color: #374151;
}

.time-input-row td {
    background-color: #374151;
}

.wipe-input-row {
    background-color: #451a03;
}

.wipe-input-row td {
    background-color: #451a03;
    color: #fed7aa;
}

.item-data-row:nth-child(even) {
    background-color: #1f2937;
}

.item-data-row:nth-child(odd) {
    background-color: #111827;
}

.item-name {
    font-weight: 600;
    color: #ffffff;
    text-align: left;
    padding-left: 1rem;
    min-width: 150px;
}

.chance-cell {
    color: #9ca3af;
    font-family: monospace;
    font-size: 0.8rem;
}

.data-table .font-medium {
    font-weight: 500;
    color: #ffffff;
}

/* Best row highlighting */
.best-row {
    background-color: transparent;
    color: inherit;
}

.best-row td {
    font-weight: 600;
}

/* Results section */
.results-section {
    margin-top: 1.5rem;
}

.results-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
    margin-top: 1.5rem;
    width: 100%;
}

.result-column {
    min-width: 0; /* Allows grid items to shrink */
}

.result-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
    text-align: center;
}

.result-summary {
    margin-bottom: 0.75rem;
    color: #93c5fd;
    font-size: 0.75rem;
    line-height: 1.3;
}

/* Compact table for results */
.compact-table {
    font-size: 0.7rem;
}

.compact-table th,
.compact-table td {
    padding: 0.25rem 0.125rem;
    text-align: center;
}

.compact-table th {
    font-size: 0.65rem;
    font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
    .results-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 0.5rem;
    }
}

@media (max-width: 900px) {
    .results-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
}

@media (max-width: 600px) {
    .results-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .result-column {
        min-width: auto;
    }
}

/* Utility classes */
.hidden {
    display: none;
}

/* Table hover effects */
.data-table tbody tr:hover:not(.best-row) {
    background-color: #374151;
}

/* Responsive design */
@media (max-width: 640px) {
    .main-title {
        font-size: 1.5rem;
        line-height: 2rem;
    }
    
    .card {
        padding: 1rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem;
    }
}

/* Modal Styles */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal.show {
    opacity: 1;
    visibility: visible;
}

.modal-content {
    background-color: #1f2937;
    border-radius: 0.75rem;
    max-width: 95%;
    max-height: 90%;
    width: 1400px;
    overflow-y: auto;
    border: 1px solid #374151;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.5);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid #374151;
}

.modal-title {
    color: var(--glow-color);
    font-size: 1.25rem;
    margin: 0;
}

.modal-close {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 2rem;
    cursor: pointer;
    transition: color 0.2s;
    padding: 0;
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-close:hover {
    color: var(--glow-color);
}

.modal-body {
    padding: 1rem;
    color: #f3f4f6;
}

.info-section {
    margin-bottom: 1rem;
}

.info-section:last-child {
    margin-bottom: 0;
}

.info-section h3 {
    color: var(--glow-color);
    font-size: 1.1rem;
    margin-bottom: 0.75rem;
    font-family: var(--title-font), sans-serif;
}

.info-section p {
    line-height: 1.6;
    margin-bottom: 0.75rem;
    color: #d1d5db;
}

.info-section ul {
    margin: 0.75rem 0;
    padding-left: 1.5rem;
}

.info-section li {
    line-height: 1.6;
    margin-bottom: 0.5rem;
    color: #d1d5db;
}

.info-section strong {
    color: #ffffff;
    font-weight: 600;
}

.info-section em {
    color: var(--glow-color);
    font-style: normal;
    font-weight: 500;
}

/* Formula styles in modal */
.formula-list {
    margin: 1rem 0;
}

.formula-item-modal {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5rem 0;
    border-bottom: 1px solid #374151;
    gap: 1rem;
}

.formula-item-modal:last-child {
    border-bottom: none;
}

.formula-label-modal {
    font-size: 0.85rem;
    color: #d1d5db;
    font-weight: 500;
    flex: 1;
    text-align: left;
}

.formula-modal {
    font-family: 'Courier New', monospace;
    font-size: 0.8rem;
    color: #fbbf24;
    background-color: #374151;
    padding: 0.375rem 0.75rem;
    border-radius: 0.25rem;
    flex: 1;
    text-align: center;
    white-space: nowrap;
    overflow-x: auto;
}

.formula-legend-modal {
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid #4b5563;
}

.formula-legend-modal small {
    font-size: 0.75rem;
    color: #9ca3af;
    font-style: italic;
    line-height: 1.4;
}

@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        max-height: 85%;
    }
    
    .modal-header {
        padding: 1rem;
    }
    
    .modal-body {
        padding: 1rem;
    }
    
    .modal-title {
        font-size: 1.25rem;
    }
    
    .formula-item-modal {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
    
    .formula-modal {
        width: 100%;
        text-align: left;
    }
}

/* Breakdown Modal Specific Styles */
.breakdown-section {
    margin-bottom: 1rem;
    padding: 0.75rem;
    background-color: rgba(55, 65, 81, 0.3);
    border-radius: 0.5rem;
    border-left: 4px solid var(--glow-color);
}

.breakdown-section h4 {
    color: var(--glow-color);
    font-size: 1rem;
    margin-bottom: 0.5rem;
    font-family: var(--title-font), sans-serif;
}

.breakdown-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.35rem 0;
    border-bottom: 1px solid rgba(75, 85, 99, 0.3);
}

.breakdown-item:last-child {
    border-bottom: none;
}

.breakdown-label {
    color: #d1d5db;
    font-weight: 500;
}

.breakdown-value {
    color: #ffffff;
    font-weight: 600;
    font-family: 'Courier New', monospace;
}

.wave-breakdown {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.wave-item {
    background-color: rgba(31, 41, 55, 0.5);
    padding: 0.4rem;
    border-radius: 0.375rem;
    text-align: center;
    border: 1px solid rgba(75, 85, 99, 0.3);
}

.wave-number {
    color: var(--glow-color);
    font-weight: 600;
    font-size: 0.875rem;
}

.wave-stat {
    color: #d1d5db;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.clickable-row {
    cursor: pointer;
    transition: background-color 0.2s;
}

.clickable-row:hover {
    background-color: rgba(55, 65, 81, 0.3);
}

/* Deeper Modal Specific Styles */
.wave-input-section {
    background-color: #374151;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.input-group-modal {
    display: flex;
    gap: 1rem;
    align-items: center;
    margin-top: 0.5rem;
}

.input-group-modal .input-field {
    width: 100px;
}

.reset-section {
    background-color: #451a03;
    padding: 1rem;
    border-radius: 0.5rem;
    margin: 1rem 0;
}

.reset-section h3 {
    color: #fed7aa;
    margin-bottom: 0.75rem;
}

.reset-buttons {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.75rem;
    flex-wrap: wrap;
}

.reset-section p {
    color: #fed7aa;
    margin: 0;
}

.reset-section small {
    color: #fde68a;
    font-size: 0.8rem;
}

@media (max-width: 640px) {
    .button-container {
        flex-direction: column;
        align-items: center;
    }
    
    .btn {
        width: 200px;
    }
    
    .input-group-modal {
        flex-direction: column;
        align-items: stretch;
    }
    
    .reset-buttons {
        flex-direction: column;
    }
}

/* Coffee Footer */
.coffee-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.95));
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--glow-color);
    padding: 0.75rem 1rem;
    z-index: 1000;
}

.coffee-container {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.coffee-text {
    color: #d1d5db;
    font-size: 0.875rem;
    text-align: center;
}

.coffee-button {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(135deg, var(--glow-color), var(--glow-color-light));
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 106, 0, 0.3);
}

.coffee-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(255, 106, 0, 0.4);
    background: linear-gradient(135deg, var(--glow-color-light), var(--glow-color));
}

.coffee-button span {
    font-size: 1rem;
}

/* Add bottom padding to body to account for fixed footer */
body {
    padding-bottom: 70px;
}

@media (max-width: 640px) {
    .coffee-container {
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .coffee-text {
        font-size: 0.8rem;
    }
    
    .coffee-button {
        font-size: 0.8rem;
        padding: 0.4rem 0.8rem;
    }
}
