/* ===================================
   API DEMOS MODAL STYLES - PREMIUM DESIGN
   =================================== */

.api-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(15px);
    animation: fadeInModal 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes fadeInModal {
    from {
        opacity: 0;
        backdrop-filter: blur(0);
    }
    to {
        opacity: 1;
        backdrop-filter: blur(20px);
    }
}

.api-modal-content {
    background: linear-gradient(135deg, #ffffff 0%, #f8f9ff 100%);
    margin: 3% auto;
    padding: 0;
    width: 90%;
    max-width: 700px;
    max-height: 90vh;
    border-radius: 30px;
    box-shadow: 
        0 30px 90px rgba(0, 0, 0, 0.4),
        0 0 0 1px rgba(255, 255, 255, 0.1) inset;
    position: relative;
    overflow-y: auto;
    animation: scaleIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.api-modal-content::-webkit-scrollbar {
    width: 10px;
}

.api-modal-content::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 0 30px 30px 0;
}

.api-modal-content::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.api-modal-content::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.api-modal-content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    opacity: 0.1;
    border-radius: 30px 30px 0 0;
    z-index: 0;
}

@keyframes scaleIn {
    from {
        transform: scale(0.8) translateY(-30px);
        opacity: 0;
    }
    to {
        transform: scale(1) translateY(0);
        opacity: 1;
    }
}

.api-modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #667eea;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.2);
}

.api-modal-close:hover {
    color: white;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    transform: rotate(90deg) scale(1.1);
    box-shadow: 0 6px 25px rgba(102, 126, 234, 0.4);
}

.api-modal-content h2 {
    margin: 0;
    padding: 2rem 2rem 1rem 2rem;
    font-size: 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    position: relative;
    z-index: 1;
    animation: slideInTitle 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s both;
}

@keyframes slideInTitle {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.api-modal-content > p {
    margin: 0;
    padding: 0 2rem 1.5rem 2rem;
    color: #666;
    font-size: 1.05rem;
    position: relative;
    z-index: 1;
    animation: slideInSubtitle 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.3s both;
}

@keyframes slideInSubtitle {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Demo Container */
.demo-container {
    padding: 2rem;
    position: relative;
    z-index: 1;
    animation: fadeInContent 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.4s both;
}

@keyframes fadeInContent {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.demo-container input[type="text"],
.demo-container input[type="number"],
.demo-container textarea,
.demo-container select {
    width: 100%;
    padding: 1rem 1.25rem;
    margin-bottom: 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 15px;
    font-size: 1rem;
    font-family: inherit;
    background: white;
    color: #333;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 10px rgba(102, 126, 234, 0.05);
}

.demo-container textarea {
    min-height: 120px;
    resize: vertical;
}

.demo-container input:focus,
.demo-container textarea:focus,
.demo-container select:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 
        0 0 0 4px rgba(102, 126, 234, 0.1),
        0 8px 25px rgba(102, 126, 234, 0.15);
    transform: translateY(-2px);
}

.demo-container input::placeholder,
.demo-container textarea::placeholder {
    color: #999;
    font-style: italic;
}

.chat-input-container input {
    color: #333 !important;
    background: white !important;
}

.chat-input-container input::placeholder {
    color: #999 !important;
}

.demo-btn {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-size: 1.05rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 1rem;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.demo-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.demo-btn:hover::before {
    left: 100%;
}

.demo-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.demo-btn:active {
    transform: translateY(-1px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}

.button-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1rem;
}

.button-group .demo-btn {
    margin-bottom: 0;
    animation: scaleInBtn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.button-group .demo-btn:nth-child(1) {
    animation-delay: 0.5s;
}

.button-group .demo-btn:nth-child(2) {
    animation-delay: 0.6s;
}

@keyframes scaleInBtn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Result Box */
.result-box {
    margin-top: 1rem;
    padding: 1.5rem;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 20px;
    min-height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08);
    animation: slideInResult 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes slideInResult {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.result-box:empty {
    display: none;
}

.loading {
    color: #667eea;
    font-weight: 600;
    font-size: 1.05rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: pulseLoading 1.5s infinite;
}

.loading::before {
    content: '⏳';
    animation: rotate 2s linear infinite;
}

@keyframes rotate {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

@keyframes pulseLoading {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.6;
    }
}

.result-success {
    color: #10b981;
    line-height: 1.8;
    font-size: 1.05rem;
    animation: successPop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes successPop {
    0% {
        opacity: 0;
        transform: scale(0.8);
    }
    50% {
        transform: scale(1.05);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

.result-error {
    color: #ef4444;
    font-weight: 600;
    font-size: 1.05rem;
    animation: shake 0.5s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-5px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(5px);
    }
}

/* Weather Card */
.weather-card {
    text-align: center;
    padding: 1.5rem;
    animation: weatherAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes weatherAppear {
    from {
        opacity: 0;
        transform: scale(0.9) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.weather-header h3 {
    margin: 0 0 1rem 0;
    color: #333;
    font-size: 1.5rem;
    animation: fadeInDown 0.5s ease 0.2s both;
}

.weather-icon {
    font-size: 5rem;
    margin: 1rem 0;
    animation: bounceIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) 0.3s both;
    filter: drop-shadow(0 4px 12px rgba(102, 126, 234, 0.3));
}

@keyframes bounceIn {
    from {
        opacity: 0;
        transform: scale(0);
    }
    50% {
        transform: scale(1.1);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.weather-temp {
    font-size: 3.5rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin: 1rem 0;
    animation: fadeInUp 0.5s ease 0.4s both;
}

.weather-details {
    display: flex;
    justify-content: space-around;
    margin-top: 1.5rem;
    color: #666;
    font-size: 1.05rem;
}

.weather-details > div {
    animation: fadeInUp 0.5s ease both;
}

.weather-details > div:nth-child(1) {
    animation-delay: 0.5s;
}

.weather-details > div:nth-child(2) {
    animation-delay: 0.6s;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Currency Result */
.currency-result {
    text-align: center;
    padding: 2rem;
    animation: currencyAppear 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes currencyAppear {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.conversion-display {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.amount-from {
    font-size: 1.8rem;
    font-weight: bold;
    color: #333;
    animation: slideInLeft 0.5s ease 0.2s both;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.conversion-arrow {
    font-size: 2rem;
    color: #667eea;
    animation: bounceArrow 1s ease-in-out infinite;
}

@keyframes bounceArrow {
    0%, 100% {
        transform: translateX(0);
    }
    50% {
        transform: translateX(10px);
    }
}

.amount-to {
    font-size: 1.8rem;
    font-weight: bold;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: slideInRight 0.5s ease 0.3s both;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.exchange-rate {
    color: #666;
    font-size: 1rem;
    animation: fadeIn 0.5s ease 0.5s both;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Image Card */
.image-card {
    text-align: center;
    padding: 1.5rem;
}

.image-card img {
    max-width: 100%;
    height: auto;
    max-height: 450px;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(102, 126, 234, 0.3);
    opacity: 0;
    transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
    transform: scale(0.9);
}

.image-card img[style*="opacity:1"] {
    animation: imageZoomIn 0.8s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes imageZoomIn {
    from {
        opacity: 0;
        transform: scale(0.8) rotate(-2deg);
    }
    to {
        opacity: 1;
        transform: scale(1) rotate(0deg);
    }
}

/* Chat Container (Gemini) */
.chat-container {
    height: 450px;
    overflow-y: auto;
    background: linear-gradient(135deg, #f8f9ff 0%, #ffffff 100%);
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 2px solid rgba(102, 126, 234, 0.1);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.08) inset;
}

.chat-container::-webkit-scrollbar {
    width: 8px;
}

.chat-container::-webkit-scrollbar-track {
    background: rgba(102, 126, 234, 0.05);
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 10px;
}

.chat-container::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
}

.chat-message {
    display: flex;
    flex-direction: column;
    max-width: 85%;
    animation: messageSlideIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1);
}

@keyframes messageSlideIn {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.chat-message.user {
    align-self: flex-end;
}

.chat-message.ai {
    align-self: flex-start;
}

.chat-message strong {
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: #667eea;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.chat-message strong::before {
    content: '🤖';
    font-size: 1.2rem;
}

.chat-message.user strong {
    color: #764ba2;
}

.chat-message.user strong::before {
    content: '👤';
}

.chat-message .message-bubble {
    background: white;
    padding: 1rem 1.25rem;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.1);
    line-height: 1.6;
    border: 2px solid rgba(102, 126, 234, 0.1);
}

.chat-message.user .message-bubble {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.chat-input-container {
    display: flex;
    gap: 0.75rem;
}

.chat-input-container input {
    flex: 1;
    margin-bottom: 0;
}

.send-btn {
    padding: 1rem 2rem;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    border-radius: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    white-space: nowrap;
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
    position: relative;
    overflow: hidden;
}

.send-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s;
}

.send-btn:hover::before {
    left: 100%;
}

.send-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 30px rgba(102, 126, 234, 0.5);
}

.send-btn:active {
    transform: translateY(-1px);
}

/* Info Box */
.info-box {
    background: linear-gradient(135deg, #f0f4ff 0%, #ffffff 100%);
    padding: 2rem;
    border-radius: 20px;
    border: 2px solid rgba(102, 126, 234, 0.2);
    box-shadow: 0 4px 20px rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
    animation: infoBoxSlide 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.info-box::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 6px;
    height: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

@keyframes infoBoxSlide {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.info-box p {
    margin: 0.75rem 0;
    color: #333;
    line-height: 1.8;
    font-size: 1.05rem;
}

.info-box strong {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    font-weight: 600;
}

.info-box ul {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.info-box li {
    margin: 0.75rem 0;
    color: #555;
    font-size: 1.05rem;
    line-height: 1.6;
    position: relative;
}

.info-box li::marker {
    color: #667eea;
    font-weight: bold;
}

.info-box code {
    background: rgba(102, 126, 234, 0.15);
    padding: 0.35rem 0.75rem;
    border-radius: 8px;
    font-family: 'Courier New', monospace;
    color: #667eea;
    font-weight: 600;
    font-size: 0.95rem;
}

.info-box .demo-btn {
    margin-top: 1.5rem;
}

/* Payment Form Styles */
.payment-tabs {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.payment-tab {
    padding: 0.75rem;
    background: rgba(102, 126, 234, 0.1);
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    color: #667eea;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.payment-tab:hover {
    background: rgba(102, 126, 234, 0.2);
}

.payment-tab.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-color: #667eea;
}

.payment-method {
    display: none;
}

.payment-method.active {
    display: block;
    animation: fadeInContent 0.4s ease;
}

#payment-form label {
    display: block;
    margin: 1rem 0 0.5rem 0;
    color: #555;
    font-weight: 600;
    font-size: 0.9rem;
}

#payment-form input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid rgba(102, 126, 234, 0.2);
    border-radius: 10px;
    font-size: 1rem;
    color: #333;
    transition: all 0.3s ease;
}

#payment-form input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Responsive */
@media (max-width: 768px) {
    .api-modal-content {
        margin: 5% auto;
        width: 95%;
        max-width: 95%;
    }
    
    .api-modal-content h2 {
        font-size: 1.6rem;
        padding: 1.5rem 1.5rem 0.75rem 1.5rem;
    }
    
    .api-modal-content > p {
        padding: 0 1.5rem 1rem 1.5rem;
        font-size: 0.95rem;
    }
    
    .demo-container {
        padding: 1.5rem;
    }
    
    .button-group {
        grid-template-columns: 1fr;
    }
    
    .chat-container {
        height: 350px;
    }
    
    .weather-icon {
        font-size: 4rem;
    }
    
    .weather-temp {
        font-size: 2.5rem;
    }
    
    .amount-from,
    .amount-to {
        font-size: 1.4rem;
    }
    
    .conversion-arrow {
        font-size: 1.5rem;
    }
    
    .api-modal-close {
        top: 1rem;
        right: 1rem;
        width: 36px;
        height: 36px;
        font-size: 1.3rem;
    }
}

@media (max-width: 480px) {
    .api-modal-content {
        margin: 10% auto 5% auto;
        width: 98%;
        border-radius: 20px;
    }
    
    .api-modal-content h2 {
        font-size: 1.4rem;
    }
    
    .demo-container {
        padding: 1rem;
    }
    
    .chat-container {
        height: 300px;
        padding: 1rem;
    }
    
    .info-box {
        padding: 1.5rem;
    }
    
    .send-btn {
        padding: 0.875rem 1.5rem;
    }
}
