/* AWS Management Console Styles */

:root {
    --aws-orange: #ff9900;
    --aws-orange-dark: #ec7211;
    --aws-blue: #232f3e;
    --aws-blue-light: #37475a;
    --aws-gray-50: #fafafa;
    --aws-gray-100: #f2f3f3;
    --aws-gray-200: #eaeded;
    --aws-gray-300: #d5dbdb;
    --aws-gray-400: #aab7b8;
    --aws-gray-500: #879596;
    --aws-gray-600: #545b5d;
    --aws-gray-700: #414749;
    --aws-gray-800: #232f3e;
    --aws-white: #ffffff;
    --aws-green: #1d8102;
    --aws-red: #d13212;
    --sidebar-width: 280px;
    --border-radius: 4px;
    --transition: all 0.2s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Amazon Ember', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--aws-gray-50);
    color: var(--aws-gray-800);
    font-size: 14px;
    line-height: 1.4;
}

/* Header */
.aws-header {
    background: var(--aws-blue);
    color: var(--aws-white);
    height: 48px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}

.aws-logo {
    display: flex;
    align-items: center;
    margin-right: 24px;
}

.aws-logo-icon {
    background: var(--aws-orange);
    width: 24px;
    height: 24px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 11px;
    margin-right: 8px;
}

.aws-service-title {
    font-weight: 600;
    font-size: 16px;
}

.aws-header-controls {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 16px;
}

/* User Menu */
.aws-user-menu {
    position: relative;
}

.aws-user-button {
    background: transparent;
    border: 1px solid #555;
    color: var(--aws-white);
    padding: 6px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.aws-user-button:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: #777;
}

.aws-user-icon {
    font-size: 14px;
}

.aws-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.aws-user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--aws-white);
    border: 1px solid var(--aws-gray-300);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 200px;
    z-index: 1001;
    display: none;
    margin-top: 4px;
}

.aws-user-dropdown.show {
    display: block;
}

.aws-user-info {
    padding: 12px;
    border-bottom: 1px solid var(--aws-gray-200);
    background: var(--aws-gray-50);
}

.aws-user-email {
    font-size: 13px;
    color: var(--aws-gray-800);
    font-weight: 500;
    margin-bottom: 4px;
}

.aws-user-groups {
    font-size: 11px;
    color: var(--aws-gray-600);
}

.aws-user-divider {
    height: 1px;
    background: var(--aws-gray-200);
}

.aws-user-item {
    padding: 8px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--aws-gray-800);
    font-size: 13px;
    transition: var(--transition);
}

.aws-user-item:hover {
    background: var(--aws-gray-100);
}

.aws-user-item-icon {
    font-size: 14px;
}

/* Region Selector */
.aws-region-selector {
    position: relative;
}

.aws-region-button {
    background: transparent;
    border: 1px solid #555;
    color: var(--aws-white);
    padding: 6px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: var(--transition);
}

.aws-region-button:hover {
    border-color: var(--aws-orange);
}

.aws-region-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--aws-white);
    border: 1px solid var(--aws-gray-200);
    border-radius: var(--border-radius);
    min-width: 250px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
    z-index: 2000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.aws-region-item {
    padding: 10px 12px;
    cursor: pointer;
    font-size: 13px;
    border-bottom: 1px solid var(--aws-gray-100);
    color: var(--aws-gray-800);
    transition: var(--transition);
}

.aws-region-item:hover {
    background: var(--aws-gray-50);
}

.aws-region-item.active {
    background: var(--aws-orange);
    color: var(--aws-white);
}

/* Refresh Button */
.aws-refresh-btn {
    background: transparent;
    border: 1px solid #555;
    color: var(--aws-white);
    padding: 6px 12px;
    border-radius: var(--border-radius);
    cursor: pointer;
    font-size: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.aws-refresh-btn:hover {
    border-color: var(--aws-orange);
}

.aws-refresh-btn.loading #refreshIcon {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Layout */
.aws-layout {
    display: flex;
    height: 100vh;
    padding-top: 48px;
}

/* Sidebar */
.aws-sidebar {
    width: var(--sidebar-width);
    background: var(--aws-white);
    border-right: 1px solid var(--aws-gray-200);
    overflow-y: auto;
    position: fixed;
    left: 0;
    top: 48px;
    bottom: 0;
}

.aws-sidebar-header {
    padding: 20px 16px;
    border-bottom: 1px solid var(--aws-gray-200);
    background: var(--aws-gray-50);
}

.aws-sidebar-title {
    font-weight: 600;
    color: var(--aws-gray-800);
    font-size: 18px;
    margin-bottom: 4px;
}

.aws-sidebar-subtitle {
    font-size: 13px;
    color: var(--aws-gray-500);
}

.aws-nav-section {
    border-bottom: 1px solid var(--aws-gray-100);
}

.aws-nav-header {
    padding: 12px 16px 8px;
    font-weight: 600;
    font-size: 11px;
    color: var(--aws-gray-500);
    text-transform: uppercase;
    background: var(--aws-gray-50);
    letter-spacing: 0.5px;
}

.aws-nav-item {
    display: flex;
    align-items: center;
    padding: 8px 16px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.aws-nav-item:hover {
    background: var(--aws-gray-50);
}

.aws-nav-item.active {
    background: #fff3e0;
    border-left-color: var(--aws-orange);
    color: var(--aws-orange);
    font-weight: 500;
}

.aws-nav-icon {
    width: 18px;
    margin-right: 12px;
    text-align: center;
}

.aws-nav-text {
    flex: 1;
}

.aws-nav-count {
    background: var(--aws-gray-200);
    color: var(--aws-gray-700);
    padding: 2px 6px;
    border-radius: 8px;
    font-size: 10px;
    font-weight: 500;
}

.aws-nav-item.active .aws-nav-count {
    background: var(--aws-orange);
    color: var(--aws-white);
}

/* Expandable navigation styles */
.aws-nav-item.expandable {
    position: relative;
}

.aws-nav-expand {
    margin-left: auto;
    font-size: 12px;
    color: var(--aws-gray-500);
    transition: var(--transition);
}

.aws-nav-subitems {
    background: var(--aws-gray-100);
    border-left: 2px solid var(--aws-gray-200);
    margin-left: 16px;
}

.aws-nav-subitem {
    display: flex;
    align-items: center;
    padding: 6px 16px;
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    border-left: 2px solid transparent;
}

.aws-nav-subitem:hover {
    background: var(--aws-gray-200);
}

.aws-nav-subitem.active {
    background: #fff3e0;
    border-left-color: var(--aws-orange);
    color: var(--aws-orange);
    font-weight: 500;
}

.aws-nav-subitem .aws-nav-icon {
    width: 16px;
    margin-right: 8px;
    font-size: 12px;
}

.aws-nav-subitem .aws-nav-count {
    margin-left: auto;
    font-size: 11px;
    background: var(--aws-gray-300);
    color: var(--aws-gray-700);
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
}

.aws-nav-subitem.active .aws-nav-count {
    background: var(--aws-orange);
    color: var(--aws-white);
}

/* Resource table styles */
.aws-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--aws-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.aws-table th {
    background: var(--aws-gray-100);
    color: var(--aws-gray-700);
    font-weight: 600;
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--aws-gray-200);
    font-size: 13px;
}

.aws-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--aws-gray-200);
    font-size: 13px;
}

.aws-table tr:hover {
    background: var(--aws-gray-50);
}

.aws-table-primary {
    font-weight: 500;
    color: var(--aws-blue);
}

.aws-status-badge {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: uppercase;
}

.aws-status-badge.running,
.aws-status-badge.available,
.aws-status-badge.active {
    background: #d4edda;
    color: #155724;
}

.aws-status-badge.stopped,
.aws-status-badge.terminated {
    background: #f8d7da;
    color: #721c24;
}

.aws-status-badge.pending,
.aws-status-badge.stopping {
    background: #fff3cd;
    color: #856404;
}

.aws-external-link {
    color: var(--aws-blue);
    text-decoration: none;
    font-size: 16px;
    font-weight: bold;
    padding: 4px 8px;
    border-radius: 4px;
    transition: var(--transition);
}

.aws-external-link:hover {
    background: var(--aws-gray-100);
    color: var(--aws-orange);
}

/* Tab styles */
.aws-tabs {
    display: flex;
    border-bottom: 1px solid var(--aws-gray-200);
    margin-bottom: 20px;
}

.aws-tab {
    padding: 12px 20px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: var(--transition);
    font-weight: 500;
    color: var(--aws-gray-600);
}

.aws-tab:hover {
    color: var(--aws-blue);
    background: var(--aws-gray-50);
}

.aws-tab.active {
    color: var(--aws-orange);
    border-bottom-color: var(--aws-orange);
    background: var(--aws-white);
}

.aws-tab-content {
    min-height: 400px;
}

/* Main Content */
.aws-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    background: var(--aws-gray-50);
}

.aws-content {
    padding: 24px;
    max-width: 1400px;
}

/* Page Header */
.aws-page-header {
    background: var(--aws-white);
    border: 1px solid var(--aws-gray-200);
    border-radius: var(--border-radius);
    padding: 24px;
    margin-bottom: 24px;
}

.aws-page-title {
    font-size: 28px;
    font-weight: 300;
    color: var(--aws-gray-800);
    margin-bottom: 8px;
}

.aws-page-description {
    color: var(--aws-gray-500);
    margin-bottom: 16px;
}

.aws-page-meta {
    display: flex;
    gap: 24px;
    font-size: 12px;
    color: var(--aws-gray-500);
    flex-wrap: wrap;
}

/* Overview Grid */
.aws-overview-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.aws-overview-card {
    background: var(--aws-white);
    border: 1px solid var(--aws-gray-200);
    border-radius: var(--border-radius);
    padding: 20px;
    cursor: pointer;
    transition: var(--transition);
}

.aws-overview-card:hover {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-color: var(--aws-orange);
    transform: translateY(-1px);
}

.aws-overview-number {
    font-size: 28px;
    font-weight: 300;
    color: var(--aws-gray-800);
    margin-bottom: 8px;
}

.aws-overview-label {
    font-weight: 500;
    color: var(--aws-gray-700);
    margin-bottom: 4px;
}

.aws-overview-description {
    font-size: 12px;
    color: var(--aws-gray-500);
}

/* Quick Access Section */
.aws-quick-access {
    background: var(--aws-white);
    border: 1px solid var(--aws-gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.aws-section-header {
    background: var(--aws-gray-50);
    padding: 20px 24px;
    border-bottom: 1px solid var(--aws-gray-200);
}

.aws-section-header h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--aws-gray-800);
    margin-bottom: 4px;
}

.aws-section-header p {
    font-size: 14px;
    color: var(--aws-gray-500);
}

.aws-service-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
    padding: 24px;
}

.aws-service-card {
    background: var(--aws-white);
    border: 1px solid var(--aws-gray-200);
    border-radius: var(--border-radius);
    padding: 16px;
    cursor: pointer;
    transition: var(--transition);
}

.aws-service-card:hover {
    border-color: var(--aws-orange);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.aws-service-card-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.aws-service-icon {
    width: 32px;
    height: 32px;
    background: var(--aws-orange);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    color: var(--aws-white);
    margin-right: 12px;
}

.aws-service-info h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--aws-gray-800);
    margin-bottom: 2px;
}

.aws-service-info p {
    font-size: 12px;
    color: var(--aws-gray-500);
}

.aws-service-stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.aws-resource-count {
    background: var(--aws-orange);
    color: var(--aws-white);
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 600;
}

/* Table Styles */
.aws-table-container {
    overflow-x: auto;
    background: var(--aws-white);
    border-radius: var(--border-radius);
}

.aws-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--aws-white);
    font-size: 13px;
}

.aws-table th {
    background: var(--aws-gray-50);
    padding: 12px 16px;
    text-align: left;
    font-weight: 500;
    font-size: 12px;
    color: var(--aws-gray-700);
    border-bottom: 1px solid var(--aws-gray-200);
    white-space: nowrap;
}

.aws-table td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--aws-gray-100);
    vertical-align: middle;
}

.aws-table tbody tr:hover {
    background: var(--aws-gray-50);
}

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

/* Status Indicators */
.aws-status {
    display: inline-flex;
    align-items: center;
    padding: 3px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
    text-transform: capitalize;
}

.aws-status.running,
.aws-status.active,
.aws-status.available {
    background: #e8f5e8;
    color: var(--aws-green);
}

.aws-status.stopped,
.aws-status.terminated {
    background: #ffebee;
    color: var(--aws-red);
}

.aws-status.pending,
.aws-status.starting {
    background: #e3f2fd;
    color: #1976d2;
}

.status-indicator {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 500;
}

.status-indicator.online {
    color: var(--aws-green);
}

.status-indicator.offline {
    color: var(--aws-red);
}

/* External Link Icon */
.aws-external-icon {
    color: var(--aws-orange);
    text-decoration: none;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    border-radius: 2px;
    transition: var(--transition);
}

.aws-external-icon:hover {
    background: var(--aws-gray-100);
    transform: scale(1.1);
}

/* Region Badge */
.aws-region-badge {
    background: var(--aws-gray-100);
    color: var(--aws-gray-700);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

/* Tags */
.aws-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.aws-tag {
    background: var(--aws-gray-100);
    color: var(--aws-gray-700);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 10px;
    font-weight: 500;
}

/* Loading States */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3000;
    backdrop-filter: blur(2px);
}

.loading-content {
    background: var(--aws-white);
    padding: 32px;
    border-radius: var(--border-radius);
    text-align: center;
    box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.aws-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid var(--aws-gray-200);
    border-top-color: var(--aws-orange);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 16px;
}

.loading-text {
    font-size: 14px;
    color: var(--aws-gray-700);
    font-weight: 500;
}

/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 60px;
    right: 20px;
    z-index: 4000;
}

.toast {
    background: var(--aws-white);
    border: 1px solid var(--aws-gray-200);
    border-radius: var(--border-radius);
    padding: 16px;
    margin-bottom: 8px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--aws-green);
}

.toast.error {
    border-left: 4px solid var(--aws-red);
}

.toast.warning {
    border-left: 4px solid var(--aws-orange);
}

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

/* Service View */
.aws-service-view {
    background: var(--aws-white);
    border: 1px solid var(--aws-gray-200);
    border-radius: var(--border-radius);
    overflow: hidden;
}

.aws-service-header {
    background: var(--aws-gray-50);
    padding: 20px 24px;
    border-bottom: 1px solid var(--aws-gray-200);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.aws-service-info {
    display: flex;
    align-items: center;
}

.aws-service-details h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--aws-gray-800);
    margin-bottom: 4px;
}

.aws-service-details p {
    font-size: 14px;
    color: var(--aws-gray-500);
}

.aws-service-stats {
    text-align: right;
}

.aws-resource-count-large {
    font-size: 24px;
    font-weight: 300;
    color: var(--aws-gray-800);
    margin-bottom: 4px;
}

.aws-resource-label {
    font-size: 12px;
    color: var(--aws-gray-500);
}

/* Resource Tabs */
.aws-resource-tabs {
    display: flex;
    background: var(--aws-gray-50);
    border-bottom: 1px solid var(--aws-gray-200);
    overflow-x: auto;
}

.aws-resource-tab {
    padding: 12px 20px;
    border-right: 1px solid var(--aws-gray-200);
    color: var(--aws-gray-700);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
    background: transparent;
    border-bottom: 3px solid transparent;
}

.aws-resource-tab:hover {
    background: var(--aws-gray-100);
}

.aws-resource-tab.active {
    background: var(--aws-white);
    color: var(--aws-orange);
    border-bottom-color: var(--aws-orange);
}

/* Empty States */
.aws-empty {
    text-align: center;
    padding: 48px 24px;
    color: var(--aws-gray-500);
}

.aws-empty-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.3;
}

.aws-empty-title {
    font-size: 18px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--aws-gray-700);
}

.aws-empty-description {
    font-size: 14px;
}

/* Responsive Design */
@media (max-width: 768px) {
    .aws-sidebar {
        transform: translateX(-100%);
        transition: transform 0.3s ease;
    }
    
    .aws-sidebar.open {
        transform: translateX(0);
    }
    
    .aws-main {
        margin-left: 0;
    }
    
    .aws-content {
        padding: 16px;
    }
    
    .aws-overview-grid {
        grid-template-columns: 1fr;
    }
    
    .aws-service-grid {
        grid-template-columns: 1fr;
    }
    
    .aws-page-meta {
        flex-direction: column;
        gap: 8px;
    }
}

/* Utility Classes */
.hidden {
    display: none !important;
}

.text-center {
    text-align: center;
}

.font-bold {
    font-weight: 600;
}

.text-sm {
    font-size: 12px;
}

.mb-4 {
    margin-bottom: 16px;
}

.mt-4 {
    margin-top: 16px;
}

/* App Switcher Styles */
.app-switcher {
    position: relative;
    margin-right: 12px;
}

.app-switcher-button {
    background: transparent;
    border: none;
    color: var(--aws-white);
    padding: 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
    width: 32px;
    height: 32px;
}

.app-switcher-button:hover {
    background: rgba(255, 255, 255, 0.1);
}

.app-switcher-icon {
    font-size: 16px;
}

.app-switcher-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: var(--aws-white);
    border: 1px solid var(--aws-gray-300);
    border-radius: var(--border-radius);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    min-width: 280px;
    z-index: 1001;
    display: none;
    margin-top: 8px;
}

.app-switcher-dropdown.show {
    display: block;
}

.app-switcher-header {
    padding: 12px 16px;
    border-bottom: 1px solid var(--aws-gray-200);
    font-weight: 500;
    font-size: 14px;
    color: var(--aws-gray-700);
    background: var(--aws-gray-50);
}

.app-switcher-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 16px;
    max-height: 240px;
}

.app-switcher-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 12px 8px;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    text-align: center;
    min-height: 70px;
    justify-content: center;
}

.app-switcher-item:hover {
    background: var(--aws-gray-100);
}

.app-switcher-item.active {
    background: rgba(255, 153, 0, 0.1);
    border: 1px solid var(--aws-orange);
}

.app-switcher-item.active:hover {
    background: rgba(255, 153, 0, 0.15);
}

.app-icon {
    font-size: 24px;
    margin-bottom: 4px;
}

.app-name {
    font-size: 11px;
    color: var(--aws-gray-700);
    font-weight: 500;
    line-height: 1.2;
}

.app-switcher-item.active .app-name {
    color: var(--aws-orange-dark);
}
