/* DC Smart License - Frontend Styles */

/* License Cards Grid */
.woocommerce-account-licenses {
    margin-bottom: 30px !important;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

.licenses-list {
    display: flex !important;
    flex-direction: column !important;
    gap: 20px !important;
    margin-bottom: 30px !important;
}

.license-item {
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 20px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    transition: box-shadow 0.3s ease !important;
    display: block !important;
    position: relative !important;
}

.license-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15) !important;
}

.license-item.license-status-expired {
    border-left: 4px solid #d63638 !important;
}

.license-item.license-status-active {
    border-left: 4px solid #00a32a !important;
}

.license-item.license-status-revoked {
    border-left: 4px solid #dba617 !important;
}

.license-item.license-status-disabled {
    border-left: 4px solid #8c8f94 !important;
}

/* License Header */
.license-header {
    display: flex !important;
    justify-content: space-between !important;
    align-items: flex-start !important;
    margin-bottom: 15px !important;
    padding-bottom: 10px !important;
    border-bottom: 1px solid #f0f0f1 !important;
}

.license-product {
    margin: 0;
    font-size: 1.2em;
    font-weight: 600;
    color: #1d2327;
}

.license-status {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.85em;
    font-weight: 500;
    text-transform: uppercase;
}

.license-status-active {
    background: #d1e7dd;
    color: #0f5132;
}

.license-status-expired {
    background: #f8d7da;
    color: #842029;
}

.license-status-revoked {
    background: #fff3cd;
    color: #664d03;
}

.license-status-disabled {
    background: #e2e3e5;
    color: #383d41;
}

/* License Key Section */
.license-key-section {
    margin-bottom: 15px !important;
}

.license-key-section label {
    display: block !important;
    font-weight: 600 !important;
    margin-bottom: 5px !important;
    color: #1d2327 !important;
}

.license-key-display {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    gap: 8px !important;
}

.license-key-input {
    flex: 1 !important;
    padding: 8px 12px !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 0.9em !important;
    background: #f8f9fa !important;
    color: #495057 !important;
    display: block !important;
    width: auto !important;
}

.license-key-input:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

.copy-license-key {
    padding: 8px 12px !important;
    background: #0073aa !important;
    color: #fff !important;
    border: none !important;
    border-radius: 4px !important;
    cursor: pointer !important;
    font-size: 0.85em !important;
    transition: background-color 0.2s ease !important;
    display: inline-block !important;
    white-space: nowrap !important;
}

.copy-license-key:hover {
    background: #005a87;
}

.copy-license-key:disabled {
    background: #8c8f94;
    cursor: not-allowed;
}

/* License Meta */
.license-meta {
    display: flex !important;
    flex-direction: column !important;
    gap: 8px !important;
    margin-bottom: 20px !important;
    padding: 15px 0 !important;
    border-bottom: none !important;
    font-size: 0.9em !important;
}

.license-meta-item {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    padding: 8px 0 !important;
    border-bottom: 1px solid #f0f0f1 !important;
    white-space: nowrap !important;
}

.license-meta-label {
    font-weight: 500;
    color: #646970;
}

.license-meta-value {
    color: #1d2327;
}

/* License Actions */
.license-actions {
    display: flex !important;
    justify-content: space-around !important;
    align-items: center !important;
    gap: 10px !important;
    margin-top: 15px !important;
    border-top: none !important;
    width: 100% !important;
}

.license-actions .button {
    padding: 0px 0px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.license-actions .button-primary {
    background: #0073aa;
    color: #fff;
    border: 1px solid #0073aa;
}

.license-actions .button-primary:hover {
    background: #005a87;
    border-color: #005a87;
    color: #fff;
}

.license-actions .button-secondary {
    background: #f6f7f7;
    color: #1d2327;
    border: 1px solid #ddd;
}

.license-actions .button-secondary:hover {
    background: #e8e8e9;
    border-color: #8c8f94;
    color: #1d2327;
}

/* License Details Page */
.woocommerce-account-license-details {
    max-width: 800px !important;
    margin: 0 auto !important;
    background: transparent !important;
    border: none !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
}

.back-to-licenses {
    margin-bottom: 20px;
}

.back-to-licenses a {
    text-decoration: none;
    color: #0073aa;
    font-weight: 500;
}

.back-to-licenses a:hover {
    color: #005a87;
}

.license-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 30px;
}

@media (max-width: 768px) {
    .license-info-grid {
        grid-template-columns: 1fr;
    }
}

.license-details-card {
    background: #fff !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 20px !important;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
    margin-bottom: 30px !important;
}

.license-info-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.license-summary {
    margin-bottom: 20px !important;
}

.license-product-info {
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    margin-bottom: 20px !important;
    padding-bottom: 15px !important;
    border-bottom: 1px solid #f0f0f1 !important;
}

.license-product-info h3 {
    margin: 0 !important;
    font-size: 1.2em !important;
    color: #1d2327 !important;
}

.license-product-info h3 a {
    color: #0073aa !important;
    text-decoration: none !important;
}

.license-product-info h3 a:hover {
    color: #005a87 !important;
}

.license-info-card h3 {
    margin: 0 0 15px 0;
    font-size: 1.1em;
    color: #1d2327;
}

.info-item {
    display: flex !important;
    justify-content: space-between !important;
    padding: 10px 0 !important;
    border-bottom: 1px solid #f0f0f1 !important;
}

.info-item:last-child {
    border-bottom: none !important;
}

.info-item strong {
    font-weight: 600 !important;
    color: #646970 !important;
}

.info-item span {
    color: #1d2327 !important;
    font-weight: 500 !important;
}

.license-info-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid #f0f0f1;
}

.license-info-item:last-child {
    border-bottom: none;
}

.license-info-label {
    font-weight: 500;
    color: #646970;
}

.license-info-value {
    color: #1d2327;
    text-align: right;
}

/* License Activations Section */
.license-activations-section {
    margin-top: 30px !important;
}

.license-activations-section h3 {
    margin: 20px  !important; /* align with usage heading */
    color: #1d2327 !important;
    font-size: 1.1em !important;
    font-weight: 600 !important;
}

.activations-table-wrapper {
    overflow-x: auto !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
}

.license-activations-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: #fff !important;
}

.license-activations-table th {
    background: #f8f9fa !important;
    padding: 12px !important;
    text-align: left !important;
    font-weight: 600 !important;
    color: #1d2327 !important;
    border-bottom: 1px solid #ddd !important;
    border-top: 1px solid #ddd !important;
}

.license-activations-table td {
    padding: 12px !important;
    border-bottom: 1px solid #f0f0f1 !important;
    color: #1d2327 !important;
}

.license-activations-table tr:last-child td {
    border-bottom: none !important;
}

.activation-row:hover {
    background: #f8f9fa !important;
}

.site-info .site-url a {
    color: #0073aa !important;
    text-decoration: none !important;
}

.site-info .site-url a:hover {
    color: #005a87 !important;
}

.site-label {
    font-size: 0.9em !important;
    color: #646970 !important;
    margin-top: 4px !important;
}

.status-badge {
    padding: 4px 8px !important;
    border-radius: 4px !important;
    font-size: 0.8em !important;
    font-weight: 500 !important;
    text-transform: uppercase !important;
}

.status-badge.status-active {
    background: #d1e7dd !important;
    color: #0f5132 !important;
}

.status-badge.status-expired {
    background: #f8d7da !important;
    color: #842029 !important;
}

.status-badge.status-revoked {
    background: #fff3cd !important;
    color: #664d03 !important;
}

/* License Downloads Page */
.woocommerce-account-license-downloads {
    max-width: 800px !important;
    margin: 0 auto !important;
    background: transparent !important; /* remove outer card */
    border: none !important;            /* remove outer card */
    border-radius: 0 !important;        /* remove outer card */
    padding: 0 !important;              /* remove outer card */
    box-shadow: none !important;        /* remove outer card */
}

.license-info-header {
    background: #fff !important; /* crisper card */
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 20px !important;
    margin-bottom: 30px !important;
    box-shadow: 0 4px 10px rgba(0,0,0,0.06) !important; /* stronger shadow */
}

.license-info-header h3 {
    margin: 0 0 12px 0 !important;
    font-size: 1.25em !important;
    color: #1d2327 !important;
}

.license-info-header-top {
	display: flex !important;
	align-items: center !important;
	justify-content: space-between !important;
	gap: 12px !important;
	margin-bottom: 10px !important;
}

.license-info-header-top h3 {
	margin: 0 !important;
}

#dc-license-key-text {
    display: block !important;
    flex: 1 1 auto !important; /* take remaining width */
    min-width: 0 !important;   /* allow flex shrinking */
    max-width: 100% !important;
    padding: 6px 10px !important;
    background: #f8f9fa !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-family: 'Courier New', monospace !important;
    font-size: 0.95em !important;
    color: #a51e37 !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
}

.license-info-header .copy-license-key {
    margin-left: auto !important; /* push button to far right */
    background: #0073aa !important;
    color: #fff !important;
    border: none !important;
    padding: 6px 10px !important;
    border-radius: 4px !important;
    line-height: 1 !important;
}

.license-info-header .copy-license-key:hover {
    background: #005a87 !important;
}

.license-downloads-section {
    margin-top: 30px !important;
}

.license-downloads-section h3 {
    margin-bottom: 20px !important;
    color: #1d2327 !important;
    font-size: 1.1em !important;
}

.downloads-table-wrapper {
    overflow-x: auto !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
}

.license-downloads-table {
    width: 100% !important;
    border-collapse: collapse !important;
    background: #fff !important;
}

.license-downloads-table th {
    background: #f8f9fa !important;
    padding: 12px !important;
    text-align: left !important;
    font-weight: 600 !important;
    color: #1d2327 !important;
    border-bottom: 1px solid #ddd !important;
}

.license-downloads-table td {
    padding: 12px !important;
    border-bottom: 1px solid #f0f0f1 !important;
    color: #1d2327 !important;
}

.license-downloads-table tr:last-child td {
    border-bottom: none !important;
}

.version-info strong {
    color: #1d2327 !important;
    font-weight: 600 !important;
}

.toggle-changelog {
    color: #0073aa !important;
    text-decoration: none !important;
    font-size: 0.9em !important;
    margin-left: 10px !important;
}

.toggle-changelog:hover {
    color: #005a87 !important;
}

.changelog-content {
    margin-top: 10px !important;
    padding: 15px !important;
    background: #f8f9fa !important;
    border: 1px solid #ddd !important;
    border-radius: 4px !important;
    font-size: 0.9em !important;
    line-height: 1.5 !important;
}

.download-button {
    background: #0073aa !important;
    color: #fff !important;
    border: none !important;
    padding: 8px 12px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 5px !important;
    font-size: 0.9em !important;
}

.download-button:hover {
    background: #005a87 !important;
    color: #fff !important;
}

/* Usage Instructions */
.license-usage-instructions {
    margin-top: 30px !important;
    background: #f8f9fa !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 20px !important; /* symmetric top/bottom */
}

.license-usage-instructions h3 {
    margin: 0 0 20px 0 !important; /* remove top margin for consistency */
    color: #1d2327 !important;
    font-size: 1.1em !important;
}

.usage-steps {
    display: grid !important;
    gap: 20px !important;
}

.usage-step {
    display: flex !important;
    gap: 15px !important;
    align-items: flex-start !important;
}

.step-number {
    background: #0073aa !important;
    color: #fff !important;
    width: 30px !important;
    height: 30px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-weight: 600 !important;
    font-size: 0.9em !important;
    flex-shrink: 0 !important;
}

.step-content h4 {
    margin: 0 0 8px 0 !important;
    color: #1d2327 !important;
    font-size: 1em !important;
}

.step-content p {
    margin: 0 !important;
    color: #646970 !important;
    font-size: 0.9em !important;
    line-height: 1.5 !important;
}

/* Support Information */
.license-support-info {
    margin-top: 30px !important;
    background: #fff3cd !important;
    border: 1px solid #ffeaa7 !important;
    border-radius: 8px !important;
    padding: 20px !important; /* symmetric top/bottom */
}

.license-support-info h3 {
    margin: 0 0 15px 0 !important; /* remove top margin */
    color: #664d03 !important;
    font-size: 1.1em !important;
}

.license-support-info p {
    margin: 0 0 10px 0 !important;
    color: #664d03 !important;
    font-size: 0.9em !important;
}

.support-details p {
    margin: 0 !important;
    color: #664d03 !important;
    font-size: 0.9em !important;
}

.support-details a {
    color: #0073aa !important;
    text-decoration: none !important;
}

.support-details a:hover {
    color: #005a87 !important;
}

/* License Help Section */
.licenses-help {
    background: #f8f9fa !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
    padding: 20px !important; /* reduced top padding */
    margin-top: 20px !important; /* slightly tighter spacing above */
}

.licenses-help h3 {
    margin: 0 !important; /* remove top margin */
    color: #1d2327 !important;
    font-size: 1.1em !important;
}

.licenses-help ul {
    margin: 0 !important;
    padding-left: 20px !important;
}

.licenses-help li {
    margin-bottom: 8px !important;
    color: #646970 !important;
    font-size: 0.9em !important;
    line-height: 1.5 !important;
}

/* No Licenses State */
.no-licenses {
    text-align: center !important;
    padding: 40px 20px !important;
    background: #f8f9fa !important;
    border: 1px solid #ddd !important;
    border-radius: 8px !important;
}

.no-licenses p {
    margin-bottom: 20px !important;
    color: #646970 !important;
    font-size: 1.1em !important;
}

.no-licenses .button {
    background: #0073aa !important;
    color: #fff !important;
    padding: 12px 24px !important;
    border-radius: 4px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
}

.no-licenses .button:hover {
    background: #005a87 !important;
    color: #fff !important;
}

.license-info-header h3 {
    margin: 0 0 15px 0;
    color: #1d2327;
}

.license-info-header p {
    margin: 8px 0;
    font-size: 0.95em;
    display: flex !important;
    align-items: center !important;
    gap: 10px !important;
    flex-wrap: wrap !important;
}

.license-info-header p strong {
    min-width: 110px !important; /* space between label and value */
}

#dc-license-key-text {
    margin-right: 8px !important; /* add a little space before button */
}

.license-info-header .copy-license-key {
    margin-left: auto !important; /* push button to far right */
}

.license-info-header code {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 8px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #d63384;
}

.license-inactive-notice {
    background: #f8d7da;
    border: 1px solid #f5c2c7;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 30px;
    color: #842029;
}

/* Downloads List */
.downloads-list {
    display: grid;
    gap: 15px;
}

.download-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
    transition: box-shadow 0.3s ease;
}

.download-item:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.download-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 15px;
}

.download-title {
    margin: 0;
    font-size: 1.1em;
    color: #1d2327;
}

.download-version {
    background: #0073aa;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 0.8em;
    font-weight: 500;
}

.download-meta {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 15px;
    font-size: 0.9em;
}

.download-meta-item {
    display: flex;
    justify-content: space-between;
    padding: 5px 0;
    border-bottom: 1px solid #f0f0f1;
}

.download-meta-label {
    font-weight: 500;
    color: #646970;
}

.download-meta-value {
    color: #1d2327;
}

.download-actions {
    display: flex;
    gap: 10px;
}

.download-actions .button {
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9em;
    transition: all 0.2s ease;
}

.download-actions .button-primary {
    background: #0073aa;
    color: #fff;
    border: 1px solid #0073aa;
}

.download-actions .button-primary:hover {
    background: #005a87;
    border-color: #005a87;
    color: #fff;
}

.download-actions .button-secondary {
    background: #f6f7f7;
    color: #1d2327;
    border: 1px solid #ddd;
}

.download-actions .button-secondary:hover {
    background: #e8e8e9;
    border-color: #8c8f94;
    color: #1d2327;
}

/* Changelog */
.changelog-section {
    margin-top: 20px;
}

.changelog-toggle {
    background: none;
    border: none;
    color: #0073aa;
    cursor: pointer;
    font-size: 0.9em;
    text-decoration: underline;
    padding: 0;
}

.changelog-toggle:hover {
    color: #005a87;
}

.changelog-content {
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 15px;
    margin-top: 10px;
    font-size: 0.9em;
    line-height: 1.5;
    display: none;
}

.changelog-content.show {
    display: block;
}

/* Ensure What's New is visible on downloads */
.download-changelog .changelog-content {
	display: block !important;
}

/* Downloads Help Card */
.downloads-help {
	margin-top: 20px !important;
	background: #f8f9fa !important;
	border: 1px solid #ddd !important;
	border-radius: 8px !important;
	padding: 20px !important;
}

.downloads-help h3 {
	margin: 0 0 12px 0 !important;
	color: #1d2327 !important;
	font-size: 1.1em !important;
}

.downloads-help ul {
	margin: 0 !important;
	padding-left: 20px !important;
	color: #646970 !important;
	font-size: 0.95em !important;
	line-height: 1.6 !important;
}

.downloads-help li {
	margin: 6px 0 !important;
}

/* Responsive Design */
@media (max-width: 768px) {
    .license-meta {
        grid-template-columns: 1fr;
    }
    
    .license-actions {
        flex-direction: column;
    }
    
    .download-meta {
        grid-template-columns: 1fr;
    }
    
    .download-actions {
        flex-direction: column;
    }
    
    .license-key-display {
        flex-direction: column;
        align-items: stretch;
    }
    
    .copy-license-key {
        margin-top: 8px;
    }
}

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

.licenses-empty h3 {
    margin: 0 0 10px 0;
    color: #1d2327;
}

.licenses-empty p {
    margin: 0;
    font-size: 0.95em;
}

/* Empty Activations Card */
.no-activations-card {
	background: #fff !important;
	padding: 30px !important;
	text-align: center !important;
	color: #646970 !important;
	border: 1px solid #ddd !important;
	border-radius: 8px !important;
	margin: 20px !important;
}

.no-activations-card p {
	margin: 0 0 8px 0 !important;
}
