/**
 * OAuth Connection Manager Styles
 * OAuth bağlantı butonları ve durumları için stil tanımları
 * 
 * @author selcukmart <admin@hostingdevi.com>
 * @date 01.12.2025
 * @version 1.0.8
 */

/* ========================================
   OAuth Buttons
   ======================================== */

.oauth-btn-connect,
.oauth-btn-revoke {
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.oauth-btn-connect:hover,
.oauth-btn-revoke:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.oauth-btn-connect:active,
.oauth-btn-revoke:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* Connect Button - Success themed */
.oauth-btn-connect {
    background: linear-gradient(135deg, #27ae60 0%, #229954 100%);
    border: none;
}

.oauth-btn-connect:hover {
    background: linear-gradient(135deg, #229954 0%, #1e8449 100%);
}

/* Revoke Button - Danger themed */
.oauth-btn-revoke {
    background: linear-gradient(135deg, #e74c3c 0%, #c0392b 100%);
    border: none;
}

.oauth-btn-revoke:hover {
    background: linear-gradient(135deg, #c0392b 0%, #a93226 100%);
}

/* Loading state */
.oauth-btn-connect.loading,
.oauth-btn-revoke.loading {
    pointer-events: none;
    opacity: 0.7;
}

.oauth-btn-connect.loading:after,
.oauth-btn-revoke.loading:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin: -8px 0 0 -8px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: oauth-spinner 0.6s linear infinite;
}

@keyframes oauth-spinner {
    to {
        transform: rotate(360deg);
    }
}

/* ========================================
   OAuth Status Indicators
   ======================================== */

.oauth-connection-section {
    animation: oauth-fadeIn 0.4s ease;
}

@keyframes oauth-fadeIn {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.oauth-status-indicator {
    animation: oauth-slideIn 0.3s ease;
}

@keyframes oauth-slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Status dot pulse animation */
.oauth-status-indicator .status-dot {
    animation: oauth-pulse 2s ease-in-out infinite;
}

@keyframes oauth-pulse {
    0%, 100% {
        opacity: 1;
        transform: scale(1);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.1);
    }
}

/* ========================================
   Connection Details
   ======================================== */

.oauth-connection-details {
    animation: oauth-fadeIn 0.5s ease 0.2s both;
}

.oauth-connection-details i {
    transition: color 0.3s ease;
}

.oauth-connection-details:hover i {
    color: #3498db !important;
}

/* ========================================
   Expiry Warning
   ======================================== */

.oauth-expiry-warning {
    animation: oauth-warningPulse 2s ease-in-out infinite;
}

@keyframes oauth-warningPulse {
    0%, 100% {
        background-color: #fff3cd;
        border-color: #ffc107;
    }
    50% {
        background-color: #ffe8a1;
        border-color: #ffb300;
    }
}

.oauth-expiry-warning i {
    animation: oauth-warningIcon 1s ease-in-out infinite;
}

@keyframes oauth-warningIcon {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.1);
    }
}

/* ========================================
   Form Button States (disabled)
   ======================================== */

.settings-form button[disabled].btn {
    position: relative;
    overflow: hidden;
}

.settings-form button[disabled].btn:after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    animation: oauth-disabled-shimmer 2s infinite;
}

@keyframes oauth-disabled-shimmer {
    0% {
        left: -100%;
    }
    50%, 100% {
        left: 100%;
    }
}

/* ========================================
   Tooltips
   ======================================== */

.oauth-btn-connect[data-original-title],
.oauth-btn-revoke[data-original-title] {
    cursor: help;
}

/* Bootstrap tooltip override for OAuth buttons */
.tooltip.oauth-tooltip .tooltip-inner {
    max-width: 300px;
    padding: 8px 12px;
    font-size: 12px;
    background-color: #2c3e50;
}

.tooltip.oauth-tooltip.top .tooltip-arrow {
    border-top-color: #2c3e50;
}

/* ========================================
   Responsive
   ======================================== */

@media (max-width: 768px) {
    .oauth-btn-connect,
    .oauth-btn-revoke {
        width: 100%;
        margin-bottom: 10px;
    }
    
    .oauth-connection-section {
        padding: 15px;
    }
    
    .oauth-status-indicator {
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .oauth-connection-details {
        font-size: 11px;
    }
}

/* ========================================
   Dark Mode Support (opsiyonel)
   ======================================== */

@media (prefers-color-scheme: dark) {
    .oauth-connection-section {
        background: #1e1e1e;
        border-color: #404040;
    }
    
    .oauth-info-text {
        color: #b0b0b0;
    }
    
    .oauth-connection-details {
        color: #b0b0b0;
    }
}

/* ========================================
   Print Styles
   ======================================== */

@media print {
    .oauth-btn-connect,
    .oauth-btn-revoke {
        display: none !important;
    }
    
    .oauth-expiry-warning {
        animation: none;
        background-color: #fff3cd !important;
        border-color: #ffc107 !important;
    }
    
    .oauth-status-indicator .status-dot {
        animation: none;
    }
}

/* ========================================
   Accessibility
   ======================================== */

.oauth-btn-connect:focus,
.oauth-btn-revoke:focus {
    outline: 3px solid rgba(0, 123, 255, 0.5);
    outline-offset: 2px;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .oauth-btn-connect,
    .oauth-btn-revoke {
        border: 2px solid currentColor;
    }
    
    .oauth-status-indicator {
        border-width: 2px;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .oauth-btn-connect,
    .oauth-btn-revoke,
    .oauth-connection-section,
    .oauth-status-indicator,
    .oauth-connection-details,
    .oauth-expiry-warning {
        animation: none !important;
        transition: none !important;
    }
}
