/* Apple-style Portal Design */

:root {
    --apple-blue: #007AFF;
    --apple-gray: #F5F5F7;
    --apple-dark: #1D1D1F;
    --apple-border: #D2D2D7;
    --apple-hover: #E8E8ED;
    --apple-shadow: rgba(0, 0, 0, 0.1);
}

/* Portal Login Page */
.portal-login-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.portal-login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    padding: 48px;
    max-width: 440px;
    width: 100%;
}

.portal-login-header {
    text-align: center;
    margin-bottom: 32px;
}

.portal-login-header h4 {
    font-size: 28px;
    font-weight: 600;
    color: var(--apple-dark);
    margin-bottom: 8px;
}

.portal-login-header p {
    font-size: 15px;
    color: #6e6e73;
}

.portal-input-group {
    margin-bottom: 24px;
}

.portal-input-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-dark);
    margin-bottom: 8px;
}

.portal-input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid var(--apple-border);
    border-radius: 10px;
    background: white;
    transition: all 0.2s ease;
}

.portal-input:focus {
    outline: none;
    border-color: var(--apple-blue);
    box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.portal-btn {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    font-weight: 500;
    color: white;
    background: var(--apple-blue);
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.portal-btn:hover {
    background: #0051D5;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.4);
}

.portal-btn:active {
    transform: translateY(0);
}

/* Portal Dashboard */
.portal-dashboard {
    background: var(--apple-gray);
    min-height: 100vh;
    padding: 0;
}

.portal-header {
    background: rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--apple-border);
    padding: 16px 0;
    position: sticky;
    top: 0;
    z-index: 100;
}

.portal-header-content {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-title-wrapper {
    display: flex;
    align-items: center;
    gap: 12px;
}

.portal-back-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    color: var(--apple-blue);
    background: transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.portal-back-btn:hover {
    background: var(--apple-hover);
    text-decoration: none;
}

.portal-back-btn svg {
    width: 24px;
    height: 24px;
}

.portal-community-thumbnail {
    width: auto;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    border: 1px solid var(--apple-border);
}

.portal-community-blc{
    width: auto;
    height: 100px;
    border-radius: 8px;
    margin-bottom: 30px;
    object-fit: cover;
    border: 1px solid var(--apple-border);
}

.portal-title {
    font-size: 22px;
    font-weight: 600;
    color: var(--apple-dark);
    margin: 0;
}

.portal-header-actions {
    display: flex;
    gap: 12px;
    align-items: center;
}

.portal-communities-btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-blue);
    background: rgba(0, 122, 255, 0.1);
    border: 1px solid rgba(0, 122, 255, 0.2);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.portal-communities-btn:hover {
    background: rgba(0, 122, 255, 0.2);
    color: var(--apple-blue);
    text-decoration: none;
}

.portal-logout-btn {
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-dark);
    background: transparent;
    border: 1px solid var(--apple-border);
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
}

.portal-logout-btn:hover {
    background: var(--apple-hover);
    color: var(--apple-dark);
    text-decoration: none;
}

.portal-content {
    max-width: 1400px;
    margin: 32px auto;
    padding: 0 24px;
}

.portal-welcome {
    margin-bottom: 24px;
    color: #6e6e73;
    font-size: 15px;
}

/* Folder Section */
.portal-folder-section {
    background: white;
    border-radius: 12px;
    margin-bottom: 24px;
    overflow: hidden;
    border: 1px solid var(--apple-border);
}

.portal-folder-header {
    padding: 16px 20px;
    background: var(--apple-gray);
    border-bottom: 1px solid var(--apple-border);
    display: flex;
    align-items: center;
}

.portal-folder-icon {
    width: 28px;
    height: 28px;
    margin-right: 12px;
    fill: var(--apple-blue);
}

.portal-folder-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--apple-dark);
    margin: 0;
}

.portal-folder-body {
    padding: 0;
}

.portal-file-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.portal-file-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 20px;
    border-bottom: 1px solid var(--apple-border);
    transition: background 0.15s ease;
}

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

.portal-file-item:hover {
    background: var(--apple-gray);
}

.portal-file-info {
    flex: 1;
}

.portal-file-name {
    font-size: 15px;
    font-weight: 500;
    color: var(--apple-dark);
    margin: 0 0 4px 0;
    display: flex;
    align-items: center;
}

.portal-file-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
    fill: #6e6e73;
}

.portal-file-meta {
    font-size: 13px;
    color: #6e6e73;
}

.portal-download-btn {
    padding: 6px 16px;
    font-size: 14px;
    font-weight: 500;
    color: var(--apple-blue);
    background: rgba(0, 122, 255, 0.1);
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
}

.portal-download-btn:hover {
    background: rgba(0, 122, 255, 0.2);
    color: var(--apple-blue);
    text-decoration: none;
}

.portal-download-icon {
    width: 16px;
    height: 16px;
    margin-left: 6px;
    fill: currentColor;
}

.portal-empty-state {
    padding: 48px 20px;
    text-align: center;
    color: #6e6e73;
}

.portal-empty-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    opacity: 0.3;
}

/* Communities Grid */
.portal-communities-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.portal-community-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--apple-border);
    transition: all 0.2s ease;
    text-decoration: none;
    display: block;
    cursor: pointer;
}

.portal-community-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--apple-shadow);
    text-decoration: none;
}

.portal-community-card-image {
    width: 100%;
    height: 180px;
    overflow: hidden;
    background: var(--apple-gray);
    display: flex;
    align-items: center;
    justify-content: center;
}

.portal-community-card-image img {
    width: auto;
    height: auto;
    object-fit: cover;
}

.portal-community-card-placeholder {
    color: #D2D2D7;
}

.portal-community-card-placeholder svg {
    width: 64px;
    height: 64px;
}

.portal-community-card-content {
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.portal-community-card-title {
    font-size: 17px;
    font-weight: 600;
    color: var(--apple-dark);
    margin: 0;
}

.portal-community-card-arrow {
    width: 24px;
    height: 24px;
    color: #6e6e73;
    transition: transform 0.2s ease;
}

.portal-community-card:hover .portal-community-card-arrow {
    transform: translateX(4px);
    color: var(--apple-blue);
}

/* Alerts */
.portal-alert {
    padding: 12px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 14px;
}

.portal-alert-success {
    background: rgba(52, 199, 89, 0.1);
    color: #248A3D;
    border: 1px solid rgba(52, 199, 89, 0.2);
}

.portal-alert-danger {
    background: rgba(255, 59, 48, 0.1);
    color: #D70015;
    border: 1px solid rgba(255, 59, 48, 0.2);
}

.portal-alert-info {
    background: rgba(0, 122, 255, 0.1);
    color: #0051D5;
    border: 1px solid rgba(0, 122, 255, 0.2);
}

/* Responsive */
@media (max-width: 768px) {
    .portal-login-card {
        padding: 32px 24px;
        margin: 16px;
    }

    .portal-header-content {
        padding: 0 16px;
    }

    .portal-content {
        padding: 0 16px;
    }

    .portal-title {
        font-size: 18px;
    }

    .portal-file-item {
        flex-direction: column;
        align-items: flex-start;
    }

    .portal-download-btn {
        margin-top: 12px;
        width: 100%;
        justify-content: center;
    }
}
