@tailwind base;
@tailwind components;
@tailwind utilities;

:root {
    --bright-amber: #f9c80e;
    --deep-mocha: #362c28;
    --vibrant-coral: #e87461;
    --slate-grey: #7d8491;
    --white: #fbfffe;
}

.bg-bright-amber { background-color: var(--bright-amber); }
.bg-deep-mocha { background-color: var(--deep-mocha); }
.bg-vibrant-coral { background-color: var(--vibrant-coral); }
.bg-slate-grey { background-color: var(--slate-grey); }
.bg-white { background-color: var(--white); }

.text-bright-amber { color: var(--bright-amber); }
.text-deep-mocha { color: var(--deep-mocha); }
.text-vibrant-coral { color: var(--vibrant-coral); }
.text-slate-grey { color: var(--slate-grey); }
.text-white { color: var(--white); }

.border-slate-grey { border-color: var(--slate-grey); }
.border-deep-mocha { border-color: var(--deep-mocha); }

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--vibrant-coral);
    color: var(--white);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(232, 116, 97, 0.3), 0 1px 2px rgba(232, 116, 97, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-primary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-primary:hover {
    background-color: #d8654f;
    box-shadow: 0 4px 6px rgba(232, 116, 97, 0.4), 0 2px 4px rgba(232, 116, 97, 0.3);
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(232, 116, 97, 0.3);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(232, 116, 97, 0.3), 0 4px 6px rgba(232, 116, 97, 0.4);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 2px rgba(232, 116, 97, 0.2);
}

.btn-primary:disabled:hover {
    transform: none;
    background-color: var(--vibrant-coral);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: var(--slate-grey);
    color: var(--white);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(125, 132, 145, 0.3), 0 1px 2px rgba(125, 132, 145, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-secondary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-secondary:hover {
    background-color: #6b7280;
    box-shadow: 0 4px 6px rgba(125, 132, 145, 0.4), 0 2px 4px rgba(125, 132, 145, 0.3);
    transform: translateY(-1px);
}

.btn-secondary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(125, 132, 145, 0.3);
}

.btn-secondary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(125, 132, 145, 0.3), 0 4px 6px rgba(125, 132, 145, 0.4);
}

.btn-secondary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: 0 1px 2px rgba(125, 132, 145, 0.2);
}

.btn-secondary:disabled:hover {
    transform: none;
    background-color: var(--slate-grey);
}

.btn-tertiary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    background-color: transparent;
    color: var(--slate-grey);
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
    line-height: 1.25rem;
    border: 2px solid var(--slate-grey);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.btn-tertiary::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(125, 132, 145, 0.1);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn-tertiary:hover::before {
    width: 300px;
    height: 300px;
}

.btn-tertiary:hover {
    background-color: var(--slate-grey);
    color: var(--white);
    border-color: var(--slate-grey);
    box-shadow: 0 2px 4px rgba(125, 132, 145, 0.3);
    transform: translateY(-1px);
}

.btn-tertiary:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(125, 132, 145, 0.2);
}

.btn-tertiary:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(125, 132, 145, 0.3), 0 2px 4px rgba(125, 132, 145, 0.3);
}

.btn-tertiary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
    background-color: transparent;
    color: var(--slate-grey);
}

.btn-tertiary:disabled:hover {
    transform: none;
    background-color: transparent;
    color: var(--slate-grey);
    box-shadow: none;
}

.btn-icon {
    padding: 0.5rem;
    width: 2.5rem;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
}

.btn-icon i {
    font-size: 1.125rem;
    line-height: 1;
}

.chip {
    @apply inline-flex items-center px-3 py-1 rounded-full text-sm font-medium;
}

.chip-success {
    @apply chip bg-green-100 text-green-800;
}

.chip-error {
    @apply chip bg-red-100 text-red-800;
}

.chip-info {
    @apply chip bg-blue-100 text-blue-800;
}

.chip-warning {
    @apply chip bg-yellow-100 text-yellow-800;
}

.fillbox {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 0.875rem;
    line-height: 1.5rem;
    color: var(--deep-mocha);
    background-color: var(--white);
    border: 2px solid var(--slate-grey);
    border-radius: 0.5rem;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-sizing: border-box;
}

.fillbox::placeholder {
    color: rgba(125, 132, 145, 0.6);
    opacity: 1;
}

.fillbox:hover:not(:disabled):not(:focus) {
    border-color: rgba(125, 132, 145, 0.8);
    box-shadow: 0 0 0 3px rgba(125, 132, 145, 0.1);
}

.fillbox:focus {
    border-color: var(--vibrant-coral);
    box-shadow: 0 0 0 3px rgba(232, 116, 97, 0.2);
    background-color: var(--white);
}

.fillbox:disabled {
    background-color: rgba(125, 132, 145, 0.1);
    color: rgba(54, 44, 40, 0.5);
    cursor: not-allowed;
    border-color: rgba(125, 132, 145, 0.3);
}

.fillbox:disabled::placeholder {
    color: rgba(125, 132, 145, 0.4);
}

.fillbox.error {
    border-color: #dc2626;
    background-color: #fef2f2;
}

.fillbox.error:focus {
    border-color: #dc2626;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.fillbox.success {
    border-color: #10b981;
}

.fillbox.success:focus {
    border-color: #10b981;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.2);
}

select.fillbox {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%237d8491' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
    appearance: none;
}

select.fillbox:hover:not(:disabled):not(:focus) {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}

select.fillbox:focus {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3E%3Cpath stroke='%23e87461' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3E%3C/svg%3E");
}

textarea.fillbox {
    resize: vertical;
    min-height: 100px;
    font-family: inherit;
}

.sidebar {
    position: relative;
    height: 100vh;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.1);
}

.nav-link {
    @apply text-white;
}

.nav-link.active {
    @apply bg-vibrant-coral text-white;
}

.nav-link:hover:not(.active) {
    @apply bg-opacity-20;
    background-color: rgba(232, 116, 97, 0.2);
}

.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

.loading-spinner {
    border: 4px solid var(--slate-grey);
    border-top: 4px solid var(--vibrant-coral);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.div-loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 500px;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 10000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

.toast-error {
    background-color: #fee2e2;
    color: #991b1b;
    border-left: 4px solid #dc2626;
}

.toast-success {
    background-color: #d1fae5;
    color: #065f46;
    border-left: 4px solid #10b981;
}

.toast-info {
    background-color: #dbeafe;
    color: #1e40af;
    border-left: 4px solid #3b82f6;
}

.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}

.modal-content {
    background: white;
    border-radius: 8px;
    max-width: 600px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px;
    border-bottom: 1px solid var(--slate-grey);
}

.modal-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: var(--slate-grey);
    transition: color 0.2s;
}

.modal-close:hover {
    color: var(--deep-mocha);
}

.modal-body {
    padding: 20px;
}

table {
    @apply w-full border-collapse;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    background-color: var(--white);
}

table thead {
    background: var(--deep-mocha);
}

table thead th {
    @apply font-semibold text-sm uppercase tracking-wider;
    color: #ffffff;
    padding: 16px 20px;
    text-align: left;
    border: none;
    position: relative;
}

table thead th:not(:last-child)::after {
    content: '';
    position: absolute;
    right: 0;
    top: 20%;
    height: 60%;
    width: 1px;
    background-color: rgba(255, 255, 255, 0.2);
}

table tbody tr {
    transition: all 0.2s ease;
    border-bottom: 1px solid rgba(125, 132, 145, 0.1);
}

table tbody tr:nth-child(even) {
    background-color: rgba(125, 132, 145, 0.03);
}

table tbody tr:nth-child(odd) {
    background-color: var(--white);
}

table tbody tr:hover {
    background-color: rgba(232, 116, 97, 0.08);
    transform: scale(1.001);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

table tbody td {
    padding: 16px 20px;
    color: var(--deep-mocha);
    font-size: 14px;
    border: none;
    vertical-align: middle;
}

table tbody td:first-child {
    font-weight: 600;
    color: var(--deep-mocha);
}

table tfoot {
    background-color: rgba(125, 132, 145, 0.05);
    border-top: 2px solid var(--slate-grey);
}

table tfoot td {
    padding: 16px 20px;
    border: none;
}

.overflow-x-auto {
    border-radius: 8px;
    overflow: hidden;
}

.cart-table {
    min-width: 100%;
    width: 100%;
}

.cart-table thead th {
    white-space: nowrap;
}

.cart-table tbody td {
    white-space: nowrap;
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

button:disabled:hover {
    opacity: 0.5;
}

