/**
 * Google Analytics Admin Styles
 *
 * @since 1.0.57
 * @package Rocketship_SEO
 */

/* Dashboard Layout */
.rocketship-ga-dashboard {
    max-width: 1400px;
    margin: 20px auto;
}

.rocketship-ga-dashboard h1 {
    display: flex;
    align-items: center;
}

.rocketship-ga-dashboard h1 .dashicons {
    color: #F9AB00;
}

/* Setup Container */
.ga-setup-container {
    max-width: 800px;
    margin: 30px auto;
}

.ga-setup-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 12px;
    padding: 40px;
    text-align: center;
}

.ga-setup-icon {
    margin-bottom: 20px;
}

.ga-setup-card h2 {
    margin: 0 0 10px 0;
    font-size: 24px;
    color: #1e1e1e;
}

.ga-setup-card > p {
    color: #666;
    margin-bottom: 30px;
    font-size: 15px;
}

/* Setup Steps */
.ga-setup-steps {
    text-align: left;
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

.ga-setup-steps h3 {
    margin-bottom: 20px;
    font-size: 18px;
}

.setup-step {
    display: flex;
    gap: 20px;
    margin-bottom: 25px;
    padding-bottom: 25px;
    border-bottom: 1px solid #f0f0f0;
}

.setup-step:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.step-number {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    flex-shrink: 0;
    font-size: 14px;
}

.step-content {
    flex: 1;
}

.step-content strong {
    display: block;
    margin-bottom: 5px;
    font-size: 15px;
}

.step-content p {
    color: #666;
    margin: 0 0 10px 0;
    font-size: 14px;
}

/* Redirect URI Box */
.redirect-uri-box {
    display: flex;
    gap: 10px;
    align-items: center;
    background: #f5f5f5;
    padding: 12px;
    border-radius: 6px;
    margin-top: 10px;
}

.redirect-uri-box code {
    flex: 1;
    padding: 10px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    word-break: break-all;
    font-size: 13px;
}

.copy-uri-btn {
    flex-shrink: 0;
}

/* Credentials Form */
.ga-credentials-form {
    margin-top: 20px;
}

.ga-credentials-form .form-field {
    margin-bottom: 15px;
}

.ga-credentials-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.ga-credentials-form input[type="text"],
.ga-credentials-form input[type="password"] {
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
}

.password-field {
    position: relative;
    display: flex;
}

.password-field input {
    padding-right: 45px;
}

.toggle-password {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    color: #666;
}

.toggle-password:hover {
    color: #2271b1;
}

#ga-connect-btn {
    margin-top: 20px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 30px;
    font-size: 15px;
}

/* Connected Header */
.ga-connected-header {
    display: flex;
    align-items: center;
    gap: 30px;
    background: #fff;
    padding: 20px 25px;
    border: 1px solid #ddd;
    border-radius: 10px;
    margin-bottom: 25px;
    flex-wrap: wrap;
}

.ga-account-info {
    display: flex;
    align-items: center;
    gap: 15px;
}

.ga-account-avatar {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 2px solid #e1e1e1;
}

.ga-account-details {
    display: flex;
    flex-direction: column;
}

.ga-account-details strong {
    font-size: 16px;
    color: #1e1e1e;
}

.ga-email {
    color: #666;
    font-size: 13px;
}

.ga-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    margin-top: 3px;
    font-weight: 500;
}

.ga-status.connected {
    color: #00a32a;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #00a32a;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { opacity: 1; }
    50% { opacity: 0.5; }
    100% { opacity: 1; }
}

.ga-property-info {
    flex: 1;
    text-align: center;
}

.property-label {
    color: #666;
    font-size: 13px;
}

.property-name {
    font-weight: 600;
    margin: 0 5px;
    color: #1e1e1e;
}

.property-id {
    color: #666;
    font-size: 13px;
}

.ga-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
}

.ga-header-actions .button {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* Date Range */
.ga-date-range {
    margin-bottom: 25px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ga-date-range label {
    font-weight: 500;
    color: #1e1e1e;
}

.ga-date-range select {
    padding: 8px 35px 8px 12px;
    min-width: 160px;
    font-size: 14px;
    border-radius: 6px;
}

/* Stats Grid */
.ga-stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 15px;
    margin-bottom: 30px;
}

.ga-stat-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ga-stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.08);
}

.ga-stat-card.loading {
    opacity: 0.6;
    pointer-events: none;
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-icon .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
    color: #fff;
}

.stat-icon.pageviews { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); }
.stat-icon.sessions { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.stat-icon.users { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.stat-icon.new-users { background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%); }
.stat-icon.duration { background: linear-gradient(135deg, #fa709a 0%, #fee140 100%); }
.stat-icon.bounce { background: linear-gradient(135deg, #ff9a9e 0%, #fad0c4 100%); }
.stat-icon.engagement { background: linear-gradient(135deg, #a18cd1 0%, #fbc2eb 100%); }

.stat-content {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.stat-value {
    font-size: 26px;
    font-weight: 700;
    color: #1e1e1e;
    line-height: 1.2;
}

.stat-label {
    font-size: 13px;
    color: #666;
    margin-top: 2px;
}

/* Data Section */
.ga-data-section {
    margin-top: 30px;
}

.ga-data-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(450px, 1fr));
    gap: 20px;
}

.ga-data-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px 25px;
}

.ga-data-card h3 {
    margin: 0 0 20px 0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 16px;
    color: #1e1e1e;
    padding-bottom: 15px;
    border-bottom: 1px solid #eee;
}

.ga-data-card h3 .dashicons {
    color: #2271b1;
}

.ga-table-container {
    min-height: 200px;
}

.loading-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    color: #666;
}

/* Tables */
.ga-table {
    width: 100%;
    border-collapse: collapse;
}

.ga-table th,
.ga-table td {
    padding: 12px 10px;
    text-align: left;
    border-bottom: 1px solid #f0f0f0;
}

.ga-table th {
    font-weight: 600;
    color: #666;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ga-table td {
    font-size: 14px;
    color: #1e1e1e;
}

.ga-table tr:last-child td {
    border-bottom: none;
}

.ga-table tr:hover td {
    background: #f9f9f9;
}

.page-title {
    max-width: 220px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.page-path {
    color: #666;
    font-size: 12px;
}

.source-medium {
    display: flex;
    flex-direction: column;
}

.source-name {
    font-weight: 500;
}

.medium-name {
    color: #666;
    font-size: 12px;
}

/* Property Selection */
.ga-property-selection {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 30px;
    margin-top: 20px;
}

.ga-property-selection h2 {
    margin: 0 0 10px 0;
}

.ga-property-selection > p {
    color: #666;
    margin-bottom: 20px;
}

.ga-properties-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 20px;
    color: #666;
}

.ga-property-list {
    display: grid;
    gap: 10px;
    margin-top: 20px;
}

.ga-property-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 18px 20px;
    border: 2px solid #ddd;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s, transform 0.2s;
}

.ga-property-item:hover {
    border-color: #2271b1;
    background: #f0f6fc;
    transform: translateX(5px);
}

.ga-property-item.selected {
    border-color: #2271b1;
    background: #f0f6fc;
}

.ga-property-item input[type="radio"] {
    margin: 0;
    width: 18px;
    height: 18px;
}

.property-details {
    flex: 1;
}

.property-details strong {
    display: block;
    margin-bottom: 4px;
    font-size: 15px;
}

.property-details small {
    color: #666;
    font-size: 13px;
}

.property-select-btn {
    margin-top: 20px;
}

/* Modal */
.ga-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.6);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

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

.ga-modal-content {
    background: #fff;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    max-height: 80vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: slideUp 0.3s ease;
}

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

.ga-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 25px;
    border-bottom: 1px solid #ddd;
}

.ga-modal-header h2 {
    margin: 0;
    font-size: 18px;
}

.ga-modal-close {
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    padding: 5px;
    line-height: 1;
    color: #666;
    transition: color 0.2s;
}

.ga-modal-close:hover {
    color: #d63638;
}

.ga-modal-body {
    padding: 25px;
    overflow-y: auto;
}

/* Empty State */
.ga-empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.ga-empty-state .dashicons {
    font-size: 48px;
    width: 48px;
    height: 48px;
    color: #ddd;
    margin-bottom: 15px;
}

.ga-empty-state h3 {
    margin: 0 0 10px 0;
    color: #1e1e1e;
}

.ga-empty-state p {
    margin: 0;
}

/* Responsive */
@media (max-width: 1200px) {
    .ga-data-row {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 782px) {
    .ga-connected-header {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    
    .ga-property-info {
        width: 100%;
    }
    
    .ga-header-actions {
        width: 100%;
        justify-content: center;
        flex-wrap: wrap;
    }
    
    .ga-stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .setup-step {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .ga-setup-card {
        padding: 25px;
    }
}

@media (max-width: 480px) {
    .ga-stats-grid {
        grid-template-columns: 1fr;
    }
    
    .ga-stat-card {
        padding: 15px;
    }
    
    .stat-value {
        font-size: 22px;
    }
}
