/* shadcn/ui inspired styles for Currency Exchange Calculator */

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

/* Tab Buttons */
.tab-button {
    border-bottom: 2px solid transparent;
    color: hsl(215.4 16.3% 46.9%);
}

.tab-button.active {
    border-bottom-color: hsl(222.2 47.4% 11.2%);
    color: hsl(222.2 47.4% 11.2%);
}

.tab-button:hover {
    color: hsl(222.2 47.4% 11.2%);
    background-color: hsl(210 40% 96.1%);
}

/* Swap Icon Button */
.swap-icon-button {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background-color: hsl(0 0% 100%);
    color: hsl(222.2 47.4% 11.2%);
    cursor: pointer;
    transition: all 200ms ease-in-out;
}

.swap-icon-button:hover {
    background-color: hsl(210 40% 96.1%);
    border-color: hsl(222.2 47.4% 11.2%);
}

.swap-icon-button:active {
    transform: scale(0.95);
}

.swap-icon-button i {
    font-size: 0.875rem;
}

/* Crypto Icons in Selects */
.cc {
    width: 1.25rem;
    height: 1.25rem;
    display: inline-block;
    margin-right: 0.5rem;
    vertical-align: middle;
}

/* Loading Spinner */
.loading-spinner {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 9999;
    background-color: rgba(0, 0, 0, 0.5);
    width: 100vw;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* shadcn Input Component */
.shadcn-input {
    width: 100%;
    height: 2.5rem;
    border-radius: 0.375rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background-color: hsl(0 0% 100%);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition-property: color, background-color, border-color, box-shadow;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

.shadcn-input:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px hsl(222.2 84% 4.9%);
}

.shadcn-input:disabled {
    cursor: not-allowed;
    opacity: 0.5;
}

.shadcn-input::placeholder {
    color: hsl(215.4 16.3% 46.9%);
}

/* shadcn Select Component */
.shadcn-select {
    width: 100%;
    height: 2.5rem;
    border-radius: 0.375rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background-color: hsl(0 0% 100%);
    padding: 0.5rem 0.75rem;
    font-size: 0.875rem;
    line-height: 1.25rem;
    transition-property: color, background-color, border-color, box-shadow;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
    appearance: none;
    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");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

.shadcn-select:focus {
    outline: none;
    border-color: transparent;
    box-shadow: 0 0 0 2px hsl(222.2 84% 4.9%);
}

.shadcn-select option {
    padding: 0.5rem;
    font-size: 0.875rem;
}

/* shadcn Button - Primary */
.shadcn-button-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    height: 2.5rem;
    padding: 0.5rem 1rem;
    background-color: hsl(222.2 47.4% 11.2%);
    color: hsl(210 40% 98%);
    border: none;
    cursor: pointer;
    transition-property: background-color, box-shadow;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

.shadcn-button-primary:hover {
    background-color: hsl(222.2 47.4% 11.2% / 0.9);
}

.shadcn-button-primary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(222.2 84% 4.9%);
}

.shadcn-button-primary:disabled {
    pointer-events: none;
    opacity: 0.5;
}

/* shadcn Button - Outline */
.shadcn-button-outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    height: 2.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    background-color: hsl(0 0% 100%);
    color: hsl(222.2 47.4% 11.2%);
    cursor: pointer;
    transition-property: background-color, color;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

.shadcn-button-outline:hover {
    background-color: hsl(210 40% 96.1%);
    color: hsl(222.2 47.4% 11.2%);
}

.shadcn-button-outline:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px hsl(222.2 84% 4.9%);
}

/* shadcn Button - WhatsApp Custom */
.shadcn-button-whatsapp {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    height: 2.5rem;
    padding: 0.5rem 1rem;
    background-color: #25D366;
    color: white;
    border: none;
    cursor: pointer;
    transition-property: background-color, transform, box-shadow;
    transition-duration: 200ms;
    transition-timing-function: ease-in-out;
}

.shadcn-button-whatsapp:hover {
    background-color: #128C7E;
}

.shadcn-button-whatsapp:focus-visible {
    outline: none;
    box-shadow: 0 0 0 2px #25D366;
}

.shadcn-button-whatsapp i {
    font-size: 1.1em;
}

/* Form Control & Select - Base Styling */
.form-control,
.form-select {
    font-size: 0.875rem;
    line-height: 1.5;
}

/* Currency Flag */
.currency-flag {
    width: 20px;
    height: 15px;
    margin-right: 8px;
    display: inline-block;
    background-size: cover;
}

/* Rate Card */
.rate-item {
    padding: 0.5rem;
    border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
    transition: all 200ms ease-in-out;
}

.rate-item:last-child {
    border-bottom: none;
}

.rate-item:hover {
    background-color: hsl(210 40% 96.1%);
}

/* Price Change Indicators */
.price-up {
    color: #16a34a;
}

.price-down {
    color: #dc2626;
}

/* Share Modal */
.share-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.share-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    animation: fadeIn 0.3s ease-out;
}

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

.share-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: scale(0.9) translateY(20px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.share-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: hsl(210 40% 96.1%);
    color: hsl(215.4 16.3% 46.9%);
    font-size: 24px;
    line-height: 1;
    border-radius: 8px;
    cursor: pointer;
    transition: all 200ms;
}

.share-modal-close:hover {
    background: hsl(214.3 31.8% 91.4%);
    color: hsl(222.2 47.4% 11.2%);
}

.share-modal-title {
    font-size: 24px;
    font-weight: 600;
    color: hsl(222.2 84% 4.9%);
    margin: 0 0 8px 0;
    text-align: center;
}

.share-modal-subtitle {
    font-size: 14px;
    color: hsl(215.4 16.3% 46.9%);
    margin: 0 0 24px 0;
    text-align: center;
}

.share-modal-preview {
    background: hsl(210 40% 96.1%);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.share-modal-preview img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.share-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 16px;
}

.share-action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 20px 16px;
    border: 2px solid hsl(214.3 31.8% 91.4%);
    background: white;
    border-radius: 12px;
    cursor: pointer;
    transition: all 200ms;
    font-size: 14px;
    font-weight: 500;
}

.share-action-btn:hover {
    border-color: hsl(222.2 47.4% 11.2%);
    background: hsl(210 40% 96.1%);
    transform: translateY(-2px);
}

.share-action-btn i {
    font-size: 28px;
    color: hsl(222.2 47.4% 11.2%);
}

.share-action-save:hover {
    border-color: #16a34a;
}

.share-action-save:hover i {
    color: #16a34a;
}

.share-action-copy:hover {
    border-color: #2563eb;
}

.share-action-copy:hover i {
    color: #2563eb;
}

.share-modal-hint {
    font-size: 12px;
    color: hsl(215.4 16.3% 46.9%);
    text-align: center;
    line-height: 1.5;
    margin: 0;
}

@media (max-width: 640px) {
    .share-modal-content {
        padding: 24px;
    }

    .share-modal-actions {
        grid-template-columns: 1fr;
    }

    .share-action-btn {
        flex-direction: row;
        justify-content: center;
    }
}

/* Currency Autocomplete Dropdown */
.currency-autocomplete {
    position: relative;
}

.currency-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    background: white;
    border: 1px solid hsl(214.3 31.8% 91.4%);
    border-radius: 8px;
    max-height: 300px;
    overflow-y: auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    display: none;
}

.currency-dropdown.active {
    display: block;
}

.currency-option {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 150ms;
    border-bottom: 1px solid hsl(214.3 31.8% 91.4%);
    font-size: 14px;
}

.currency-option:last-child {
    border-bottom: none;
}

.currency-option:hover {
    background-color: hsl(210 40% 96.1%);
}

.currency-option.selected {
    background-color: hsl(210 40% 96.1%);
    font-weight: 500;
}

.currency-option .currency-flag {
    font-size: 18px;
    margin-right: 8px;
}

.currency-option .currency-name {
    color: hsl(222.2 47.4% 11.2%);
    font-weight: 500;
}

.currency-option .currency-code {
    color: hsl(215.4 16.3% 46.9%);
    font-size: 12px;
    margin-left: 4px;
}

.shadcn-input[readonly] {
    cursor: pointer;
    background-color: white;
}

.shadcn-input[readonly]:focus {
    cursor: text;
}
